How to kill a process that had frozen and became immortal???
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
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 ...
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.
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
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?
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.
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?
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
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.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.