[systemd-devel] Newbie question - Requires doesn't work properly

David Timothy Strauss david at davidstrauss.net
Wed Nov 20 19:32:45 PST 2013


The service configuration is strange. Normally, this is how they work
with dependencies:

 * Type=simple considers the service started immediately on exec()
with no respect for PIDFiles or sd_notify. This can cause dependent
services to come up too early.
 * Type=forking considers the service started when either the file
specified in PIDFile= appears or when the service completes a double
fork.
 * Type=notify is like Type=simple, except that it relies on sd_notify
to indicate final startup.
 * Type=bus is like Type=simple, except that it waits for the dbus
listener to indicate final startup.

You have PIDFile= specified, which is for Type=forking. I think
PIDFile= just gets ignored for Type=simple (the default). So, for one,
I'd pick a more coherent startup-detection configuration.

More interesting is how Myservice gets marked "failed" but isn't
forcibly stopped. That may be why systemd isn't bringing down
dependent services. Most services only get marked "failed" after
stopping (because of a non-zero exit code, for example).


More information about the systemd-devel mailing list