diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index e7288e81ad..e19e8e1c40 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -1083,9 +1083,8 @@
, , ,
, , ,
and . In system mode, all options are
- allowed. In user mode, only , ,
- , and are
- allowed. Both options default to .
+ allowed. In user mode, only , , and
+ are allowed. Both options default to .
If is set, no action will be triggered. causes a
reboot following the normal shutdown procedure (i.e. equivalent to systemctl
diff --git a/src/core/emergency-action.c b/src/core/emergency-action.c
index 3083320966..dbda6e5457 100644
--- a/src/core/emergency-action.c
+++ b/src/core/emergency-action.c
@@ -14,14 +14,14 @@
static const char* const emergency_action_table[_EMERGENCY_ACTION_MAX] = {
[EMERGENCY_ACTION_NONE] = "none",
+ [EMERGENCY_ACTION_EXIT] = "exit",
+ [EMERGENCY_ACTION_EXIT_FORCE] = "exit-force",
[EMERGENCY_ACTION_REBOOT] = "reboot",
[EMERGENCY_ACTION_REBOOT_FORCE] = "reboot-force",
[EMERGENCY_ACTION_REBOOT_IMMEDIATE] = "reboot-immediate",
[EMERGENCY_ACTION_POWEROFF] = "poweroff",
[EMERGENCY_ACTION_POWEROFF_FORCE] = "poweroff-force",
[EMERGENCY_ACTION_POWEROFF_IMMEDIATE] = "poweroff-immediate",
- [EMERGENCY_ACTION_EXIT] = "exit",
- [EMERGENCY_ACTION_EXIT_FORCE] = "exit-force",
[EMERGENCY_ACTION_SOFT_REBOOT] = "soft-reboot",
[EMERGENCY_ACTION_SOFT_REBOOT_FORCE] = "soft-reboot-force",
[EMERGENCY_ACTION_KEXEC] = "kexec",
@@ -216,7 +216,7 @@ int parse_emergency_action(
if (x < 0)
return -EINVAL;
- if (runtime_scope != RUNTIME_SCOPE_SYSTEM && x != EMERGENCY_ACTION_NONE && x < _EMERGENCY_ACTION_FIRST_USER_ACTION)
+ if (runtime_scope != RUNTIME_SCOPE_SYSTEM && x > _EMERGENCY_ACTION_LAST_USER_ACTION)
return -EOPNOTSUPP;
*ret = x;
diff --git a/src/core/emergency-action.h b/src/core/emergency-action.h
index 33e0ec6ffc..6bec47511d 100644
--- a/src/core/emergency-action.h
+++ b/src/core/emergency-action.h
@@ -7,15 +7,15 @@
typedef enum EmergencyAction {
EMERGENCY_ACTION_NONE,
+ EMERGENCY_ACTION_EXIT,
+ EMERGENCY_ACTION_EXIT_FORCE,
+ _EMERGENCY_ACTION_LAST_USER_ACTION = EMERGENCY_ACTION_EXIT_FORCE,
EMERGENCY_ACTION_REBOOT,
EMERGENCY_ACTION_REBOOT_FORCE,
EMERGENCY_ACTION_REBOOT_IMMEDIATE,
EMERGENCY_ACTION_POWEROFF,
EMERGENCY_ACTION_POWEROFF_FORCE,
EMERGENCY_ACTION_POWEROFF_IMMEDIATE,
- EMERGENCY_ACTION_EXIT,
- _EMERGENCY_ACTION_FIRST_USER_ACTION = EMERGENCY_ACTION_EXIT,
- EMERGENCY_ACTION_EXIT_FORCE,
EMERGENCY_ACTION_SOFT_REBOOT,
EMERGENCY_ACTION_SOFT_REBOOT_FORCE,
EMERGENCY_ACTION_KEXEC,