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/network-interfaces.nix)
(import ../upstart-jobs/nscd.nix) # Name service cache daemon.
(import ../upstart-jobs/maintenance-shell.nix) # Handles the maintenance/stalled event (single-user shell).
# security
(import ../system/sudo.nix)

View File

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

View File

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