kill idle users

Hi,

In my network we uses the NetTerm program to connect us to HP-UX 10.x server from windows workstations, but in some cases the user doesn't logout and close it by window's x button. The problem is that in HP-UX the user and all his tasks remain active and when he enter again HP-UX creates a new session without kill the old session. My question is how can I configure my server to kill the idle session or at least another solution?

Thanks..

See this link.

I am in the process of trying to figure out the configuration file to set the amount of time a user can idle. I didn't see anything in the files about removing orphaned sessions. I will continue to investigate and post my findings. :cool:

you do not need an script just enter next into .profile of the users .
it's a idle tomeout counter .

TMOUT=1800
readonly TMOUT

in this exaple logged out after 30 minutes of idle .

have a nice day Wim .

What happens to the user's background processes? I am assuming if they are not "nohup"ed they will be killed.

I have instituted the TMOUT entry and it works like a charm. Thanks for the help. :smiley:

$ who -u | grep 'jarhadta'
jarhadta   pts/2        Mar 26 15:46  1:15  18639  10.236.0.207
jarhadta   pts/22       Feb 15 00:50  old    9540  10.236.0.207
jarhadta   pts/23       Feb 15 00:50  old    9572  10.236.0.207
jarhadta   pts/24       Feb 15 00:50  old    9616  10.236.0.207
jarhadta   pts/25       Feb 15 00:50  old    9650  10.236.0.207
jarhadta   pts/26       Feb 15 00:50  old    9690  10.236.0.207
jarhadta   pts/27       Feb 15 00:50  old    9728  10.236.0.207
jarhadta   pts/28       Feb 15 00:50  old    9761  10.236.0.207
jarhadta   pts/29       Feb 15 00:50  old    9815  10.236.0.207
jarhadta   pts/30       Feb 15 00:51  old   10056  10.236.0.207
jarhadta   pts/31       Feb 15 00:51  old   10088  10.236.0.207
jarhadta   pts/33       Feb 15 00:51  old    9954  10.236.0.207
jarhadta   pts/32       Feb 15 00:51  old    9933  10.236.0.207
jarhadta   pts/34       Feb 15 00:51  old    9992  10.236.0.207
jarhadta   pts/36       Feb 15 00:51  old   10122  10.236.0.207
jarhadta   pts/35       Feb 15 00:51  old   10024  10.236.0.207
jarhadta   pts/37       Feb 15 00:51  old   10156  10.236.0.207

Please tell me how can i kill this user 'jarhadta' which are in old status.

who -u | grep 'jarhadta' | awk '$6=/old/{ print $7}' | xargs kill -HUP

Note, substitute the echo command for kill first to test it gives the processes you're looking for.

I cannt understand what to do. please give me a detail command using my report.

hi
awk '$6=/old/{ print $7}' | xargs kill -HUP i dont understand this. please give me the solution based on my report

Did you try the command, and if so what was the results?

You have to use the full command posted, in my original post, not just:

awk '$6=/old/{ print $7}' | xargs kill -HUP

run the below, and it should give all the process ID's you want to kill, if
not please post results.

who -u | grep 'jarhadta' | awk '$6=/old/{ print $7}'

hi
thanks. when i gave this command then i got process id and then when i want to kill that old process by using kill -9 PID(process id) then it shows no such process. It should be noted that 'jarhadta' is a ldap user. please resolve it for me.

hi,
Any one here who can help me in this issue. please help me