[systemd-devel] [PATCH] core: fix detection of dead process v2.

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri Feb 14 17:52:16 PST 2014


On Sat, Feb 15, 2014 at 02:38:50AM +0800, Yuxuan Shui wrote:
> Commit 5ba6985b moves the UNIT_VTABLE(u)->sigchld_event before systemd
> actually reap the zombie. Which leads to service_load_pid_file accept
> zombie as a valid pid.
> 
> v2: I sent the wrong patch.
Applied, with some tweaks:
- a message is logged if the pid was read from pidfile in surrounding code
- changed the return type to int. The problem is that char has limited
  range, and a negative error might conceivably wrap to a positive char.
  It's clearer to simply use int.

And indeed, this fixes timeouts during shutdown that I was seeing.

Zbyszek


More information about the systemd-devel mailing list