<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Reloading systemd config causes ExecStartPre in unchanged units to run more than once"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85156">85156</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Reloading systemd config causes ExecStartPre in unchanged units to run more than once
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jonathan.short@sendgrid.com
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr></table>
<p>
<div>
<pre>Originally filed against fleet project:
<a href="https://github.com/coreos/fleet/issues/973">https://github.com/coreos/fleet/issues/973</a>. This is systemd version 215
running on CoreOS.
-- Description --
Unit files and script demonstrating issue:
<a href="http://filebin.ca/1dxpnTpXmJ4z/repro_final.tar.gz">http://filebin.ca/1dxpnTpXmJ4z/repro_final.tar.gz</a>. Running 410.2.0. Run the
run.sh script to reproduce the issue, then check fleetctl journal
unit1.service.
The example files are a simplified example of our original code. This seems
timing related so most of the original contents of the unit file have been
replaced with sleeps.
Output of fleetctl journal unit1.service (note unit1_starting appears twice -
should be once):
Oct 15 11:22:56 core-02 systemd[1]: Starting Unit1...
Oct 15 11:22:57 core-02 bash[4878]: unit1_starting
Oct 15 11:23:03 core-02 bash[4917]: unit1_starting
Oct 15 11:23:10 core-02 sudo[4928]: core : TTY=unknown ; PWD=/ ; USER=root ;
COMMAND=/usr/bin/systemctl set-environment UNIT1=xxx
Oct 15 11:23:13 core-02 systemd[1]: Started Unit1.
Output of journalctl: <a href="http://filebin.ca/1dxv3kRBcU3X/journalctl.txt">http://filebin.ca/1dxv3kRBcU3X/journalctl.txt</a>
-- <a href="show_bug.cgi?id=85156#c1">Comment 1</a> --
Hmm, I haven't dived into this too deeply but I am fairly sure it's a result of
daemon-reload getting called while the ExecStartPre of unit1 is still
occurring. Not sure whether that's expected behaviour or not.
For example, I seem to be able to simulate the same behaviour by running
systemctl start unit1.service and then systemctl daemon-reload in another
terminal (while the start is blocking). Would be interesting to know whether
that causes the same issues you're experiencing too.
---
I asked in IRC #systemd whether this was a bug, the answer came back yes:
10:35 <jonathan_> I filed an issue with fleet
(<a href="https://github.com/coreos/fleet/issues/973">https://github.com/coreos/fleet/issues/973</a>) that appears to be a
systemd issue (coreos is running version 215). The issue is that
systemctl daemon-reload is run while a unit is starting and in an
ExecStartPre=. The unit gets started again (runs same
ExecStartPre=) without going through any stop state first. Just
wondering if that is a known issue, expected behavior, or a bug.
10:41 <michich> jonathan_, a bug.
10:44 <michich> on the other hand, if the unit file changed, then it's not easy
to tell what the correct behavior should be
11:31 <jonathan_> @michich thanks. that makes sense. the unit file didn't
change in this case so sounds straightforward.</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>