[systemd-devel] [ANNOUNCE] systemd v229

Mikhail Kasimov mikhail.kasimov at gmail.com
Fri Feb 12 21:28:31 CET 2016


12.02.2016 22:17, Lennart Poettering пишет:
> On Thu, 11.02.16 20:14, Mikhail Kasimov (mikhail.kasimov at gmail.com) wrote:
> 
>> 11.02.2016 19:48, Lennart Poettering пишет:
>>> On Thu, 11.02.16 19:47, Mikhail Kasimov (mikhail.kasimov at gmail.com) wrote:
>>>
>>>> 11.02.2016 19:32, Jóhann B. Guðmundsson пишет:
>>>>
>>>>>>          * A new service setting RuntimeMaxSec= has been added that
>>>>>> may be used
>>>>>>            to specify a maximum runtime for a service. If the timeout
>>>>>> is hit, the
>>>>>>            service is terminated and put into a failure state.
>>>>>
>>>>> This does not sound right, why put it into failure state if I as an
>>>>> admin specifically told the the service it could run for maximum X time
>>>>> and then it should stop? ( after that time period the type unit should
>>>>> be stopped cleanly basically systemctl stop foo.service and the state be
>>>>> exactly the same as it yields right ? )
>>>>
>>>> And if additional option Restart=on-failure is defined in [Service], the
>>>> unit will be restarted again immediately. So, user will get unit, that
>>>> will be active due to RuntimeMaxSec=, then it will be marked as "failed"
>>>> and, if additional option Restart=on-failure is defined, will be
>>>> restarted again... failed...restart and so on for eternity. Right?
>>>
>>> Sure, if that's how you configure things, then systemd does what you
>>> are asking it for.
>>
>>
>> I'm staring on TimeoutStopSec= directive description and I think it's be
>> more logical a little bit to define RuntimeMaxSec= _only together_ with
>> TimeoutStopSec=.
> 
> TimeoutStopSec= is set to 90s by default. Because it is opt-out and
> not opt-in it's set pretty much in all cases.
> 
> Note that when the RuntimeMaxSec= timeout hits and systemd starts
> terminating the service it does so by going through ExecStop= and
> ExecStopPost=. The TimeoutStopSec= timeout applies to each of them
> anyway.


So, if systemd is going through ExecStop= and ExecStopPost= to stop unit
with RuntimeMaxSec=, which is the normal procedure to exit with
on-success exit-code, why systemd marks unit as "failed", when
RuntimeMaxSec= is hit? Can't catch the logic yet...

> Either way, I am happy to take a patch that makes this
configurable.

That was one of ways to use TimeoutStopSec=, as the first idea how to
manke this mechanism more flexible.



More information about the systemd-devel mailing list