简体   繁体   中英

Kill process '[avconv] <defunct>'

I have more than 30 process '[avconv] ' (i have a bug in script), With this command i find these process :

Ps aux | grep '\[avconv\] <defunct>' 

but i don't know how to kill these process, anyone have an idea to kill these process ?

Thanks

A <defunct> process is a process that has already terminated, and hence cannot be killed, but for which the parent has not yet invoked one of the wait system calls ( wait , wait3 , wait4 , waitpid , etc...) to read its exit status. As a result, the process information is retained by the system in case the parent eventually does try to obtain its status. Such processes disappear when the parent reads their exit status.

These <defunct> processes also disappear when the parent is killed, as the init process will take ownership of the process and obtain (and discard) its status.

You can avoid <defunct> processes by ensuring you issue as many wait system calls as you issue fork calls.

Alternatively, as JF Sebastian points out, you can also avoid <defunct> processes by either setting the SIGCHLD signal disposition to SIG_IGN (ignore the signal) or by using the SA_NOCLDWAIT flag when registering a SIGCHLD signal handler (or when resetting the default disposition with SIG_DFL) using sigaction . In this case, however, the child's exit status will not be made available to the parent - it is simply discarded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM