Convert "maintenance-shell"
svn path=/nixos/branches/fix-style/; revision=14405
This commit is contained in:
parent
4a01e5afc8
commit
f76096bdf9
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
'';
|
||||||
|
}];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue