3
0
Fork 0
forked from mirrors/nixpkgs

Set the kernel.poweroff_cmd sysctl

This allows Xen (and EC2) to power off an instance properly.  We had
this before (see aeb89fc753), but it got
lost in the systemd migration.
This commit is contained in:
Eelco Dolstra 2013-03-27 17:20:41 +01:00
parent f3bea050f8
commit c039e286b9
2 changed files with 7 additions and 0 deletions

View file

@ -22,4 +22,6 @@ with pkgs.lib;
'';
};
boot.kernel.sysctl."kernel.poweroff_cmd" = "${config.systemd.package}/sbin/poweroff";
}

View file

@ -33,6 +33,11 @@
$machine->waitForUnit("root-swapfile.swap");
$machine->succeed("ls -l /root/swapfile | grep 134217728");
};
# Test whether kernel.poweroff_cmd is set.
subtest "poweroff_cmd", sub {
$machine->succeed("[ -x \"\$(cat /proc/sys/kernel/poweroff_cmd)\" ]")
};
'';
}