From b9e74c399458a1146894ce371e7d85c60658110c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 23 Sep 2015 23:13:06 +0200 Subject: core: rework crash handling This introduces a new systemd.crash_reboot=1 kernel command line option that triggers a reboot after crashing. This also cleans up crash VT handling. Specifically, it cleans up the configuration setting, to be between 1..63 or a boolean. This is to replace the previous logic where "-1" meant disabled. We continue to accept that setting, but only document the boolean syntax instead. This also brings the documentation of the default settings in sync with what actually happens. The CrashChVT= configuration file setting is renamed to CrashChangeVT=, following our usual logic of not abbreviating unnecessarily. The old setting stays support for compat reasons. Fixes #1300 --- man/kernel-command-line.xml | 3 +- man/systemd-system.conf.xml | 3 +- man/systemd.xml | 104 ++++++++++++++++++++++++++++++++------------ 3 files changed, 80 insertions(+), 30 deletions(-) (limited to 'man') diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml index eb73727027..2f81746b5e 100644 --- a/man/kernel-command-line.xml +++ b/man/kernel-command-line.xml @@ -79,8 +79,9 @@ systemd.unit= rd.systemd.unit= systemd.dump_core= - systemd.crash_shell= systemd.crash_chvt= + systemd.crash_shell= + systemd.crash_reboot= systemd.confirm_spawn= systemd.show_status= systemd.log_target= diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index a4ba0959ea..56db9ff17e 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -90,9 +90,10 @@ LogColor= LogLocation= DumpCore=yes + CrashChangeVT=no CrashShell=no + CrashReboot=no ShowStatus=yes - CrashChVT=1 DefaultStandardOutput=journal DefaultStandardError=inherit diff --git a/man/systemd.xml b/man/systemd.xml index 479f55de76..9e927c3204 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -1,4 +1,4 @@ - + @@ -131,17 +131,48 @@ - Dump core on crash. This switch has no effect - when run as user instance. + Enable core dumping on crash. This switch has + no effect when running as user instance. This setting may also + be enabled during boot on the kernel command line via the + systemd.dump_core= option, see + below. + + + VT + + Switch to a specific virtual console (VT) on + crash. Takes a positive integer in the range 1..63, or a + boolean argument. If an integer is passed, selects which VT to + switch to. If yes, the VT kernel messages + are written to is selected. If no, no VT + switch is attempted. This switch has no effect when running as + user instance. This setting may also be enabled during boot, + on the kernel command line via the + systemd.crash_vt= option, see + below. + + - Run shell on - crash. This switch has no effect when - run as user - instance. + Run a shell on crash. This switch has no + effect when running as user instance. This setting may also be + enabled during boot, on the kernel command line via the + systemd.crash_shell= option, see + below. + + + + + Automatically reboot the system on crash. This + switch has no effect when running as user instance. This + setting may also be enabled during boot, on the kernel command + line via the systemd.crash_reboot= option, + see below. + + @@ -854,50 +885,67 @@ systemd.dump_core= Takes a boolean argument. If - , systemd dumps core when it crashes. - Otherwise, no core dump is created. Defaults to - . + , the systemd manager (PID 1) dumps core + when it crashes. Otherwise, no core dump is created. Defaults + to . + + + + systemd.crash_chvt= + + Takes a positive integer, or a boolean + argument. If a positive integer (in the range 1..63) is + specified the system manager (PID 1) will activate the specified + virtual terminal (VT) when it crashes. Defaults to + no, meaning that no such switch is + attempted. If set to yes the VT the + kernel messages are written to is selected. systemd.crash_shell= Takes a boolean argument. If - , systemd spawns a shell when it crashes. - Otherwise, no shell is spawned. Defaults to - , for security reasons, as the shell is - not protected by any password + , the system manager (PID 1) spawns a + shell when it crashes, after a 10s delay. Otherwise, no shell + is spawned. Defaults to , for security + reasons, as the shell is not protected by password authentication. - systemd.crash_chvt= + systemd.crash_reboot= - Takes an integer argument. If positive systemd - activates the specified virtual terminal when it crashes. - Defaults to -1. + Takes a boolean argument. If + , the system manager (PID 1) will reboot + the machine automatically when it crashes, after a 10s delay. + Otherwise, the system will hang indefinitely. Defaults to + , in order to avoid a reboot loop. If + combined with systemd.crash_shell=, it is + first attempted to invoke a shell, and if this is not + successful the system is rebooted. systemd.confirm_spawn= Takes a boolean argument. If - , asks for confirmation when spawning - processes. Defaults to - . + , the system manager (PID 1) asks for + confirmation when spawning processes. Defaults to + . systemd.show_status= Takes a boolean argument or the constant - auto. If , shows - terse service status updates on the console during bootup. - auto behaves like - until a service fails or there is a significant delay in boot. - Defaults to , unless - is passed as kernel command line option - in which case it defaults to + auto. If , the + systemd manager (PID 1) shows terse service status updates on + the console during bootup. auto behaves + like until a service fails or there is + a significant delay in boot. Defaults to + , unless is passed + as kernel command line option in which case it defaults to auto. -- cgit v1.2.3-54-g00ecf