Convert "maintenance-shell"

svn path=/nixos/branches/fix-style/; revision=14405
This commit is contained in:
Marc Weber 2009-03-06 12:27:42 +00:00
parent 4a01e5afc8
commit f76096bdf9
3 changed files with 22 additions and 21 deletions

View File

@ -425,6 +425,7 @@ in
(import ../upstart-jobs/swap.nix) (import ../upstart-jobs/swap.nix)
(import ../upstart-jobs/network-interfaces.nix) (import ../upstart-jobs/network-interfaces.nix)
(import ../upstart-jobs/nscd.nix) # Name service cache daemon. (import ../upstart-jobs/nscd.nix) # Name service cache daemon.
(import ../upstart-jobs/maintenance-shell.nix) # Handles the maintenance/stalled event (single-user shell).
# security # security
(import ../system/sudo.nix) (import ../system/sudo.nix)

View File

@ -71,11 +71,6 @@ let
jobs = map makeJob jobs = map makeJob
([ ([
# Handles the maintenance/stalled event (single-user shell).
(import ../upstart-jobs/maintenance-shell.nix {
inherit (pkgs) bash;
})
# Ctrl-alt-delete action. # Ctrl-alt-delete action.
(import ../upstart-jobs/ctrl-alt-delete.nix) (import ../upstart-jobs/ctrl-alt-delete.nix)

View File

@ -1,19 +1,24 @@
{bash}: {pkgs, config, ...}:
###### implementation
{ {
name = "maintenance-shell"; services = {
extraJobs = [{
job = " name = "maintenance-shell";
start on maintenance
start on stalled job = ''
start on maintenance
script start on stalled
exec < /dev/tty1 > /dev/tty1 2>&1
echo \"\" script
echo \"<<< MAINTENANCE SHELL >>>\" exec < /dev/tty1 > /dev/tty1 2>&1
echo \"\" echo \"\"
exec ${bash}/bin/sh echo \"<<< MAINTENANCE SHELL >>>\"
end script echo \"\"
"; exec ${pkgs.bash}/bin/sh
end script
'';
}];
};
} }