units: allow and use SuccessAction=exit-force in system systemd-exit.service
C.f. 287419c119: 'systemctl exit 42' can be
used to set an exit value and pulls in exit.target, which pulls in systemd-exit.service,
which calls org.fdo.Manager.Exit, which calls method_exit(), which sets the objective
to MANAGER_EXIT. Allow the same to happen through SuccessAction=exit.
v2: update for 'exit' and 'exit-force'
This commit is contained in:
@@ -36,10 +36,10 @@ static void test_parse_emergency_action(void) {
|
||||
assert_se(parse_emergency_action("poweroff-force", true, &x) == 0);
|
||||
assert_se(x == EMERGENCY_ACTION_POWEROFF_FORCE);
|
||||
assert_se(parse_emergency_action("poweroff-immediate", true, &x) == 0);
|
||||
assert_se(parse_emergency_action("exit", true, &x) == -EOPNOTSUPP);
|
||||
assert_se(parse_emergency_action("exit-force", true, &x) == -EOPNOTSUPP);
|
||||
assert_se(parse_emergency_action("exit", true, &x) == 0);
|
||||
assert_se(parse_emergency_action("exit-force", true, &x) == 0);
|
||||
assert_se(parse_emergency_action("exit-forcee", true, &x) == -EINVAL);
|
||||
assert_se(x == EMERGENCY_ACTION_POWEROFF_IMMEDIATE);
|
||||
assert_se(x == EMERGENCY_ACTION_EXIT_FORCE);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
Reference in New Issue
Block a user