From aeb89fc753c6f95c9d143e6f5346f92e4a02fa67 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 5 Oct 2010 17:58:58 +0000 Subject: [PATCH] * Set /proc/sys/kernel/poweroff_cmd to Upstart's poweroff command (rather than /sbin/poweroff). Xen's "xm shutdown" needs this to enable the host to cleanly shutdown the guest. svn path=/nixos/trunk/; revision=24094 --- modules/system/upstart-events/control-alt-delete.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/system/upstart-events/control-alt-delete.nix b/modules/system/upstart-events/control-alt-delete.nix index 5fa2bd87eb9..f0f146160e5 100644 --- a/modules/system/upstart-events/control-alt-delete.nix +++ b/modules/system/upstart-events/control-alt-delete.nix @@ -15,4 +15,12 @@ shutdown -r now 'Ctrl-Alt-Delete pressed' ''; }; + + system.activationScripts.poweroff = + '' + # Allow the kernel to find the poweroff command. This is used + # (for instance) by Xen's "xm shutdown" command to signal a + # guest to shut down cleanly. + echo ${config.system.build.upstart}/sbin/poweroff > /proc/sys/kernel/poweroff_cmd + ''; }