Killing a stubborn process...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Killing a stubborn process...
# 1  
Old 01-25-2002
Question Killing a stubborn process...

I have a stubborn process on my OpenBSD box that just refuses to die. It is taking up about half a meg of memory and refuses to die. It appears to be an errant gzip process that was executed from the console on 06 Jan 2002.

Here is a snippet of my attempts to kill the gzip process

Code:
/home/joeuser $ ps -aux | grep "gzip"
root     13647  0.0  0.1   452   408 C0- DL     6Jan02    4:41.24 gzip -c
/home/joeuser $ kill 13647
/home/joeuser $ ps -aux | grep "gzip"
root     13647  0.0  0.1   452   408 C0- DL     6Jan02    4:41.24 gzip -c
/home/joeuser $ kill -HUP 13647
/home/joeuser $ ps -aux | grep "gzip"
root     13647  0.0  0.1   452   408 C0- DL     6Jan02    4:41.24 gzip -c
/home/joeuser $ kill -9 13647
/home/joeuser $ ps -aux | grep "gzip"
root     13647  0.0  0.1   452   408 C0- DL     6Jan02    4:41.24 gzip -c
/home/joeuser $ kill -9 13647
/home/joeuser $ kill -9 13647
/home/joeuser $ kill -9 13647
/home/joeuser $ ps -aux | grep "gzip"
root     13647  0.0  0.1   452   408 C0- DL     6Jan02    4:41.24 gzip -c

It just refuses to die. According the ps, it has core memory pages locked and some disk access. According to top, the it isn't doing too much and not taking up any CPU time:

Code:
13647 root      -5    0  452K  408K idle  physio   4:42  0.00% gzip

Any suggestions on killing this process other than reboot? I really want to keep the uptime high (yeah, cheap bragging rights... Smilie)

Code:
/home/joeuser $ uptime
 5:16PM  up 62 days, 23:17, 1 user, load averages: 1.13, 1.12, 1.09

# 2  
Old 01-28-2002
Are you logged in as root on your box when trying to kill the process?
If not,might want to try that...

Jason


Smilie
penguin-friend
# 3  
Old 01-28-2002
Data

You may like find the parent PID of the process, and try killing the parent PID.

Milind.
# 4  
Old 01-28-2002
Try this.

Do a ps -aef|grep (your PID#)

# ps -aef |grep 13647

# ps -aef |grep (parent PID#) To find the process that possibly spawned your process "gzip -c".

If it has a parent PID. a process that spawned this process, then you should try to kill that process.

Keep trying to find the parent in this manner until you find the true parent. Then you should be able to kill this PID as well.
# 5  
Old 01-28-2002
Bummer, dude.

Quote:
Originally posted by Kelam_Magnus
Try this.

Do a ps -aef|grep (your PID#)

# ps -aef |grep 13647

# ps -aef |grep (parent PID#) To find the process that possibly spawned your process "gzip -c".

If it has a parent PID. a process that spawned this process, then you should try to kill that process.

Keep trying to find the parent in this manner until you find the true parent. Then you should be able to kill this PID as well.
Using the -j option of ps under OpenBSD, I was able to identify the PPID.

The PPID? It is 1.

Yeah. I think I am gonna let the gzip -c sit for a while until I absolutely have to reboot the machine (probably sometime in March). It isn't using any more memory and isn't using any CPU so it is really not a problem.

Thanks for the responses!

I wonder what job spawned the gzip with the -c option. I took a look at my cronjob entries and they do not use the -c option. I use gzip --best for my scripts. I need to do some more investigating. There doesn't seem to be any problem with the system over-all.

Weird.
# 6  
Old 01-28-2002
root user?

Are you the "root" user when you are trying to Kill this process?

I see that your directory is /home/joeuser. Do an "id" to see if you are root.

If you aren't the Admin, get to root have your Unix Admin try to remove it.

Just a thought...

Smilie
# 7  
Old 01-28-2002
Re: root user?

Quote:
Originally posted by Kelam_Magnus
Are you the "root" user when you are trying to Kill this process?

I see that your directory is /home/joeuser. Do an "id" to see if you are root.

If you aren't the Admin, get to root have your Unix Admin try to remove it.

Just a thought...

Smilie
Yeah. I am root on the machine. It's my firewall/proxy/webserver/packet sniffer machine here at the house. I do some perl/c coding on it from time to time but that is about it.

It's strange that the `gzip -c` has hung the way it has. Sometime in March I am bringing up the 23 rack from the garage to my office and I will have to power down the machine at that point. I reckon it will not be a problem after that. Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Killing the process ID's

Hi , I have a list of application process id's. Is there a way to kill all the process listed below using the script, except the once which are starting with " Genesis " adm 1522 ABC_Process.tra adm 1939 Genesis_Process.tra adm 2729 Genesis_Archive.tra adm 3259 xyz_Process.tra (5 Replies)
Discussion started by: murali1687
5 Replies

2. UNIX for Dummies Questions & Answers

Killing the shell Process

I was just playing with the processes and suddenly a question striked my mind: What will happen if we kill directly the shell process?? :rolleyes: Do anyone know? Will the system shutdown? Or the system wont let it be killed? (5 Replies)
Discussion started by: paras.oriental
5 Replies

3. UNIX for Advanced & Expert Users

Killing A Stopped Process

UNIX Tutorial Five % kill %jobnumber Does that not work on a stopped process? I've tried to kill a stopped process and it is not working. Or do you need a certain type of shell for this to work? I don't see anything about this in my man pages. (3 Replies)
Discussion started by: cokedude
3 Replies

4. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

5. Shell Programming and Scripting

Killing process!!!!

Hi friends, i m in big trouble.... i have one script which connects two server ...like below.. script1.sh ------------------------------------- bash test.sh & eval x=$@ export x=`echo $x` #echo $x # ssh user@8.2.5.6 bash /mbbv/location/script.sh $x|sed '/Binary file/d'... (1 Reply)
Discussion started by: Shahul
1 Replies

6. Shell Programming and Scripting

Killing process and children

Hi all, I have been searching all day for a nice solution to this problem. I have three scripts. A start script, a child script and a stop script. Script A (scripta.sh) Its Child Script B (scriptb.sh) Script C (kill_process.sh $PID) Script A correctly traps the kill command sent from... (6 Replies)
Discussion started by: mark007
6 Replies

7. UNIX for Dummies Questions & Answers

killing the process

Hi, First, I am running a scipt.While the script is running I realize that I dont want the script to be run so I am killing the script externally.Before the process gets terminated or killed it should delete all the temporary files created by the script.How to do this?Can anyone help me? ... (3 Replies)
Discussion started by: arthi
3 Replies

8. Shell Programming and Scripting

Killing of a process and send a mail if the process doesnot come up within 2 minutes

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There is a... (1 Reply)
Discussion started by: Prince89
1 Replies

9. Solaris

Reg process of killing

Dear All, I have one doubt - when u use netstat -na | grep 8080 to know the status of 8080 ports.when it is listed someone is accessing the 8080 ports like this *.8080 *.* 0 0 64000 0 LISTEN 172.19.69.39.8080 172.19.50.20.1929 65535 ... (6 Replies)
Discussion started by: shanshine
6 Replies

10. UNIX for Dummies Questions & Answers

killing a process

I can kill running processes on my linux red hat system using ctrl-c but cannot do it from command line of another terminal using kill -2 pid. Although I can kill them from command line using kill -9 pid and other signals. I would like to do it using the kill -2 pid. Thanks for your suggestions (6 Replies)
Discussion started by: bbhayana
6 Replies
Login or Register to Ask a Question