title: Systemd timer and conditional service interaction
body: <p>I've got a conditional systemd service <code>foo.service</code> with condition <code>ConditionDirectoryNotEmpty=/tmp/foo</code>. It's a one-shot service to empty <code>/tmp/foo</code>. </p>
  
  <p>This works correctly in isolation. If I start the service when <code>/tmp/foo</code> holds a file, the service runs and the file is removed. If not, the service is skipped. Either way, it runs in less than a second.</p>
  
  <p>The problem arises when I try to start this service from an associated timer. The timer gets stuck in a broken state. <code>systemctl list-timers</code> shows that <code>foo.timer</code> has a <code>NEXT</code> entry in the past (!) and it fired one millisecond ago. Indeed, it appears to be continously firing. That's of course not the timer setting:</p>
  
  <pre><code>[Timer]
  OnUnitActiveSec=
  OnUnitActiveSec=60s
  Persistent=true
  </code></pre>
  
  <p>60 seconds is a lot more than one minute. The empty <code>OnUnitActiveSec=</code> line is intentional; it should clear any existing timer period.</p>
  
  <p>Why is the timer going berserk? Why is it firing so often, why is the next time to fire in the past? Most importantly, how do I run a service once a minute, but only if needed?</p>
  
  <p><code>systemd</code> version 215, on Debian 8 (Armbian 5.30)</p>