[systemd-devel] forking PIDFile question

Mantas Mikulėnas grawity at gmail.com
Tue Feb 20 06:32:45 UTC 2018


On Mon, Feb 19, 2018 at 11:29 PM, <steve at goodey.org> wrote:

> Hello,
>
>
>
> Sorry if this question is a bit basic for a devel list, I tried asking it
> in a ubuntu forum but didn't get any views, let alone replies.
>
>
>
> I have a PC running Mythbuntu which has an LCD which I had a bit of a
> struggle getting going under systemd. However using Type=forking it is now
> working fine. However reading the man page for systemd.service is says that
> it is recommended to use PIDFile.
>

It might be recommended in some cases (the more complex the daemon is), but
useless in your case.

Removing the line PIDFile=/run/LCDd.pid in LCDd.service and all is good.
>
> I have tried creating LCDd.pid in /run with root:root but get the same.
> How is the pid file generated?
>

It is created by your daemon process.

If your daemon does not support creating pidfiles, just don't use the
PIDFile= option in the first place...


> Am I right in thinking that LCDd is so old that it hasn't been written
> with systemd in mind so does not support PIDFile?
>

No; it's almost the opposite. Pidfiles have been in use for several decades
with sysvinit (they were one of the primary methods of service
identification), but became practically optional with systemd's
cgroup-based tracking.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180220/62a7189b/attachment.html>


More information about the systemd-devel mailing list