Skip to contentSkip to conversation

tools/hotplug: allow tuning of xenwatchdogd arguments

PATCH In review Olaf Hering 3 participants 7 messages Dec 3, 2020 – Dec 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools/hotplug: allow tuning of xenwatchdogd arguments

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.

---

v2: fix "test -n" in init.d

 tools/hotplug/Linux/init.d/xen-watchdog.in          | 7 ++++++-
 tools/hotplug/Linux/systemd/xen-watchdog.service.in | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)
tools/hotplug/Linux/init.d/xen-watchdog.in +6 -1
index c05f1f6b6a..b36a94bd8e 100644
@@ -19,6 +19,11 @@
 
 . @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='15 30'
 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
tools/hotplug/Linux/systemd/xen-watchdog.service.in +3 -1
index 1eecd2a616..637ab7fd7f 100644
@@ -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]
#1 lore raw
Quoted 12 lines · Olaf Hering

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.

Quoted 8 lines

---

v2: fix "test -n" in init.d

  tools/hotplug/Linux/init.d/xen-watchdog.in          | 7 ++++++-
  tools/hotplug/Linux/systemd/xen-watchdog.service.in | 4 +++-
  2 files changed, 9 insertions(+), 2 deletions(-)

Could you please add a section for XENWATCHDOGD_ARGS in tools/hotplug/Linux/init.d/sysconfig.xencommons.in ?

Juergen

#2 lore raw

Am Thu, 3 Dec 2020 07:47:58 +0100
schrieb Jürgen Groß <[email protected]>:

Quoted 2 lines

Could you please add a section for XENWATCHDOGD_ARGS in tools/hotplug/Linux/init.d/sysconfig.xencommons.in ?

No. Such details have to go into a to-be-written xencommons(8).

There will be a xenwatchdogd(8) shortly, which will cover this knob.

Olaf

#3 lore raw
Quoted 9 lines · Olaf Hering

Am Thu, 3 Dec 2020 07:47:58 +0100
schrieb Jürgen Groß <[email protected]>:

Quoted 2 lines

Could you please add a section for XENWATCHDOGD_ARGS in tools/hotplug/Linux/init.d/sysconfig.xencommons.in ?

No. Such details have to go into a to-be-written xencommons(8).

There will be a xenwatchdogd(8) shortly, which will cover this knob.

The more manpages the better. :-)

Wei.

Quoted 3 lines

Olaf

#4 lore raw
In reply to Olaf Hering
Quoted 38 lines · Olaf Hering

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.

---

v2: fix "test -n" in init.d

 tools/hotplug/Linux/init.d/xen-watchdog.in          | 7 ++++++-
 tools/hotplug/Linux/systemd/xen-watchdog.service.in | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)
tools/hotplug/Linux/init.d/xen-watchdog.in +5 -0
index c05f1f6b6a..b36a94bd8e 100644
@@ -19,6 +19,11 @@
 
 . @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='15 30'
 DAEMON=${sbindir}/xenwatchdogd
 base=$(basename $DAEMON)
 

tools/hotplug/Linux/init.d/xen-watchdog.in start() { · line 54

Quoted 5 lines
tools/hotplug/Linux/init.d/xen-watchdog.in +1 -1
@@ -46,7 +51,7 @@ start() {
 	local r
 	echo -n $"Starting domain watchdog daemon: "
 
-	$DAEMON 30 15
+	$DAEMON $XENWATCHDOGD_ARGS

Did you accidentally swap 15 and 30 in XENWATCHDOGD_ARGS above? I see no reasoning in the commit message for this change.

No need to resend. I can fix it for you. But please confirm if that's a mistake.

Wei.

Quoted 18 lines
tools/hotplug/Linux/init.d/xen-watchdog.in +0 -0
 	r=$?
 	[ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup"
 	echo
tools/hotplug/Linux/systemd/xen-watchdog.service.in +3 -1
index 1eecd2a616..637ab7fd7f 100644
@@ -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]
#5 lore raw

Am Fri, 4 Dec 2020 10:53:15 +0000
schrieb Wei Liu <[email protected]>:

Quoted 1 line

Did you accidentally swap 15 and 30 in XENWATCHDOGD_ARGS above?

This is indeed a mistake. Thanks for spotting.

Olaf

#6 lore raw
Quoted 6 lines · Olaf Hering

Am Fri, 4 Dec 2020 10:53:15 +0000
schrieb Wei Liu <[email protected]>:

Quoted 1 line

Did you accidentally swap 15 and 30 in XENWATCHDOGD_ARGS above?

This is indeed a mistake. Thanks for spotting.

Fixed and pushed. Thanks.

Wei.