Hello!

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 (https://www.freedesktop.org/software/systemd/man/systemd.service) is acceptable here|.
|

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 (https://www.freedesktop.org/software/systemd/man/systemd.service) for your service is set, it will be executed.


12.09.2016 21:13, Федор Короткий пишет:
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?


_______________________________________________
systemd-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to