Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-17-2007, 06:23 AM   #1
Registered: Jun 2001
Posts: 301

Rep: Reputation: 30
kill -9 and respawns as new pid

I have a process here that I can't get rid of.

As soon as I kill the process it respawns with a new pid. Same with `kill -9` and `kill -15`.

Looking through the process list shows no clues as to any parent process, but from memory I believe the original command was `while :; do <command> ;done`
Old 06-17-2007, 12:46 PM   #2
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

Rep: Reputation: 15
So that's

while true; do run_this_command; done

so obviously it's going to keep respawning. Kill the shell running the while loop.

The parent process (i.e. the shell) should be shown in the ps output, e.g. with ps -ef, it's column 3.
Old 06-18-2007, 05:54 AM   #3
Registered: Jun 2001
Posts: 301

Original Poster
Rep: Reputation: 30
There are no clues in the other processes listed with ps -auxefas to which is spawning the command. I'm looking at that 3rd column trying to figure out the link.

There are 5 bash shell processes but I don't know which is the one running the offending command. I can't just kill them all because one of them is running an important command.
Old 06-18-2007, 03:05 PM   #4
LQ Newbie
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
I tried:

In one shell, "while true; do sleep 100000; done"

in another, "ps -ef":

kws 24642 24637 0 10:38 pts/3 00:00:00 -bash
root 25654 16727 0 11:57 ? 00:00:00 sshd: kws [priv]
kws 25658 25654 0 11:57 ? 00:00:00 sshd: kws@pts/4
kws 25665 25658 0 11:57 pts/4 00:00:00 -bash
kws 25711 24642 0 11:58 pts/3 00:00:00 sleep 100000
kws 25712 25665 0 11:58 pts/4 00:00:00 ps -ef

Killed 24642, the shell died and the sleep went away. If it still doesn't work for you try posting your "ps -ef".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
kill <pid> does not do anything moskito01 Linux - General 9 08-25-2009 01:20 PM
kill pid ekdya Debian 3 04-18-2006 06:04 PM
kill pid.... won't work with 'pid' variable given.. sachitha Programming 6 03-06-2006 08:48 PM
when kill -9 PID wont work bleunuit Linux - Software 2 08-06-2004 12:46 PM
question about kill(pid, sig) THETEZ Programming 3 04-18-2004 06:37 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration