[systemd-devel] Assertion failed in systemd v16
Lennart Poettering
lennart at poettering.net
Tue Jan 18 14:31:04 PST 2011
On Tue, 18.01.11 17:30, Alexander E. Patrakov (patrakov at gmail.com) wrote:
> >>ExecStart=/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
> >>ExecStop=/bin/kill -INT $MAINPID
> >This is asynchronous. The stop operation is supposed to be synchronous
> >however, should not return before it finished.
>
> This was modeled after the existing apache2 service file in gentoo
> systemd overlay, which uses graceful asynchronous stop. If you
> delete the ExecStop line, systemd will use SIGTERM (non-graceful
> stop) and wait. That's probably what you want the stop operation to
> be. OTOH, like it or not, too many existing services don't have any
> mechanism for synchronous reload and use SIGHUP.
Note that you can change the kill signal via "KillSignal=SIGHUP" or
something similar.
> Well, there are cases (live update of nginx, see http://wiki.nginx.org/NginxCommandLine#Upgrading_To_a_New_Binary_On_The_Fly)
> where the main PID would change without the explicit "systemctl
> reload" command. In the case of nginx, one can follow up the live
> update with a dummy "systemctl reload", so I am not sure if it
> matters.
>
> OTOH, maybe it would be better to evaluate the main PID lazily when
> it is needed, instead of trying to enumerate all places where it can
> change and reloading it there. But this way we will also hide all
> races caused by bad PID file handling logic, so I am not sure.
Hmpf, we actually send out bus notifications when service properties
such as the PID change. I figure in weirdo cases like this it would be
the nicest solution if the service would just invoke the following when
they change PID:
sd_notifyf(0, "MAINPID=%lu", (unsigned long) getpid());
sd_notify() is defined in sd-daemon.[ch], and may be used to inform the
init system about service status changes, include change of the main PID
with a command like the above. See sd_notify(3) for details.
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list