On Mon, 18 Dec 2000, Pinku Hussain wrote:
> I have a linux server with no. of users connected to
> it through Xmanager. Sometimes I notice some processes
> of some user running even though the user has logged
> out of the network completely.
>
> I want to know if there is any command by which I can
> know the unwanted processes so that I can kill it.
>
> 'ps -ef' give me all the processes.
ummm this is a bit tricky, for the user may be running a valid job in
batch or through nohup. You wouldnt want to kill that. But it often
happened in our cc lab that users wouldnt log out properly simply hit
<CTRL><ALT><BKSPC> and leave the terminal, leaving their window managers
hogging a substantial amount of resources.
One could run a process in the background which does a "ps aux" and for
each unique user ( have to take care of root and other daemon owners, uid
value should be a better test) find whether he/she is logged in (grep who).
Once we detect a process owned by an user not currently logged in, check
the "nice" value ( I guess nohup changes this ), if thats a legal
background priority keep it otherwise kill it.
Bash script with a bit of awk should do it. As for myself ( still to
know awk) i will have to use c
sreangsu
----------------------------------------------
The mailing list archives are available at
http://lists.linux-india.org/cgi-bin/wilma/LIH