[systemd-devel] Option substitution in unit configuration files?

Malte Forkel malte.forkel at berlin.de
Sun Aug 16 08:36:08 PDT 2015


Thanks to both of you!

>                                                   I'd always encourage
> you to fix the daemon in question to make something like the above
> unnecessary.

True. Since I'm only packaging the daemon, I can just guess its written
as it is to make sure the daemon can remove the PID file independent of
the platform its running on and how it was invoked.

> But for unprivileged access to pidfiles the usual approach is to create
> a dedicated subdirectory under /runĀ¹, either using RuntimeDirectory=
> or a full tmpfiles.d config, and tell the service to use
> "/run/myservice/myservice.pid". It might be simpler than touch+chown,
> and a bit cleaner.

You're right. Since I have to solve the same problem for both SysV and
systemd, its the better solution.

Malte


More information about the systemd-devel mailing list