]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
tools/hotplug: allow tuning of xenwatchdogd arguments
authorOlaf Hering <olaf@aepfle.de>
Thu, 3 Dec 2020 06:34:36 +0000 (07:34 +0100)
committerWei Liu <wl@xen.org>
Fri, 4 Dec 2020 11:51:14 +0000 (11:51 +0000)
Currently the arguments for xenwatchdogd are hardcoded with 15s
keep-alive interval and 30s timeout.

It is not possible to tweak these values via
/etc/systemd/system/xen-watchdog.service.d/*.conf because ExecStart
can not be replaced. The only option would be a private copy
/etc/systemd/system/xen-watchdog.service, which may get out of sync
with the Xen provided xen-watchdog.service.

Adjust the service file to recognize XENWATCHDOGD_ARGS= in a
private unit configuration file.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Wei Liu <wl@xen.org>
tools/hotplug/Linux/init.d/xen-watchdog.in
tools/hotplug/Linux/systemd/xen-watchdog.service.in

index c05f1f6b6abfc8f9af2c9464edb64ffb2dae195c..a0bde199c43ccbad8222809003fd30df10e4782c 100644 (file)
 
 . @XEN_SCRIPT_DIR@/hotplugpath.sh
 
+xencommons_config=@CONFIG_DIR@/@CONFIG_LEAF_DIR@
+
+test -f $xencommons_config/xencommons && . $xencommons_config/xencommons
+
+test -n "$XENWATCHDOGD_ARGS" || XENWATCHDOGD_ARGS='30 15'
 DAEMON=${sbindir}/xenwatchdogd
 base=$(basename $DAEMON)
 
@@ -46,7 +51,7 @@ start() {
        local r
        echo -n $"Starting domain watchdog daemon: "
 
-       $DAEMON 30 15
+       $DAEMON $XENWATCHDOGD_ARGS
        r=$?
        [ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup"
        echo
index 1eecd2a616250131186ac1904fdcd452404e608e..637ab7fd7f726c8dd6b208cbc1da9bf54f0c5a52 100644 (file)
@@ -6,7 +6,9 @@ ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=forking
-ExecStart=@sbindir@/xenwatchdogd 30 15
+Environment="XENWATCHDOGD_ARGS=30 15"
+EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
+ExecStart=@sbindir@/xenwatchdogd $XENWATCHDOGD_ARGS
 KillSignal=USR1
 
 [Install]