[systemd-bugs] [Bug 89587] Executing a service with RuntimeDirectory= produces an error: Failed at step RUNTIME_DIRECTORY spawning /bin/bash: File exists

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Mar 16 06:49:41 PDT 2015


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

Fireball <gsbox39stz at thurston.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|NOTABUG                     |---

--- Comment #2 from Fireball <gsbox39stz at thurston.ru> ---
No, this does not seem to be the case.
I moved rsync to the main part:

[Unit]
Description=Log Data From CO2Mon
PartOf=co2mon.service

[Service]
User=co2mon
Group=co2mon
RuntimeDirectory=co2mon
RuntimeDirectoryMode=0755
WorkingDirectory=/run/co2mon
StandardOutput=null
ExecStart=/bin/bash -c "/usr/bin/rsync -a /var/lib/co2mon/ /run/co2mon ;
./update_data.sh"
ExecStopPost=-/bin/cp -p /run/co2mon/graph.rrd /var/lib/co2mon/

[Install]
WantedBy=multi-user.target

Check that the directory is not there before start:
# ls -ld /run/co2mon
ls: cannot access /run/co2mon: No such file or directory

Still fails:

# systemctl start co2mon-log
# systemctl status co2mon-log
● co2mon-log.service - Log Data From CO2Mon
   Loaded: loaded (/etc/systemd/system/co2mon-log.service; disabled; vendor
preset: enabled)
   Active: failed (Result: exit-code) since 月 2015-03-16 16:37:49 MSK; 3s ago
  Process: 9069 ExecStopPost=/bin/cp -p /run/co2mon/graph.rrd /var/lib/co2mon/
(code=exited, status=233/RUNTIME_DIRECTORY)
  Process: 9066 ExecStart=/bin/bash -c /usr/bin/rsync -a /var/lib/co2mon/
/run/co2mon ; ./update_data.sh (code=exited, status=233/RUNTIME_DIRECTORY)
 Main PID: 9066 (code=exited, status=233/RUNTIME_DIRECTORY)

 3月 16 16:37:49 melforce systemd[1]: Started Log Data From CO2Mon.
 3月 16 16:37:49 melforce systemd[1]: Starting Log Data From CO2Mon...
 3月 16 16:37:49 melforce systemd[1]: co2mon-log.service: main process exited,
code=exited, status=233/RUNTIME_DIRECTORY
 3月 16 16:37:49 melforce systemd[1]: Unit co2mon-log.service entered failed
state.
 3月 16 16:37:49 melforce systemd[1]: co2mon-log.service failed.

The other strange thing is that "cp" which is in ExecStopPost= (not the main
part) also fails on runtime directory step and we see systemd's exit status
223, not cp's itself. cp is prefixed with minus sign. It can't fail. Doesn't
this contradict what you said?

-- 
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/20150316/1b683bf8/attachment.html>


More information about the systemd-bugs mailing list