On Tue, 7 Oct 2003, Ken Godee wrote:
> Julius Szelagiewicz wrote:
> > The simple solution is to run the following script from cron every night:
> >
> > #kill old leftover processes  - all of them
> >
> > users=$(awk -F":" '{if ( $3 >= 500 ) print $1}' /etc/passwd | grep -v -e
> > smb -e
> > ^nfs )
> > for user in $users
> > do
> > #echo $user
> >
> >         processes=$(ps -ef | grep ^"$user " | grep -e Jan[0-9] -e Feb[0-9]
> > -e Mar[0-9] -e Apr[0-9] -e May[0-9] -e Jun[0-9] -e Jul[0-9] -e Aug[0-9] -e
> > Sep[0-9] -e Oct[0-9] -e Nov[0-9] -e Dec[0-9] |awk '{print $2}')
> >
> >         for process in $processes
> >         do
> >                 kill -9 $process
> >         done
> >
> > done
> >
> Julius,
> Neat little script, was just testing it out and
> noticed I had to add an extra -e [0-9] to catch users
> that have been logged in for less than 24 hours.
> Thanks for posting it.
Ken,
        this is not a bug, it is a feature ;-)  notice that the script is
supposed to kill *old* processes. i have "users" (generic logins) that can
stay up for 20 hours. julius



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to