Don't start emergency mode on EC2 instances
EC2 instances don't have a console, so it's pointless to start emergency mode if a mount fails. (This happened to me with an encrypted filesystem where the key wasn't sent on time using "charon send-keys".) Better to cross fingers and continue booting.
This commit is contained in:
parent
1aaa726e75
commit
f2c2b7ace9
@ -17,4 +17,7 @@ with pkgs.lib;
|
||||
|
||||
# Since we can't manually respond to a panic, just reboot.
|
||||
boot.kernelParams = [ "panic=1" "boot.panic_on_fail" ];
|
||||
|
||||
# Don't allow emergency mode, because we don't have a console.
|
||||
systemd.enableEmergencyMode = false;
|
||||
}
|
||||
|
@ -36,11 +36,9 @@ let
|
||||
#"cryptsetup.target"
|
||||
"sigpwr.target"
|
||||
|
||||
# Rescue/emergency.
|
||||
# Rescue mode.
|
||||
"rescue.target"
|
||||
"rescue.service"
|
||||
"emergency.target"
|
||||
"emergency.service"
|
||||
|
||||
# Udev.
|
||||
"systemd-udevd-control.socket"
|
||||
@ -133,6 +131,11 @@ let
|
||||
"systemd-ask-password-console.service"
|
||||
"systemd-ask-password-wall.path"
|
||||
"systemd-ask-password-wall.service"
|
||||
]
|
||||
|
||||
++ optionals cfg.enableEmergencyMode [
|
||||
"emergency.target"
|
||||
"emergency.service"
|
||||
];
|
||||
|
||||
upstreamWants =
|
||||
@ -456,6 +459,19 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.enableEmergencyMode = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether to enable emergency mode, which is an
|
||||
<command>sulogin</command> shell started on the console if
|
||||
mounting a filesystem fails. Since some machines (like EC2
|
||||
instances) have no console of any kind, emergency mode doesn't
|
||||
make sense, and it's better to continue with the boot insofar
|
||||
as possible.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user