Antw: [EXT] Re: Systemd hang when restarting a service during shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> Uoti Urpala <uoti.urpala@xxxxxxxxxxx> schrieb am 08.11.2021 um 14:47 in
Nachricht <27d2e5ff8a9b53e71bb599986060b7fbae469f1d.camel@xxxxxxxxxxx>:
> On Mon, 2021-11-08 at 12:05 +0100, Sean Nyekjaer wrote:
>> Regarding,
>> https://github.com/systemd/systemd/issues/21203 
>> 
>> I think the point of the issue missed when the issue got closed.
>> 
>> We have a service that is changing configs for systemd-networkd and
>> issuing a `systemctl restart systemd-networkd`.
>> An other service is checking uptime and issues a `systemctl reboot`,
>> when our max uptime have been exeeced.
>> If restart of systemd-networkd happens while a reboot is in progress,
>> the system will hang "forever" (and continue to pet the watchdog).
> 
> The issue shows you using "systemctl start systemd-reboot". That is not
> the right way to reboot. Use "systemctl reboot" instead. I suspect this
> is related to why the reboot may stop partway: your command does not
> start the reboot tasks in "irreversible" mode, which means that any
> following contrary command, such as explicitly (re)starting a unit that
> was going to be shut down, is going to implicitly cancel the
> conflicting reboot action.
> 
> You should also be using "try-restart" instead of "restart". If your
> intent is to change configs, you want to say "make sure old configs are
> not in use" rather than "enforce that the service is running now". (I
> think making the "restart" command have "start" semantics was a design
> mistake, and the "try-restart"/"restart" pair would have been better
> named "restart"/"start-or-restart".)

Discussable: If the desired effect of "restart" is that the service is running with current executables and current configuration, it's OK.
If the desired effect is that the service should be restarted if it was running, but not otherwise, it's probably just the wrong command.
Why would one use "restart" when the service shouldn't start?

Regards,
Ulrich








[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux