LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   cannot kill a program (https://www.linuxquestions.org/questions/linux-general-1/cannot-kill-a-program-23297/)

Chooco 06-13-2002 12:50 AM

cannot kill a program
 
dns2go client messed up somehow so i had to quit it then restart it. i push ctrl+z to stop it then i push up to start the process again "waiting for process 1492 to end" and it said the process was paused so i assumed that i never killed the program. look in my trusty manual to see what the kill command is, here are the commands i tried:
kill -signal 1492 //says that it does not understand the signal command even though my book says the command exists
killall -g dns2go //closes 1 process but not the other 7
exit //cannot log out, 8 processes are stopped
quit //does nothing

i tried kill -l and killall -l but NEITHER listed the dns2go process so how the hell am i supposed to log out!?!?!? if i can't kill the process then wtf do i do?

trickykid 06-13-2002 02:11 AM

kill -9 pid will kill the program with no questions asked.

for more.. man kill

Chooco 06-13-2002 02:20 AM

i typed man kill though and it dosen't have that command anywhere in there. my Linux In A Nutshell book doesn't have that either.

Mik 06-13-2002 03:17 AM

Run 'man 7 signal' to find out what all the signals are. 9 is equivalent to a SIGKILL. If you don't like remembering numbers you can also use the signal name.

kill -KILL 1492

linuxcool 06-13-2002 05:35 AM

The kill command is one of the bash builtins. Do a man bash and look for kill there. I guess mandrake decided to cut costs and not include a separate man page for kill.

browny_amiga 07-21-2003 10:01 AM

here is the HARD case
 
I actually got 3 zombies that don't want to go to h****, even at my sweetest invitations.

a kill -s 9 PID
does nothing, the just keep hanging around.

I so far got everything killed with sigkill, but now I am baffled. What can I do? Do I have to restart the system, like a stupid Windows OS? (Would not like that, I got linux)
Don't want to follow the stupid advice of some moron Windows Admin "A reboot is always good".

Pres 07-21-2003 10:25 AM

Quote:

Originally posted by linuxcool
The kill command is one of the bash builtins. Do a man bash and look for kill there. I guess mandrake decided to cut costs and not include a separate man page for kill.
Also sometimes a separate binary, your slack will have it, /bin/kill. Perhaps being specific /bin/kill -9 PID will work ?

ranger12002 07-21-2003 04:35 PM

kill -9 pid is a forced kill(kills it whether it likes it or not)so it should work

shellcode 07-21-2003 04:58 PM

Re: here is the HARD case
 
Quote:

Originally posted by browny_amiga

Don't want to follow the stupid advice of some moron Windows Admin "A reboot is always good".


you gotta hate that windows memory management huh...


a program is not allowed to create a default disposition for a SIGKILL signal (as opposed to a SIGTERM signal)...thus it cannot handle the SIGKILL itself and it will die.

man 2 signal should teach you more about the way the signal works (if you are a C programmer)

have fun.

itsjustme 07-21-2003 05:03 PM

Re: here is the HARD case
 
Quote:

Originally posted by browny_amiga
a kill -s 9 PID does nothing,
Uh.. you aren't typing in 'PID' are you. Substitute the process ID number.

ex.: kill -9 1234

DrOzz 07-21-2003 05:06 PM

i noticed kill doesn't do all that much for me most of the times, but i just dont use it anymore..
i just issue the command:
killall -15
or if that don't work, we'll make it work :D
killall -9

browny_amiga 07-22-2003 03:02 AM

No, I am NOT, of course I am not using PID as PID number. I use the task number, the actual one. I got three tasks hanging around (state defunct), listed as zombies and all the bullets and sacred water does not do a damn.
I tried to kill them about 10 times already, and they won't leave. This is kind of getting tricky. I could do a reboot, but I am kind of curious how to solve this sucker.
Could I make them crash? Is there a way to do a segmentation fault on these programms? That they are removed by the system?

itsjustme 07-22-2003 10:50 AM

here's an interesting thought that I found here.

"A zombie process sticks around until either its parent dies without it being assigned a new parent or until its parent checks its exit status (the 'performing an autopsy' the previous poster mentioned).

The metaphor extends a bit more, because you can't kill a zombie process the way you can kill normal processes - because you can't kill something that's already dead =)"

That link seems to be mostly a discussion of metaphors, but I think the idea of the parent process keeping the affected process in existence may be apropos here.


Also,
Quote:

No, I am NOT, of course I am not using PID as PID number.
OK, I thought so, but was just making sure.

Regards...

browny_amiga 07-22-2003 11:07 AM

How to get rid of these #$#*&!!! Zombies?
 
Yes, zombies cannot be killed because they are undead (you can't overkill something, if it is dead and you shoot it again, it doesn't change)

The thing is just that I don't like this thing at all. I remember having killed zombie processes before, but this time it just won't work. I always (so far) thought and hoped that linux is consistent, meaning that with - SIGKILL you can get rid of everything. I heard from somebody that sometimes you can't and did not believe/like it, because it scratches my vision of linux as an OS with non of these windows anomalies.
so I have found it then.
Anybody reading this knows how I sent these zombies to hell? Anything will do, overwrite their memory space, make them misbehave more that the OS will kick them out? Can I make them crash, remove them artificially from the process list, write some nasty stuff into /proc that will make the OS vomit them out?

I know I can reboot, but this is a challenge to me. There MUST BE A SOLUTION. In linux, there is always one. It is OPEN source, you can see inside, that's the thing.

Another thought: so, if I restart the system, it should hang with these processes, and not terminate, right? Since it cannot kill them with sigterm and sigkill, what else is there?

JZL240I-U 07-23-2003 04:15 AM

Quote:

Originally posted by itsjustme
... I think the idea of the parent process keeping the affected process in existence may be apropos here.

Not that I would know how to do it, but can't you affect the parent process in a way to make it terminate the undead (e.g. trying to reanimate them and failing...)? Good hunting :D .


All times are GMT -5. The time now is 10:45 PM.