[systemd-devel] how to put max time limit on reboot time
prashantkumar dhotre
prashantkumardhotre at gmail.com
Thu Apr 5 06:26:57 UTC 2018
Hi
Currently it appears that systemd does not provide a way to put max time
limit for system reboot.
So there is no way to get system reboot within specified time limit even if
hardware watchdog is present in system.
Using RunTimeWatchDogSec,ShutDownTimeWatchDogSec and
JobTimeoutSec,JobTimeoutAction= in shutdown.target will not solve this
issue.
RunTimeWatchDogSec configures hardware watchdog (hw wd )with the given
timeout value and system manager will pat the wd at least once in half of
that time.
This wd patting will be done in 1st phase of shutdown also.
example: set this to 2 min and hw wd gets configured with 2 min timeout and
system manager keeps patting every 1min.
ShutDownTimeWatchDogSec will configured HW WD with given value and pats the
WD during 2nd phase of shutdown.
2nd phase of shutdown contains loop of 'try to clean up remaining things'.
So for ex, if we set ShutDownTimeWatchDogSec to 10 min, then during 2nd
phase of shutdown , if any task of 'try to clean up remaining things' in
the loop takes more than 10 min, then only HW WD get fired and system
reboots.
So this puts max time out on each iteration of loop and not on entire loop
So this setting does not help in putting max time out for 2nd phase of
shutdown.
But intention of ShutDownTimeWatchDogSec from man page is : “It works as a
safety net to ensure that the reboot takes place even if a clean reboot
attempt times out.”
Clearly this intention is not served by current implementation of
ShutDownTimeWatchDogSec.
Do we need to :
redefine ShutDownTimeWatchDogSec and use it to put max time out on entire
2nd part of shutdown.
i.e set the user given value of ShutDownTimeWatchDogSec to HW WD at
beginning of 2nd phase of shutdown but do not pat HW WD each time in in
each iteration of loop.
this way, if 2nd phase takes more than 10 min, then hw wd gets fired and
system reboots.
please let me know if we need to open a bug for this
1) related write up
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog
2) my previous queries related to this are
https://lists.freedesktop.org/archives/systemd-devel/2018-March/040566.html
https://github.com/systemd/systemd/issues/8484
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180405/dbb95c19/attachment-0001.html>
More information about the systemd-devel
mailing list