chiark / gitweb /
service: don't report alien child as alive when it's not
authorRoss Lagerwall <rosslagerwall@gmail.com>
Sun, 9 Jun 2013 16:28:44 +0000 (17:28 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 9 Jun 2013 22:26:41 +0000 (18:26 -0400)
commit62220cf70e381f6e08390523e4696f7bc431f927
tree6decdf5f9e9ea2b813104f70f8176429a3876c8e
parent7085053a437456ab87d726f3697002dd811fdf7a
service: don't report alien child as alive when it's not

When a sigchld is received from an alien child, main_pid is set to
0 then service_enter_running calls main_pid_good to check if the
child is running.  This incorrectly returned true because
kill(main_pid, 0) would return >= 0.

This fixes an error where a service would die and the cgroup would
become empty but the service would still report as active (running).
src/core/service.c