[systemd-bugs] [Bug 66641] New: PID file /var/run/program.pid not readable (yet?) after start. PIDFile + User&Group

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jul 6 04:31:50 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=66641

          Priority: medium
            Bug ID: 66641
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: PID file /var/run/program.pid not readable (yet?)
                    after start. PIDFile + User&Group
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: alexey.ivanes at gmail.com
          Hardware: All
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

Example service file

[Unit]
Description=Daemon
After=syslog.target network.target

[Service]
Type=forking
User=programd2
Group=programd2
PIDFile=/var/run/programd2.pid
ExecStart=/usr/sbin/programd2 -D

[Install]
WantedBy=multi-user.target

I need to start service from the user. Also must have a pid file. But if i use
User= Group= not able to create pid file in /var/run (No permission). In logs:
PID file /var/run/programd2.pid not readable (yet?) after start.

I believe that this is a problem systemd. Systemd should create pid as "root"
and do it chown before Exec.

This is a very bad decision:
>> ExecPre=touch /var/run/program.pid
>> ExecPre=chown programd2:programd2/var/run/program.pid
>> Exec=/bin/su -s /bin/sh -c '/usr/sbin/programd2 -D' programd2

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130706/1e8089ff/attachment.html>


More information about the systemd-bugs mailing list