[systemd-devel] How to run forking daemon with systemd in correct way, without errors?

Gena Makhomed gmm at csdoc.com
Thu Nov 23 12:38:24 UTC 2017


On 23.11.2017 12:53, Michael Chapman wrote:

> Many other deficiencies with the BSD daemon() function are documented in 
> systemd's daemon(7) manpage.

Michael, thank you for reference to daemon(7) manpage,
this is exactly that I am looking for.

I will try to ask nginx developers for implementing
changes required by systemd from SysV Daemons.

> I would suggest ignoring some other commenters suggestions that PID 
> files are unnecessary with systemd. Indeed, there's even a TODO item for 
> a Type=pid-file service that would, presumably, allow even non-forking 
> services to signal readiness by writing a PID file. I would find 
> something like that very useful.

 From TODO file "ExecRestartPre=" feature will be very useful
for protecting users which edit nginx or httpd configuration files
and restarts nginx or httpd to apply changes. If someone make error
in configuration file and restart service - nginx or httpd
will not start after stop and service will be not working.

"ExecRestartPre=" feature will help to protect from such situations:

https://lists.freedesktop.org/archives/systemd-devel/2014-July/021642.html

Record in TODO file exists, even issue on github exists:

https://github.com/systemd/systemd/issues/2175

with comment from nginx.org packages maintainer Konstantin Pavlov:

https://github.com/systemd/systemd/issues/2175#issuecomment-343481962

But as I understand, feature "ExecRestartPre=" will not be included
in the upcoming CentOS 8 / RHEL 8 system, because nobody
of systemd developers have time to implement this feature.

Or anybody of systemd developers has time to implement this feature?

-- 
Best regards,
  Gena


More information about the systemd-devel mailing list