]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/kill.h
Merge pull request #11083 from poettering/nspawn-settings-fixes
[thirdparty/systemd.git] / src / core / kill.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 typedef struct KillContext KillContext;
5
6 #include <stdbool.h>
7 #include <stdio.h>
8
9 #include "macro.h"
10
11 typedef enum KillMode {
12 /* The kill mode is a property of a unit. */
13 KILL_CONTROL_GROUP = 0,
14 KILL_PROCESS,
15 KILL_MIXED,
16 KILL_NONE,
17 _KILL_MODE_MAX,
18 _KILL_MODE_INVALID = -1
19 } KillMode;
20
21 struct KillContext {
22 KillMode kill_mode;
23 int kill_signal;
24 int final_kill_signal;
25 bool send_sigkill;
26 bool send_sighup;
27 int watchdog_signal;
28 };
29
30 typedef enum KillWho {
31 /* Kill who is a property of an operation */
32 KILL_MAIN,
33 KILL_CONTROL,
34 KILL_ALL,
35 KILL_MAIN_FAIL,
36 KILL_CONTROL_FAIL,
37 KILL_ALL_FAIL,
38 _KILL_WHO_MAX,
39 _KILL_WHO_INVALID = -1
40 } KillWho;
41
42 void kill_context_init(KillContext *c);
43 void kill_context_dump(KillContext *c, FILE *f, const char *prefix);
44
45 const char *kill_mode_to_string(KillMode k) _const_;
46 KillMode kill_mode_from_string(const char *s) _pure_;
47
48 const char *kill_who_to_string(KillWho k) _const_;
49 KillWho kill_who_from_string(const char *s) _pure_;