Re: killing a process when a user logout on FC3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-12-27 at 14:08 +0530, Ankush Grover wrote:
> hey friends,
> 
> I wanted to kill a process when the user logout.When the user logs in
> one can get the process id through this 
> 
> ps -ef | grep  process > /etc/spli.txt
> 
> But how do I kill the process when the user logout(.bash_logout) well
> there are  8 fields in /etc/spli.txt and the 2nd field is the pid
> which is needed by the kill command to end the process.
> 
> How do I extract the 2nd field from the file(/etc/spli.txt), I know
> awk or with sed one can do it but I don't know these scripting tools.
> 
> Can anyone help me in solving this issue ?
> 
> I am using FC3.
> 
> Thanks & Regards
> 
> Ankush Grover 

Ankush,

You could use cut -b 10-15 to get the pid from the output of ps -ef.
Alternately, you could use pidof.  Ala pidof pidof to get the pid of
pidof.

Bob...


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux