chiark / gitweb /
cgroup: rename cg_unified() → cg_unified_controller()
[elogind.git] / src / basic / def.h
1 #pragma once
2
3 /***
4   This file is part of systemd.
5
6   Copyright 2010 Lennart Poettering
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU Lesser General Public License as published by
10   the Free Software Foundation; either version 2.1 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   Lesser General Public License for more details.
17
18   You should have received a copy of the GNU Lesser General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include "util.h"
23
24 #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC)
25 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
26 #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
27
28 #define DEFAULT_START_LIMIT_INTERVAL (10*USEC_PER_SEC)
29 #define DEFAULT_START_LIMIT_BURST 5
30
31 /* The default time after which exit-on-idle services exit. This
32  * should be kept lower than the watchdog timeout, because otherwise
33  * the watchdog pings will keep the loop busy. */
34 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
35
36 /* The default value for the net.unix.max_dgram_qlen sysctl */
37 #define DEFAULT_UNIX_MAX_DGRAM_QLEN 512UL
38
39 #if 0 /// elogind allows foreign cgroup controllers. (Well, needs them, actually)
40 #define SYSTEMD_CGROUP_CONTROLLER_LEGACY "name=systemd"
41 #define SYSTEMD_CGROUP_CONTROLLER_HYBRID "name=unified"
42 #define SYSTEMD_CGROUP_CONTROLLER "_systemd"
43 #else
44 #ifndef SYSTEMD_CGROUP_CONTROLLER_LEGACY
45 #  define SYSTEMD_CGROUP_CONTROLLER_LEGACY "name=elogind"
46 #endif // SYSTEMD_CGROUP_CONTROLLER_LEGACY
47 #ifndef SYSTEMD_CGROUP_CONTROLLER_HYBRID
48 #  define SYSTEMD_CGROUP_CONTROLLER_HYBRID "name=elogind"
49 #endif // SYSTEMD_CGROUP_CONTROLLER_HYBRID
50 #ifndef SYSTEMD_CGROUP_CONTROLLER
51 #  define SYSTEMD_CGROUP_CONTROLLER "_elogind"
52 #endif // SYSTEMD_CGROUP_CONTROLLER
53 #endif // 0
54
55 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
56 #define SIGNALS_IGNORE SIGPIPE
57
58 #ifdef HAVE_SPLIT_USR
59 #define KBD_KEYMAP_DIRS                         \
60         "/usr/share/keymaps/\0"                 \
61         "/usr/share/kbd/keymaps/\0"             \
62         "/usr/lib/kbd/keymaps/\0"               \
63         "/lib/kbd/keymaps/\0"
64 #else
65 #define KBD_KEYMAP_DIRS                         \
66         "/usr/share/keymaps/\0"                 \
67         "/usr/share/kbd/keymaps/\0"             \
68         "/usr/lib/kbd/keymaps/\0"
69 #endif
70
71 #define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
72 #define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
73 #define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
74 #define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
75 #define KERNEL_USER_BUS_ADDRESS_FMT "kernel:path=/sys/fs/kdbus/"UID_FMT"-user/bus"
76
77 #define PLYMOUTH_SOCKET {                                       \
78                 .un.sun_family = AF_UNIX,                       \
79                 .un.sun_path = "\0/org/freedesktop/plymouthd",  \
80         }
81
82 #ifndef TTY_GID
83 #define TTY_GID 5
84 #endif
85
86 #define NOTIFY_FD_MAX 768
87 #define NOTIFY_BUFFER_MAX PIPE_BUF
88
89 #ifdef HAVE_SPLIT_USR
90 #  define _CONF_PATHS_SPLIT_USR(n) "/lib/" n "\0"
91 #else
92 #  define _CONF_PATHS_SPLIT_USR(n)
93 #endif
94
95 /* Return a nulstr for a standard cascade of configuration paths,
96  * suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr()
97  * to implement drop-in directories for extending configuration
98  * files. */
99 #define CONF_PATHS_NULSTR(n)                    \
100         "/etc/" n "\0"                          \
101         "/run/" n "\0"                          \
102         "/usr/local/lib/" n "\0"                \
103         "/usr/lib/" n "\0"                      \
104         _CONF_PATHS_SPLIT_USR(n)