<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:gsbox39stz@thurston.ru" title="Fireball <gsbox39stz@thurston.ru>"> <span class="fn">Fireball</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Executing a service with RuntimeDirectory= produces an error: Failed at step RUNTIME_DIRECTORY spawning /bin/bash: File exists"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89587">bug 89587</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>NOTABUG
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Executing a service with RuntimeDirectory= produces an error: Failed at step RUNTIME_DIRECTORY spawning /bin/bash: File exists"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89587#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Executing a service with RuntimeDirectory= produces an error: Failed at step RUNTIME_DIRECTORY spawning /bin/bash: File exists"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89587">bug 89587</a>
from <span class="vcard"><a class="email" href="mailto:gsbox39stz@thurston.ru" title="Fireball <gsbox39stz@thurston.ru>"> <span class="fn">Fireball</span></a>
</span></b>
<pre>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?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>