[systemd-bugs] [Bug 85156] New: Reloading systemd config causes ExecStartPre in unchanged units to run more than once

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Oct 17 12:29:50 PDT 2014


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

            Bug ID: 85156
           Summary: Reloading systemd config causes ExecStartPre in
                    unchanged units to run more than once
           Product: systemd
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: systemd-bugs at lists.freedesktop.org
          Reporter: jonathan.short at sendgrid.com
        QA Contact: systemd-bugs at lists.freedesktop.org

Originally filed against fleet project:
https://github.com/coreos/fleet/issues/973.  This is systemd version 215
running on CoreOS.

-- Description --
Unit files and script demonstrating issue:
http://filebin.ca/1dxpnTpXmJ4z/repro_final.tar.gz. 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: http://filebin.ca/1dxv3kRBcU3X/journalctl.txt

-- Comment 1 --
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 
(https://github.com/coreos/fleet/issues/973) 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.

-- 
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/20141017/b5f2d52f/attachment.html>


More information about the systemd-bugs mailing list