Skip to contentSkip to conversation

tools/hotplug: Don't ever kill xenstored

PATCH In review Ross Lagerwall 3 participants 4 messages Feb 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools/hotplug: Don't ever kill xenstored

Don't kill xenstored as part of the usual service shutdown process to prevent hangs on shutdown where the kernel tries to unplug a VIF after xenstored has exited.

In an ideal case with all guests cooperating, xendomains will have shut down all guests before xenstored is killed.

However in the uncooperative case, malicious or crashed guests may still be running after xendomains has exited and this should not block the shutdown/reboot of dom0.

Xenstored has no state to sync to disk, and never used to be killed in the sysvinit case; observe the warning in xencommons. Our testing has shown regressions caused by the change in behaviour between sysvinit and systemd when it comes to killing xenstored.

---
KillMode=none is definitely available in at least systemd v208.

Changed in v2: Added justification of change.

 tools/hotplug/Linux/systemd/xenstored.service.in | 1 +
 1 file changed, 1 insertion(+)
tools/hotplug/Linux/systemd/xenstored.service.in +1 -0
index 0f0ac58..a5f836b 100644
@@ -8,6 +8,7 @@ ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=notify
+KillMode=none
 Environment=XENSTORED_ARGS=
 Environment=XENSTORED=@XENSTORED@
 EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
Signature · 1 line
2.1.0
Acked-by on v2 1/1
#1 lore raw
Quoted 11 lines · Ross Lagerwall

Don't kill xenstored as part of the usual service shutdown process to prevent hangs on shutdown where the kernel tries to unplug a VIF after xenstored has exited.

In an ideal case with all guests cooperating, xendomains will have shut down all guests before xenstored is killed.

However in the uncooperative case, malicious or crashed guests may still be running after xendomains has exited and this should not block the shutdown/reboot of dom0.

Quoted 6 lines

Xenstored has no state to sync to disk, and never used to be killed in the sysvinit case; observe the warning in xencommons. Our testing has shown regressions caused by the change in behaviour between sysvinit and systemd when it comes to killing xenstored.

Quoted 22 lines

---
KillMode=none is definitely available in at least systemd v208.

Changed in v2: Added justification of change.

 tools/hotplug/Linux/systemd/xenstored.service.in | 1 +
 1 file changed, 1 insertion(+)
tools/hotplug/Linux/systemd/xenstored.service.in +1 -0
index 0f0ac58..a5f836b 100644
@@ -8,6 +8,7 @@ ConditionPathExists=/proc/xen/capabilities
 
 [Service]
 Type=notify
+KillMode=none
 Environment=XENSTORED_ARGS=
 Environment=XENSTORED=@XENSTORED@
 EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
Signature · 1 line
2.1.0
#2 lore raw
Quoted 12 lines · Wei Liu
Quoted 11 lines · Ross Lagerwall

Don't kill xenstored as part of the usual service shutdown process to prevent hangs on shutdown where the kernel tries to unplug a VIF after xenstored has exited.

In an ideal case with all guests cooperating, xendomains will have shut down all guests before xenstored is killed.

However in the uncooperative case, malicious or crashed guests may still be running after xendomains has exited and this should not block the shutdown/reboot of dom0.

Quoted 8 lines
Quoted 6 lines

Xenstored has no state to sync to disk, and never used to be killed in the sysvinit case; observe the warning in xencommons. Our testing has shown regressions caused by the change in behaviour between sysvinit and systemd when it comes to killing xenstored.

Thanks. I added "systemd: " to the subject and applied.

#3 lore raw
In reply to Wei Liu
Quoted 12 lines · Wei Liu
Quoted 11 lines · Ross Lagerwall

Don't kill xenstored as part of the usual service shutdown process to prevent hangs on shutdown where the kernel tries to unplug a VIF after xenstored has exited.

In an ideal case with all guests cooperating, xendomains will have shut down all guests before xenstored is killed.

However in the uncooperative case, malicious or crashed guests may still be running after xendomains has exited and this should not block the shutdown/reboot of dom0.

Quoted 8 lines
Quoted 6 lines

Xenstored has no state to sync to disk, and never used to be killed in the sysvinit case; observe the warning in xencommons. Our testing has shown regressions caused by the change in behaviour between sysvinit and systemd when it comes to killing xenstored.

Thanks. I added "systemd: " to the subject and applied.