<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:david@davidstrauss.net" title="David Strauss <david@davidstrauss.net>"> <span class="fn">David Strauss</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - RFE: Add StopUnit= support to timers"
href="https://bugs.freedesktop.org/show_bug.cgi?id=79497">bug 79497</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>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>WONTFIX
</td>
</tr>
<tr>
<td style="text-align:right;">Summary</td>
<td>OnUnitActiveSec triggers when timer unit starts
</td>
<td>RFE: Add StopUnit= support to timers
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - RFE: Add StopUnit= support to timers"
href="https://bugs.freedesktop.org/show_bug.cgi?id=79497#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - RFE: Add StopUnit= support to timers"
href="https://bugs.freedesktop.org/show_bug.cgi?id=79497">bug 79497</a>
from <span class="vcard"><a class="email" href="mailto:david@davidstrauss.net" title="David Strauss <david@davidstrauss.net>"> <span class="fn">David Strauss</span></a>
</span></b>
<pre><span class="quote">> If the timer had a StopUnit option, baobei-umount.service</span >
would not be needed.
Please don't use timers to shut down units after a guess a how long it takes
for them to go idle. It's not safe and never will be.
<span class="quote">> I tried hard to set up socket activation for cups (printing), but failed. </span >
I wanted cups to be stopped a certain time after being started, but the
timer triggered immediately and the killer service killed cups which had
just been started.
Fedora ships with CUPS using socket activation, so it definitely works. If CUPS
should shut down on idle, that needs to be taken up with the CUPS project, not
systemd.
<span class="quote">> If systemd's automount unit had an auto-unmount timer, a lot of</span >
this complication could be avoided.
There is already a TODO ("automount: implement expire") for automount units to
support unmount-on-idle, which is already implemented in the underlying autofs
layer, as you note.
<span class="quote">> In fact, the same is true for socket units, for which you can assume that the underlying service is unused if no packets go through its socket.</span >
No, you cannot assume that. Your example service, CUPS, is a counterexample
given that a brief connection requesting a huge print job could occupy the
daemon for hours.
<span class="quote">> A race condition needs to be worked around, if systemd declares a unit unused and stops it, but after committing to stop, the automount reports access or the socket receives a packet.</span >
This should already be handled for socket activation. systemd resumes watching
for incoming data when stopping the service, allowing for immediate
reactivation after shutdown completes.</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>