<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello!</p>
How does your service work from 10:00 till 18:45 -- with any
interruption during this time-range, or constantly? I'm asking,
because I'm not sure if RuntimeMaxSec= directive
(<a class="moz-txt-link-freetext" href="https://www.freedesktop.org/software/systemd/man/systemd.service">https://www.freedesktop.org/software/systemd/man/systemd.service</a>)
is acceptable here<span class="term"><code class="varname">.<br>
</code></span>
<p>So, you start your service by timer on 10:00 and due to
RuntimeMaxSec=31500 in [Service] section of your service, service
should stop on 18:45:00 it should be stopped with exit code 0. But
if it happens on 18:45:01 -- will stop with exit with failure
state. In that case, if FailureAction= directive
(<a class="moz-txt-link-freetext" href="https://www.freedesktop.org/software/systemd/man/systemd.service">https://www.freedesktop.org/software/systemd/man/systemd.service</a>)
for your service is set, it will be executed.<br>
</p>
<br>
<div class="moz-cite-prefix">12.09.2016 21:13, Федор Короткий пишет:<br>
</div>
<blockquote
cite="mid:CAFX_x3U96RFqALZmZDvx7Eqjwxh2DK3rfozoHBmdaXfTa9M4Cg@mail.gmail.com"
type="cite">
<pre wrap="">Hi,
We are trying to setup a service that runs every day from 10:00 to 18:45.
Starting is not a problem, we just used timer. But our solution for
stopping the service seems ugly. We have second service with
Type=oneshot which runs "systemctl stop first.service" at 18.45(by
using second timer).
Is there a better way to achieve this?
</pre>
</blockquote>
<br>
</body>
</html>