]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/emergency-action.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / core / emergency-action.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
2928b0a8
LP
2#pragma once
3
87a47f99
LN
4typedef 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,
54fcb619
ZJS
12 EMERGENCY_ACTION_EXIT,
13 _EMERGENCY_ACTION_FIRST_USER_ACTION = EMERGENCY_ACTION_EXIT,
14 EMERGENCY_ACTION_EXIT_FORCE,
87a47f99
LN
15 _EMERGENCY_ACTION_MAX,
16 _EMERGENCY_ACTION_INVALID = -1
17} EmergencyAction;
2928b0a8 18
1710d4be
ZJS
19typedef enum EmergencyActionFlags {
20 EMERGENCY_ACTION_IS_WATCHDOG = 1 << 0,
c7adcb1a 21 EMERGENCY_ACTION_WARN = 1 << 1,
1710d4be
ZJS
22} EmergencyActionFlags;
23
2928b0a8
LP
24#include "macro.h"
25#include "manager.h"
26
1710d4be
ZJS
27int emergency_action(Manager *m,
28 EmergencyAction action, EmergencyActionFlags options,
7af67e9a 29 const char *reboot_arg, int exit_status, const char *reason);
2928b0a8 30
87a47f99
LN
31const char* emergency_action_to_string(EmergencyAction i) _const_;
32EmergencyAction emergency_action_from_string(const char *s) _pure_;
54fcb619
ZJS
33
34int parse_emergency_action(const char *value, bool system, EmergencyAction *ret);