Issue with "kill -9" command


 
Thread Tools Search this Thread
Operating Systems Solaris Issue with "kill -9" command
# 1  
Old 01-30-2011
Issue with "kill -9" command

Hello All,
We have korn shell script running in production fine up untill now. The script will basically do grep "informatica" to check and see if any processes are running. If running get the process id's and kill them. we are using "kill -9" command to do this, it looks like today it could not able to kill the processes.

would it be possible there could be an issue with OS or shell?? or do i need to make my script wait for few minutes after issuing the "kill -9" command before checking if any processes are still running??

Appreciate your help.

Thank you.
# 2  
Old 01-30-2011
The "kill -9 <PID>" command is the absolute last resort.

Unless the process has no database connections and is not firmly stuck in I/O (which would probably need a reboot anyway) there is no reason to ever issue this command.

There is no way that I would ever issue this command to a client process which is still attached to a database. There absolutely no way that I would ever issue this command to a database engine process unless I was in a disaster situation and could not shut down the system prior to restoring the database from backup.

Please read the documentation for your database engine and consider appropriate ways to stop extraneous or stuck processes.

ImHo. Do not issue "kill -9" to a process connected to a database or to a database engine process.

Hope this is clear.
# 3  
Old 01-31-2011
Quote:
Originally Posted by methyl
The "kill -9 <PID>" command is the absolute last resort.

Unless the process has no database connections and is not firmly stuck in I/O (which would probably need a reboot anyway) there is no reason to ever issue this command.

There is no way that I would ever issue this command to a client process which is still attached to a database. There absolutely no way that I would ever issue this command to a database engine process unless I was in a disaster situation and could not shut down the system prior to restoring the database from backup.

Please read the documentation for your database engine and consider appropriate ways to stop extraneous or stuck processes.

ImHo. Do not issue "kill -9" to a process connected to a database or to a database engine process.

Hope this is clear.
The processes which my script is killing are no way related to the database, those are application scripts which were running at that time polling for a indicator file and sleeps for a while. Is there any draw back using "kill -9" command?? keeping drawbacks aside why is it not working? do i have to make the script sleep for a while after issuing the "kill -9" to give enough time to make it successfull.
# 4  
Old 01-31-2011
Quote:
Originally Posted by Ariean
Is there any draw back using "kill -9" command??
Yes, as already stated, "kill -9" is a last resort command. It shouldn't be used routinely. "kill -9" bypasses all measures that a program and the libraries it uses put in place for the process to die gracefully.
Quote:
keeping drawbacks aside why is it not working?
You do not provide clear evidence "kill -9" did not work. How did you conclude that ? Can you post "ps" output ?
Quote:
do i have to make the script sleep for a while after issuing the "kill -9" to give enough time to make it successfull.
Don't use "kill -9" and explain why you are killing these processes in the first place.
# 5  
Old 02-01-2011
Why not just do a

Code:
pkill informatica


Do you have a snippet of your code?
# 6  
Old 02-02-2011
Please post:

Sample "ps -ef" type output showing lines containing the word "informatica" or just the relevant processes if they don't contain the word "informatica" all the time. If you can, please post the process tree containing the bad process and also show how the process was started.

The complete "kill" script.

The script you are trying to kill. Scripts with a sleep loop can be difficult to kill. It is often easier to build a stop flag process into the script. I also use Shell "trap" to cause a script to exit cleanly after "ctrl/C" or "kill -15".

Are you running a unix virus scanner (e.g. Sophos)?

If you are running an Informatica database process can you be sure that the word "informatica" will never appear in a "ps" display from a real Informatica process?

Just out of interest I have seen processes take hours to disappear after "kill -9" or not disappear at all. Beware that killing part of a process tree can leave orphan processes owned by init (pid 1) which are hard to distinguish from genuine background processes.
Also I have seen "ps" miss processes on numerous occasions. If the kernel is busy it may not reply.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

What is the use of "finger" command & how to use it to kill the online processes ?

Hi there, I am eager to know what exactly is the use of "finger" command & how to use it to kill the online processes ? :b: (1 Reply)
Discussion started by: abhijitpaul0212
1 Replies

4. Shell Programming and Scripting

Need help - "sed" command issue

we have two parameters as below in our script and passing values while executing. row_count=356 col_count=239 I have below sed command in my script MAILMSG=`grep -v "##" mail_body.txt | sed 's/$Row_Count/'${row_count}'/g;s/$Colu_Count/'${col_count}'/g;s/$Accepted/'5%/g` It is... (3 Replies)
Discussion started by: JSKOBS
3 Replies

5. Shell Programming and Scripting

""Help Me!""Beginner awk learning issue

Hi All, I have just now started learning awk from the source - Awk - A Tutorial and Introduction - by Bruce Barnett and the bad part is that I am stuck on the very first example for running the awk script. The script is as - #!/bin/sh # Linux users have to change $8 to $9 awk ' BEGIN ... (6 Replies)
Discussion started by: csrohit
6 Replies

6. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

9. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

10. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies
Login or Register to Ask a Question