Discussion:
ShutdownWatchdogSec does not work as described
(too old to reply)
prashantkumar dhotre
2018-03-19 06:11:33 UTC
Permalink
Raw Message
Hi
I am observing that ShutdownWatchdogSec setting in system.conf

In man page, for ShutdownWatchdogSec , I see :
" It works as a safety net to ensure that the reboot takes place even if a
clean reboot attempt times out. "
I am not clear what is meant by 'clean reboot' and 'times out ' here

For testing, I have set it to 5 sec

++++++++++++++++++++++++++++++
***@re1:~# grep ShutdownWatchdogSec /etc/systemd/system.conf
ShutdownWatchdogSec=5sec
***@re1:~#
++++++++++++++++++++++++++++++


and I have my.service , which on stop will sleep for few minutes

++++++++++++++++++++++++++++++
# cat /etc/systemd/system/my.service
[Unit]
Description="my"

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStopPost=/bin/sleep 3000
Restart=no

[Install]
WantedBy=multi-user.target
++++++++++++++++++++++++++++++

But I dont see hardware watchdog being kicked in.
Is this a bug in ShutdownWatchdogSec ? if not am I missing any config ?

I did some research and found below links which talk about effect of
ShutdownWatchdogSec .

https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog

as described in above pages, one option seem to be to lower value of
JobTimeoutSec
<https://www.freedesktop.org/software/systemd/man/systemd.unit.html> in
reboot.target but that solution is still about software watchdog and not
about hardware watchdog.


My requirement is to put upper bound time limit of reboot, and once upper
limit is reached, i want to kick in hardware watchdog

Could you please let me know how do I achieve this ?

Thanks
prashantkumar dhotre
2018-03-19 08:06:44 UTC
Permalink
Raw Message
I see another issue also wrt hardware watchdog
reboot-force seem to be overwriting the hardware watchdog timeout value.

I have changed reboot.target to make JobTimeoutSec=5sec
when system boots up i see that hardware watchdog is set to 1 min 4 sec.
but when 'systemctl reboot' timesout , reboot-force is invoked and that is
overwriting the
hardware watchdog timeout value to 4 min.
Is this a bug or I am missing some config?

Thanks



# grep -i hardware /var/tmp/j12_systemctl_reboot_jobtimeout5sec_1

Mar 18 23:42:11 re1 systemd[1]: Hardware watchdog 'iTCO_wdt', version 0
Mar 18 23:42:11 re1 systemd[1]: Set hardware watchdog to 1min 4s.
Mar 18 23:42:32 re1 systemd[1]: Set hardware watchdog to 4min.

+++++++

***@bng-evo-ptx5k-c-re1:~# cat /lib/systemd/system/reboot.target
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

[Unit]
Description=Reboot
Documentation=man:systemd.special(7)
DefaultDependencies=no
Requires=systemd-reboot.service
After=systemd-reboot.service
AllowIsolate=yes
#JobTimeoutSec=30min
JobTimeoutSec=5sec
JobTimeoutAction=reboot-force

[Install]
Alias=ctrl-alt-del.target




On Mon, Mar 19, 2018 at 11:41 AM, prashantkumar dhotre <
Post by prashantkumar dhotre
Hi
I am observing that ShutdownWatchdogSec setting in system.conf
" It works as a safety net to ensure that the reboot takes place even if a
clean reboot attempt times out. "
I am not clear what is meant by 'clean reboot' and 'times out ' here
For testing, I have set it to 5 sec
++++++++++++++++++++++++++++++
ShutdownWatchdogSec=5sec
++++++++++++++++++++++++++++++
and I have my.service , which on stop will sleep for few minutes
++++++++++++++++++++++++++++++
# cat /etc/systemd/system/my.service
[Unit]
Description="my"
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStopPost=/bin/sleep 3000
Restart=no
[Install]
WantedBy=multi-user.target
++++++++++++++++++++++++++++++
But I dont see hardware watchdog being kicked in.
Is this a bug in ShutdownWatchdogSec ? if not am I missing any config ?
I did some research and found below links which talk about effect of
ShutdownWatchdogSec .
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog
as described in above pages, one option seem to be to lower value of
JobTimeoutSec
<https://www.freedesktop.org/software/systemd/man/systemd.unit.html> in
reboot.target but that solution is still about software watchdog and not
about hardware watchdog.
My requirement is to put upper bound time limit of reboot, and once upper
limit is reached, i want to kick in hardware watchdog
Could you please let me know how do I achieve this ?
Thanks
Michael Olbrich
2018-03-19 09:19:39 UTC
Permalink
Raw Message
Post by prashantkumar dhotre
I am observing that ShutdownWatchdogSec setting in system.conf
" It works as a safety net to ensure that the reboot takes place even if a
clean reboot attempt times out. "
I am not clear what is meant by 'clean reboot' and 'times out ' here
For testing, I have set it to 5 sec
++++++++++++++++++++++++++++++
ShutdownWatchdogSec=5sec
++++++++++++++++++++++++++++++
and I have my.service , which on stop will sleep for few minutes
++++++++++++++++++++++++++++++
# cat /etc/systemd/system/my.service
[Unit]
Description="my"
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStopPost=/bin/sleep 3000
Restart=no
[Install]
WantedBy=multi-user.target
++++++++++++++++++++++++++++++
But I dont see hardware watchdog being kicked in.
Is this a bug in ShutdownWatchdogSec ? if not am I missing any config ?
I did some research and found below links which talk about effect of
ShutdownWatchdogSec .
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNFSMountShutdown
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdShutdownWatchdog
as described in above pages, one option seem to be to lower value of
JobTimeoutSec
<https://www.freedesktop.org/software/systemd/man/systemd.unit.html> in
reboot.target but that solution is still about software watchdog and not
about hardware watchdog.
My requirement is to put upper bound time limit of reboot, and once upper
limit is reached, i want to kick in hardware watchdog
Could you please let me know how do I achieve this ?
Rebooting with systemd can be split into 3 stages:
1. Activate reboot.target
That's just a normal transition in systemd. The mainloop is still
running and RuntimeWatchdogSec= is used and the watchdog is pinged as
needed.
2. Kill all remaining processes and unmount all filesystem. The mainloop is
no longer running at this point. This is covered by ShutdownWatchdogSec=
in case any of these operations does not finish.
3. Execute the reboot() system call.

I'm not sure if you can limit the duration of the first step reliably. You
can skip it with 'systemctl reboot -f'.

Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Loading...