LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-17-2004, 03:55 PM   #1
diogo_cc
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
How to kill a process that had frozen and became immortal???


Hi,

I have configured a Mandrake Linux 10 as a RAS Server. Kernel 2.6.3, mgetty 1.1.30 and ppp 2.4.1 are used. The Server is working good. However, sometimes the mgetty or pppd process freezes and I am not able to kill it. I send it SIGKILL (kill -9 pid) and it doesn't die. How could this be possible??

I am using 3 external serial modem's connected by a Serial-USB Converter to 3 USB ports of the server. At the beginning I thought the USB module was freezing the mgetty process, but when a mgetty freezes the others mgetty have not frozen. That is why I don't think its the usb module faults. But it is a possibility.

I have heard about zombie processes. Maybe the mgetty process became a zombie. But if that is true, how could it be still locking the USB Port if it is already dead?? If that is the case, how to kill it?

Thank you for any help in advance,

Diogo.
 
Old 08-18-2004, 12:52 AM   #2
cppkid
Member
 
Registered: Jul 2004
Location: Pakistan
Distribution: Ubuntu
Posts: 185

Rep: Reputation: 30
Look a zombie process is not dead, i thin it does execute in the same manner and keep on doing its function, only the difference is that you lost the control over it, or you can say you lose the handle to that process, but the process is simply working.
Anyway if a few times i have same problems with some processes and i use.

kill -n 9 pid

I don't know why but if i write it once it says nothing but if i send this twice then the process terminates. Anyway try it twice may be that can help you.
 
Old 08-18-2004, 01:53 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Look a zombie process is not dead, i thin it does execute in the same manner and keep on doing its function
This is not accurate, a zombie process is usually really dead, so it doesn't execute any instructions at all. The only resource kept is its process table entry (a pid, status information) and the reason why it stays there is that the parent process hasn't ackowledge the death signal of its son with a wait() call.
One way of fixing that is to kill the father too, as when the zombie became a son of the init (pid 1) process, its death will be acknowledged for sure.

One exception is when a process hanged in a system call, usually because of a buggy device driver code, is receiving a "kill -9" signal.
Here again, the process isn't executing user code, but may use CPU if the buggy code is looping.
Here, the only way to have the process disappear from the process table is to reboot, which I admit is pretty extreme ...
 
Old 08-18-2004, 08:54 AM   #4
Kumar
Member
 
Registered: Sep 2003
Location: Pune, India
Distribution: Red Hat
Posts: 106

Rep: Reputation: 15
Check the process state using ps ax command. Check the third field. My guess is that is should be D for the corresponding process. If it is, then this indicates that the process is in TASK_UNINTERRUPTABLE state and won't respond to any signal. Such process can't be killed and are most probably waiting for an IO event.
 
Old 08-18-2004, 10:40 AM   #5
blueturtle
LQ Newbie
 
Registered: Aug 2004
Posts: 9

Rep: Reputation: 0
Cut off it's head.

There can be only one.
 
Old 08-18-2004, 12:31 PM   #6
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
HI

if u r using /proc filesystem
maybe u should go to the /proc dircetory and delete the folder of the name of the pid u want to kill if it is not going by
#KILL -9 PID

regards
gaurav
 
Old 08-25-2004, 01:56 PM   #7
diogo_cc
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you guys for your help,

I am waiting the problem I told you to occurs again, so I can test your suggestions. It has not occurred yet.
Once it occurs I tell you the results.

But I got curious about what Kumar said. Suppose the process is in D state, and suppose it is looping forever? Isn't there a command that would kill it?


Thanks,

Diogo.
 
Old 08-26-2004, 01:37 AM   #8
Kumar
Member
 
Registered: Sep 2003
Location: Pune, India
Distribution: Red Hat
Posts: 106

Rep: Reputation: 15
It is not advisable to kill the process which is in TASK_UNINTERRUPTABLE state forcefully. The reason is, the process might be holding kernel semaphore or other kernel resources. Killing that process might result in those resources being lost and things like deadlock etc and further complications. Process are usually killed by sending them signals. When a task is in TASK_UNINTERRUPTABLE state, it won't respond to any signal. Hence it is called TASK_UNINTERRUPTABLE . And I don't know any such command which can kill such processes. Maybe someone else can tell something about that.
 
Old 08-26-2004, 03:46 PM   #9
diogo_cc
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Hi,

The problem I told you about the immortal process has just occurred. The pppd has frozen locking the ttyUSB0 port. I am unnable to kill it wiht SIGKILL.

I tried all the suggestions posted in this thread and nothing worked to kill the pppd.

Kumar was right! The pppd process is in DW stat.
The ps ax command displays:

24087 ttyUSB0 DW 0:00 [pppd]

the ps -ef command displays:

root 24087 1 0 16:20 ttyUSB0 00:00:00 [pppd]

My concern here is to unlock the ttyUSB0 port. How could I kill the pppd? I hope killing it I can unlock the ttyUSB0 port. Is there another way to unlock a device that is locked by a process in DW stat?

Thanks,

Diogo.
 
Old 08-26-2004, 05:50 PM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
I tried all the suggestions posted in this thread and nothing worked to kill the pppd.
wrong ! I suggested you to reboot, and I'm sure it would have killed pppd
 
Old 08-26-2004, 08:36 PM   #11
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076

Rep: Reputation: 205Reputation: 205Reputation: 205
start top get the file name of the program you want to stop like netscape is started with a script named netscape and it starts netscape.bin
then quit top and type " killall netscape.bin " or what ever the file name realy is
it would be best if you were root when you did this this is most likly what the problem is you are trying to kill something you don't have permission to kill if it was started by the start up scripts it belongs to root and a user can't kill it
 
Old 09-10-2004, 02:15 PM   #12
phaserx
LQ Newbie
 
Registered: Jun 2004
Location: The city of Lost Angels
Distribution: RedHat and Gentoo
Posts: 21

Rep: Reputation: 15
Listen to kumar... you can't kill it, and if you COULD kill it, it's NOT recommended because it could just FUBAR things even more.. Only thing you can do to ensure it's being killed and not keeping resources locked is to reboot. It will respond to NO signal, no kill, no killall, no anything.. reboot.
 
Old 09-10-2004, 07:18 PM   #13
zWaR
Member
 
Registered: Dec 2003
Distribution: Slackware, Alpine Linux, Ubuntu, Debian
Posts: 219

Rep: Reputation: 35
Use kpm (type kpm in bash shell) - works only in X.
 
Old 09-10-2004, 07:57 PM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Well, kpm has no special features that would allow it to overcome diogo_cc problem (deficient kill -9).
The only right answer is one of:
- fix the driver
- fix the kernel
- reboot
 
Old 09-11-2004, 02:00 AM   #15
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Did you try :
/usr/sbin/ppp-off

Unless this command is slackware (my distro) specific ?

And :
kill -s SIGLOST ttyUSB0

man 7 signal, to see all available signals

Last edited by Cedrik; 09-11-2004 at 02:08 AM.
 
  


Reply



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
I want to kill process Jeon, Chang-Min Linux - General 6 08-09-2005 12:14 AM
kill D process xrado Linux - General 4 07-04-2005 12:38 PM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM
how to kill a process in C++? mimithebrain Programming 9 06-17-2004 05:20 PM
How to kill a certain process? AMDPwred Linux - General 3 10-01-2002 01:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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