1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 typedef enum EmergencyAction
{
6 EMERGENCY_ACTION_REBOOT
,
7 EMERGENCY_ACTION_REBOOT_FORCE
,
8 EMERGENCY_ACTION_REBOOT_IMMEDIATE
,
9 EMERGENCY_ACTION_POWEROFF
,
10 EMERGENCY_ACTION_POWEROFF_FORCE
,
11 EMERGENCY_ACTION_POWEROFF_IMMEDIATE
,
12 EMERGENCY_ACTION_EXIT
,
13 _EMERGENCY_ACTION_FIRST_USER_ACTION
= EMERGENCY_ACTION_EXIT
,
14 EMERGENCY_ACTION_EXIT_FORCE
,
15 _EMERGENCY_ACTION_MAX
,
16 _EMERGENCY_ACTION_INVALID
= -1
19 typedef enum EmergencyActionFlags
{
20 EMERGENCY_ACTION_IS_WATCHDOG
= 1 << 0,
21 EMERGENCY_ACTION_WARN
= 1 << 1,
22 } EmergencyActionFlags
;
27 int emergency_action(Manager
*m
,
28 EmergencyAction action
, EmergencyActionFlags options
,
29 const char *reboot_arg
, const char *reason
);
31 const char* emergency_action_to_string(EmergencyAction i
) _const_
;
32 EmergencyAction
emergency_action_from_string(const char *s
) _pure_
;
34 int parse_emergency_action(const char *value
, bool system
, EmergencyAction
*ret
);