kill -9 options ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users kill -9 options ?
# 1  
Old 11-24-2003
kill -9 options ?

Hi all,

I have some boxes using solaris 8 and have s/w running on top. At times these boxes get frozen with no mouse nor keyboard input functioning.

I normally would go and use the kill -9 option for the PID. Is there a way to kill or cancel by username instead ?

we use a script that does it for the HP UX side of things, but have not come up with a solution for kill all processes for users on the Solaris side.

thx
simon
# 2  
Old 11-24-2003
hi
I could not clearly understand your question. You mean "I want to kill processes for username"
If so
I use "ps -u username | grep process_name" and get the PID of the program. Them "kill -9 PID_of_the_program"

hope helps...
# 3  
Old 11-24-2003
sorry.. it's not just one PID to kill. The program has multiple processes see below.

I want to kill everything p3rtp is doing.

p3rtp 12796 12774 0 14:42:27 pts/3 0:00 /usr/dt/bin 0
p3rtp 12819 12805 0 14:42:38 ? p3rtp 12820 12802 0 p3rtp 12709 289 0 14:41:55 ?
p3rtp 12795 1 0 14:42:27 pts/3 0:00 /usr/dt/bin/ttsession
p3rtp 12803 12796 0 14:42:28 ? 0:00 sdtperfmeter -f -H -t p3rtp 12802 12796 0 14:42:27 ? 0:00 dtwm
p3rtp 12805 1 0 14:42:28 ? 0:00 /bin/ksh /usr/dt/bin/sdtvolcheck -d -z 5 cdrom,zip,jaz,dvdrom,rmdisk
p3rtp 12821 12820 0 14:42:39 ? 0:03 /usr/local/adacnew/bin/Launchpad -fg black -bg grey -xrm *fontList: -linotype-p
p3rtp 12738 12728 0 14:42:26 ? 0:00 /usr/openwin/bin/fbconsole
p3rtp 12771 1 0 14:42:26 ? 0:00 /usr/dt/bin/dsdm
p3rtp 12728 12710 0 14:42:26 ? 0:00 /bin/ksh /usr/dt/bin/Xsession
p3rtp 12774 12772 0 14:42:26 pts/3 0:00 -csh -c unsetenv _ PWD; unsetenv DT; setenv DISPLAY :0;
root 13782 13340 0 14:54:30 pts/4 0:00 grep p3rtp
# 4  
Old 11-24-2003
Hi,

Go fetch this script, it will be useful for you... will do that and a lot more.

ftp://ftp.armory.com/pub/scripts/maim
# 5  
Old 11-24-2003
Solaris 8 also has the pkill command. You should be able to do

pkill -u p3rtp

and the pkill command will find the process ids for the processes with effective uid p3rtp and kill them all. Do a man pkill on your solaris 8 box to see the other options for pkill if you need them.

I'd try it in a safe way (on a test box, or when no users are on the system, or whatever is appropriate for your situation) to make sure it works as expected, but I think that will be the easiest way to accomplish your goal.
# 6  
Old 11-24-2003
`ps -fu username|awk '{if ($1 == "username") print "kill -9 " $2}'`

just try this out
# 7  
Old 11-24-2003
however, i myself do not recommend the command below Smilie. actually the below will kill all the process of a particular user, without caring for the other dependancies, if that is fine with you then sure you can go ahead with the command below.
thanks

sorry jsilva, I havent yet seen the link you posted. probably it has scripts which might take care of those dependancies as well.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Kill an specific process ID using the KILL and GREP commands

Good afternoon I need to KILL a process in a single command sentence, for example: kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'` That sentence Kills the process ID corresponding to the program CAL255.4ge. However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies

2. Solaris

Cannot kill a process with kill -9

Hello everyone, I have a process that I want to kill. I have tried kill-9 PID but it doesn't work. I have tried preap PID but it doesn't work too. The parent of my process is the process whose PID is 1, so I can't kill it. My OS is a Solaris 9. Can anyone help me understand what's going... (3 Replies)
Discussion started by: adilyos
3 Replies

3. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

4. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

5. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

6. Shell Programming and Scripting

help me to sort kill options...

Hi All, I knew you all will scold me after reading this thread, but i got stuck in the definition and usage of kill, so begging all your pardon. I have a java process, which used to create small threads/sub process....so i want to kill that main java by kill -0 <pid>...... so that 1st it... (1 Reply)
Discussion started by: manas_ranjan
1 Replies

7. Programming

kill(0,-9) don't kill the process

Hi all i have simple c program , when i wish to kill the app im using kill(0,-9) , but it seams this command don't do any thing and the program. just ignore it . what im doing wrong here ? im using HP-UX ia64 Thanks (9 Replies)
Discussion started by: umen
9 Replies

8. UNIX for Advanced & Expert Users

When kill doesnt work, how to kill a process ?

Hi All, I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages. How can i terminate this daemon ? ? ? Regards, Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
Login or Register to Ask a Question