<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - if "systemctl daemon-reload" is executed right before timer expires, timer doesn't fire nor rearm"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=58216">58216</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>if "systemctl daemon-reload" is executed right before timer expires, timer doesn't fire nor rearm
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Alex.Jones@genband.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=71415" name="attach_71415" title="gzipped tar file containing files needed to reproduce the bug">attachment 71415</a> <a href="attachment.cgi?id=71415&action=edit" title="gzipped tar file containing files needed to reproduce the bug">[details]</a></span>
gzipped tar file containing files needed to reproduce the bug

If "systemctl daemon-reload" is executed within a second of a timer expiring,
the timer will not fire and will never be rearmed.  It stays in "elapsed" state
forever.

I originally see this problem in OpenSUSE-12.1 which uses systemd-37, but I
have tested this against the stock systemd-196, and the problem still exists
there.

I've included a gzipped tarfile which contains a service file
(elapsed-bug.service), a timer file (elapsed-service.timer), and a bash script
which reproduces the bug.

How to reproduce the bug:

1) install the service and timer file in /etc/systemd/system
2) modify ExecStart in the service file to log something to a file or something
of that nature (so you know the timer is running properly)
3) systemctl daemon-reload
4) systemctl enable elapsed-bug.timer
5) systemctl start elapsed-bug.timer
6) make sure the timer is running properly
7) run test1.sh (you may need to modify the awk field depending on the output
of "systemctl status elapsed-bug.service")
8) it will print out a message that it has found the bug, and then exit (may
take a minute or two)
9) verify that your printout (or whatever your ExecStart was doing) is no
longer doing it</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>