help me to sort kill options...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help me to sort kill options...
# 1  
Old 12-03-2007
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 can group All processes in the current process group and then kill .

but it is not doing what it should do.

please find the pid of my java process
PHP Code:
abc    18984     1  1 10:51 pts/2    00:00:01 java -Dservice.name=FilterManager com.XXXX.abcbatch.common.FilterManager 
and my kill command
HTML Code:
kill -0 18984
o/p it's not killing 18984Smilie

i have an doubt , will kill -9 do the same type as -0 ?????
like it should kill all the sub process generated by java main....
# 2  
Old 12-03-2007
In a shell script kill-0 <pid> just signals the process pid. It returns true if the process is alive. And so, kill-0 can be used to ping if the process <pid> is still alive. It will not kill the process.

Instead you may want to try kill -9 <pid>.
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. 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

3. 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

4. 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

5. UNIX for Dummies Questions & Answers

find command sort options?

Hi - are there sort options with the find command? I don't see any in man. I have a script that is looping through a set a files to be processed and I need to process them in date timestamp order. tia for file in `find ${LANDING_FILE_DIR}${BTIME_FILENAME_PATTERN1}` do.... ... (6 Replies)
Discussion started by: mavsman
6 Replies

6. 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

7. 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

8. UNIX for Advanced & Expert Users

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... (6 Replies)
Discussion started by: simon2000
6 Replies
Login or Register to Ask a Question