Page 1 of 1

[DONE]Killing zombie process

PostPosted: Jul 1st, '16, 10:38
by mackowiakp
I use thirty party application on M5 working 24/7/365. The problem is that this app once per 2-3 months disappear but leave zombie process. I can not kill such process and it is impossible to restart app because it says that app is already running. I have no access to code of this app.
As far as I know, the only way to kill zombie process is killing parent process. But the parent process is init. It is not necessary to run app from init. I can start it from cron using entry:

Code: Select all
@reboot sleep 120;may_app&


I can not test it on-line (because it occurs once per 2-3 months) so my question is:
If I will use the upper syntax (with "&" at the end), the parent process will be cron? If so I can turn off crond service for a moment, kill zombie and start crond again. Will it work properly? Any other proposal?

Re: Killing zombie process

PostPosted: Jul 1st, '16, 17:07
by doktor5000
mackowiakp wrote:As far as I know, the only way to kill zombie process is killing parent process.

No, you cannot kill a zombie. Only way to achieve something similar is to send SIGCHLD to the parent so it reaps its child processes, at least if a handler for that is implemented ...

Re: Killing zombie process

PostPosted: Jul 1st, '16, 19:48
by mackowiakp
So, the only solution is computer reboot?

Re: Killing zombie process

PostPosted: Jul 2nd, '16, 17:49
by doktor5000
No, why do you assume that?

Did you try to send SIGCHLD to the parents PID? Could you provide some actual output like
proctree -pas PID (against the app's PID) or some ps aux output of the app and the parent process ?

Or some more details about the app, if it uses any kernel module, or sockets or whatever.
As when it would be a child of the init process (systemd) then it would be periodically reaped, and it it doesn't get reaped then there might probably be a kernel bug involved.

Re: Killing zombie process

PostPosted: Jul 2nd, '16, 19:40
by mackowiakp
I will ask producer of the app about some details. But it is app dedicated for service of measurement module, connected to server over USB with RS232 emulation. So - as far as I know - the only libusb is used. It works via /dev/ttyUSB0 simply.
Never the less, I will ask Agilent (branch of HP), issuer of hardware and software. Then I will be back.

Re: Killing zombie process

PostPosted: Jul 3rd, '16, 18:22
by doktor5000
You can also check with lsof or for that PID under /proc/PID/... what sockets it uses or any filehandles it has open, and also if it uses some kind of lock or pid file somewhere under /var or /run which you may need to remove if it gets a zombie if it cannot be prevented. There's no need to kill the zombie process for that (as it's already dead).

Re: Killing zombie process

PostPosted: Jul 3rd, '16, 19:11
by mackowiakp
THX for advice. As I wrote, it occurs very rare. So we have to wait for such situation and than will check the system as You advice.

Re: Killing zombie process

PostPosted: Aug 1st, '16, 09:06
by mackowiakp
I got new version of software from Agilent. As release notes stands, zombie process problem is resolved. Nether the less, it is not M5 related problem. So topic closed.