]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/emergency-action.h
pkgconfig: define variables relative to ${prefix}/${rootprefix}/${sysconfdir}
[thirdparty/systemd.git] / src / core / emergency-action.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 typedef enum EmergencyAction {
5 EMERGENCY_ACTION_NONE,
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
17 } EmergencyAction;
18
19 typedef enum EmergencyActionFlags {
20 EMERGENCY_ACTION_IS_WATCHDOG = 1 << 0,
21 EMERGENCY_ACTION_WARN = 1 << 1,
22 } EmergencyActionFlags;
23
24 #include "macro.h"
25 #include "manager.h"
26
27 int emergency_action(Manager *m,
28 EmergencyAction action, EmergencyActionFlags options,
29 const char *reboot_arg, const char *reason);
30
31 const char* emergency_action_to_string(EmergencyAction i) _const_;
32 EmergencyAction emergency_action_from_string(const char *s) _pure_;
33
34 int parse_emergency_action(const char *value, bool system, EmergencyAction *ret);