[systemd-devel] Extend service runtime

Lennart Poettering lennart at poettering.net
Tue May 5 06:56:02 UTC 2020


On Mo, 04.05.20 15:51, Andy Pieters (systemd at andypieters.me.uk) wrote:

> Hi
>
> I'm trying to accomplish the following:
>
> An event happens -> I start a systemd service in response
>   after RuntimeMaxSec is reached service terminates and cleans up event
>
> Should a second event happen whilst RuntimeMaxSec is not yet reached the
>  preference would be to reset RuntimeMaxSec of the service
>
> Alternatively, I suppose I could shut down the service and restart it in
> reply to
> a second or third or fourth event happening.
>
> Any suggestions here?

A service for which sd_notify() is enabled can send
an EXTEND_TIMEOUT_USEC= message to the service manager, in order to
extend its timeouts. Wouldn't that work for you?

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list