You could write up something that utilizes the following APIs and the ENDJOB command.
List Active Subsystems (QWCLASBS) retrieves a list of active subsystems
List Job (QUSLJOB) lists some or all jobs on the system
Retrieve Call Stack (QWVRCSTK) returns the call stack information for the specified thread.
Periodically your program performs the following:
1. Lists the active subsystems at the time.
2. Lists the jobs running in each active subsystem.
3. Retrieves the call stack for the job you are interested in.
4. If it meets your criteria for logging them off, run the ENDJOB command.
HTH
Gary
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mohan Eashver
Sent: Wednesday, January 07, 2015 5:12 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Program to auto log off interactive jobs that are IDLE, based on it's Call Stack
Hi,
Happy new year to you.
I am looking for a solution to log users off the IBM i system (interactive jobs only) after a certain amount of IDLE time.
Would love to hear from you if you have done any custom programming to auto-log off users.
I understand there is a User Profile setting to set a max idle time for a user & kill the job if it exceeds this.
But I do not like to use that.
My solution would fire off a job scheduler every 30 minutes. And look at all interactive jobs running. For each job, I like to look at the Call Stack & check the program that is currently active.
The goal is to kill a job where the user is just sitting on a menu & NOT kill jobs where user is sitting on a maintenance program possibly has un-finished updates.
I will be ignoring programs from Call Stack that begin with Q or out of library QSYS.
I would also like to give more idle time for users sitting on a particular program.
Lets say user is idle on Program A & I will give this program 12 hours before i kill it.
Lets say user is idle on Program B & I will give this program 90 minutes before i kill it.
Appreciate any tips you can give.
----
Regards,
Mohan Eashver
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.