[systemd-devel] Zombie process still exists after stopping gdm.service

Lennart Poettering lennart at poettering.net
Mon Apr 20 17:29:39 PDT 2015


On Mon, 20.04.15 18:13, Daniel Drake (drake at endlessm.com) wrote:

> >> 3. gdm simple-slave's signal handler triggers, which causes the
> >> mainloop to exit, and it starts to kill and wait for the X server
> >> death. I'm not exactly sure why, but quitting the glib mainloop also
> >> causes the signal handler to be destroyed, so sigaction() is called
> >> here to return SIGTERM to its default behaviour.
> >>
> >> 4. Moments later we arrive in systemd's service_sigchld_event(),
> >> presumably because the main gdm process exited due to SIGTERM.
> >> s->main_pid == pid.
> >
> > If PID 1 gets the SIGCHLD for the main process then it assumes the
> > service has finished correctly, and will kill the rest that might remain.
> 
> Even if we already killed the rest just a few milliseconds ago (in
> #2)?

Sure, we don't want to keep track of which processes we already
killed, to distuingish them from the processes newly created in the
time between our sending of SIGTERM and receiving SIGCHLD for the main
process.

We assume that if we get SIGCHLD for the main process that the daemon
is down, and everything that is left over then is auxiliary stuff we
can kill. 

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list