1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC)
5 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
6 #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
7 
8 #define DEFAULT_START_LIMIT_INTERVAL (10*USEC_PER_SEC)
9 #define DEFAULT_START_LIMIT_BURST 5
10 
11 /* The default time after which exit-on-idle services exit. This
12  * should be kept lower than the watchdog timeout, because otherwise
13  * the watchdog pings will keep the loop busy. */
14 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
15 
16 /* The default value for the net.unix.max_dgram_qlen sysctl */
17 #define DEFAULT_UNIX_MAX_DGRAM_QLEN 512UL
18 
19 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
20 #define SIGNALS_IGNORE SIGPIPE
21 
22 #define NOTIFY_FD_MAX 768
23 #define NOTIFY_BUFFER_MAX PIPE_BUF
24 
25 #if HAVE_SPLIT_USR
26 #  define _CONF_PATHS_SPLIT_USR_NULSTR(n) "/lib/" n "\0"
27 #  define _CONF_PATHS_SPLIT_USR(n) , "/lib/" n
28 #else
29 #  define _CONF_PATHS_SPLIT_USR_NULSTR(n)
30 #  define _CONF_PATHS_SPLIT_USR(n)
31 #endif
32 
33 /* Return a nulstr for a standard cascade of configuration paths,
34  * suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr()
35  * to implement drop-in directories for extending configuration
36  * files. */
37 #define CONF_PATHS_NULSTR(n)                    \
38         "/etc/" n "\0"                          \
39         "/run/" n "\0"                          \
40         "/usr/local/lib/" n "\0"                \
41         "/usr/lib/" n "\0"                      \
42         _CONF_PATHS_SPLIT_USR_NULSTR(n)
43 
44 #define CONF_PATHS_USR(n)                       \
45         "/etc/" n,                              \
46         "/run/" n,                              \
47         "/usr/local/lib/" n,                    \
48         "/usr/lib/" n
49 
50 #define CONF_PATHS(n)                           \
51         CONF_PATHS_USR(n)                       \
52         _CONF_PATHS_SPLIT_USR(n)
53 
54 #define CONF_PATHS_USR_STRV(n)                  \
55         STRV_MAKE(CONF_PATHS_USR(n))
56 
57 #define CONF_PATHS_STRV(n)                      \
58         STRV_MAKE(CONF_PATHS(n))
59 
60 /* The limit for PID 1 itself (which is not inherited to children) */
61 #define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
62 
63 /* Since kernel 5.16 the kernel default limit was raised to 8M. Let's adjust things on old kernels too, and
64  * in containers so that our children inherit that. */
65 #define DEFAULT_RLIMIT_MEMLOCK (1024ULL*1024ULL*8ULL)
66 
67 #define PLYMOUTH_SOCKET {                                       \
68                 .un.sun_family = AF_UNIX,                       \
69                 .un.sun_path = "\0/org/freedesktop/plymouthd",  \
70         }
71 
72 /* Path where PID1 listens for varlink subscriptions from systemd-oomd to notify of changes in ManagedOOM settings. */
73 #define VARLINK_ADDR_PATH_MANAGED_OOM_SYSTEM "/run/systemd/io.system.ManagedOOM"
74 /* Path where systemd-oomd listens for varlink connections from user managers to report changes in ManagedOOM settings. */
75 #define VARLINK_ADDR_PATH_MANAGED_OOM_USER "/run/systemd/oom/io.system.ManagedOOM"
76 
77 #define KERNEL_BASELINE_VERSION "4.15"
78