From f76096bdf9cce5b5104890da391623f0559a48e7 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Fri, 6 Mar 2009 12:27:42 +0000 Subject: [PATCH] Convert "maintenance-shell" svn path=/nixos/branches/fix-style/; revision=14405 --- system/options.nix | 1 + upstart-jobs/default.nix | 5 ---- upstart-jobs/maintenance-shell.nix | 37 +++++++++++++++++------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/system/options.nix b/system/options.nix index 5e0c6add507d..df77eeb1a346 100644 --- a/system/options.nix +++ b/system/options.nix @@ -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) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index d7b6317b91b4..9aaa3e38f821 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -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) diff --git a/upstart-jobs/maintenance-shell.nix b/upstart-jobs/maintenance-shell.nix index 9e2acdaa0f5f..8481f4283f50 100644 --- a/upstart-jobs/maintenance-shell.nix +++ b/upstart-jobs/maintenance-shell.nix @@ -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 + ''; + }]; + }; }