Someone knows how do I kill a login user only with the login_name?
This moment I kill the user using the following command.
E4500:/mg98/samuel$ whodo samuel
Tue Sep 14 08:32:10 EST 2004
sun
When I do "whodo login", it return me only the process PID, and I can kill the process PID, ex: kill -9 24200 26724
This example, I have only six PID. Suppose that I have 50 PID.
There is any command that I can kill the user only using the login name, ex: kill samuel?
Thanx
Samuel
I suppose that I made some mistakes in English...
Kill all processes owned by the current user:
/usr/bin/kill -9 -1
A pid of -1 is special, it is a wildcard pid. Some shells have a kill built-in command that doesn't understand this. That's why you might need the real kill command.
However, you should not use kill -9 except as a last resort. A process cannot catch or ignore -9, that's why newbie admins love it. The process almost always dies with a -9. But most processes behave well with signals. Only a few processes are broken. And processes may have allocated resources that they will free upon their death. But that can't happen if they are killed with a -9.
So try a:
/usr/bin/kill -1 -1
first. And wait a few seconds. Anything left was probably nohup'ed. It may be important and you may want to contact the user before proceeding. Then do:
/usr/bin/kill -15 -1
which should kill a nohup'ed process.
If it survives a -15, you will need to try the -9. But that should happen only rarely.