[systemd-devel] Fwd: Stopping a service at a specific time or after a specific duration

Andrei Borzenkov arvidjaar at gmail.com
Tue Apr 26 03:24:58 UTC 2016


25.04.2016 19:53, Reindl Harald пишет:
> 
> 
> Am 22.04.2016 um 17:07 schrieb Reindl Harald:
>> Am 22.04.2016 um 17:03 schrieb Lennart Poettering:
>>> On Thu, 21.04.16 10:32, Reindl Harald (h.reindl at thelounge.net) wrote:
>>>
>>>>> Thanks. The man page says:
>>>>>
>>>>>> If this is used and the service has been active for longer than the
>>>>>> specified
>>>>>> time it is terminated and put into a failure state
>>>>
>>>> and i call that a design bug - why does it go into failure state?
>>>
>>> No need to warm up this discussion. And I think I said already that
>>> I'd be happy to merge a patch that allows making the MaxRuntimeSec=
>>> effect configurable, and optionally clean
>>
>> sorry for not beeing able to fix and change C/C++ code and only can
>> state when things are not finally designed from start.....
> 
> and thinking again about "RuntimeMaxSec=" i don't get it's usecase
> 
> * Type=oneshot hat the "state failed" behavior already
>   with "TimeoutStartSec=" if it takes longer
> 

But it is synchronous and that may not be always wanted.

> * Type=simple/forking is not supposed to stop the main process
>   itself, otherwise it goes in failure state
> 

Not really. If main PID exit successfully, it simply goes into dead
state (modulo RemainAfterExit). And you can even define what
"successfully" means (SuccessExitStatus).


More information about the systemd-devel mailing list