tellytv / telly

An IPTV proxy
MIT License
774 stars 107 forks source link

Fix zombie ffmpeg processes #262

Closed tmm1 closed 5 years ago

tmm1 commented 5 years ago

After (*exec.Cmd).Start() it is required to call (*exec.Cmd).Wait() to reap the process and prevent it from sticking around in the zombie state.

Without this fix, Telly running in Docker without an init process (which generally reaps zombies when child procs forget to) would pile up zombies indefinitely.

root     17910  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17911  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17912  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17913  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17914  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17915  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17916  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17917  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17918  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>
root     17919  0.0  0.0      0     0 ?        Z    06:59   0:00 [ffmpeg] <defunct>