On Sun, Aug 16, 2015 at 5:36 PM, Malte Forkel <malte.for...@berlin.de>
wrote:

> Hi,
>
> Is there some kind of option substitution in unit configuration files?
>
> In a service configuration file, I specify the PID file and would like
> to re-use its name, e.g.
>     PIDFile=/var/run/myservice.pid
>     ExecStartPre=/usr/bin/touch %PIDFile ; /bin/chown myuser %PIDFile
>

Generally there isn't, at least not for referencing unit options.

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.

-- 
Mantas Mikulėnas <graw...@gmail.com>
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to