1834604 Members
4473 Online
110069 Solutions
New Discussion

Re: Looking for a script

 
Mike Reeb
New Member

Looking for a script

I am looking for a script that will kill users that have been inactive on the system for an extended amount of time. But only if they are running a specific command I need to know where to go and look for this creature
6 REPLIES 6
harry d brown jr
Honored Contributor

Re: Looking for a script

Would you be killing applications that were written inhouse (so that you would know the outcome of killing the process) or would you want to kill processes that are third party apps?
Live Free or Die
harry d brown jr
Honored Contributor

Re: Looking for a script

I'm also assuming that the users are not at a shell prompt, correct?
Live Free or Die
nancy rippey
Trusted Contributor

Re: Looking for a script

See the following post which also discusses this issue
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xc7567e990647d4118fee0090279cd0f9,00.html
nrip
Deshpande Prashant
Honored Contributor

Re: Looking for a script

HI
Using TMOUT parameter in .profile of user will logout user after specified idle time.
TMOUT=300 (ie. 5 minutes)
readonly TMOUT (This will make sure that user will not modify this parameter.
This parameter is useful of users with idle shell prompt for specified time. It will not kill the hang processes or idle socket connections.

Thanks.
Prashant.
Take it as it comes.
Sundar_7
Honored Contributor

Re: Looking for a script



# PID=`who -u | awk '{if ($6=".") print $2}'`

# for users in `echo $PID`
> do
> kill $users
> done






Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: Looking for a script

Hey SOrry man ,,

Delete my Last Post..

I was wrong..

# PID=`who -u | awk '$6 ~ /old/ { print $7}'`

# for users in `echo $PID`
> do
> kill $users
> done

Please forget the last post

Sundar
Learn What to do ,How to do and more importantly When to do ?