Debian Codegraph @

src/basic/constants.h

raw
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include "time-util.h"
5
6 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
7
8 /* Many different things, but also system unit start/stop */
9 #define DEFAULT_TIMEOUT_USEC (DEFAULT_TIMEOUT_SEC*USEC_PER_SEC)
10 /* User unit start/stop */
11 #define DEFAULT_USER_TIMEOUT_USEC (DEFAULT_USER_TIMEOUT_SEC*USEC_PER_SEC)
12 /* Timeout for user confirmation on the console */
13 #define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
14
15 /* We use an extra-long timeout for the reload. This is because a reload or reexec means generators are rerun
16 * which are timed out after DEFAULT_TIMEOUT_USEC. Let's use twice that time here, so that the generators can
17 * have their timeout, and for everything else there's the same time budget in place. */
18 #define DAEMON_RELOAD_TIMEOUT_SEC (DEFAULT_TIMEOUT_USEC * 2)
19
20 #define DEFAULT_START_LIMIT_INTERVAL (10*USEC_PER_SEC)
21 #define DEFAULT_START_LIMIT_BURST 5
22
23 /* The default time after which exit-on-idle services exit. This
24 * should be kept lower than the watchdog timeout, because otherwise
25 * the watchdog pings will keep the loop busy. */
26 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
27
28 /* The default value for the net.unix.max_dgram_qlen sysctl */
29 #define DEFAULT_UNIX_MAX_DGRAM_QLEN 512
30
31 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
32 #define SIGNALS_IGNORE SIGPIPE
33
34 #define NOTIFY_FD_MAX 768
35 #define NOTIFY_BUFFER_MAX PIPE_BUF
36
37 /* Return a nulstr for a standard cascade of configuration paths, suitable to pass to
38 * conf_files_list_nulstr() to implement drop-in directories for extending configuration files. */
39 #define CONF_PATHS_NULSTR(n) \
40 "/etc/" n "\0" \
41 "/run/" n "\0" \
42 "/usr/local/lib/" n "\0" \
43 "/usr/lib/" n "\0"
44
45 #define CONF_PATHS(n) \
46 "/etc/" n, \
47 "/run/" n, \
48 "/usr/local/lib/" n, \
49 "/usr/lib/" n
50
51 #define CONF_PATHS_STRV(n) \
52 STRV_MAKE(CONF_PATHS(n))
53
54 /* The limit for PID 1 itself (which is not inherited to children) */
55 #define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
56
57 /* Since kernel 5.16 the kernel default limit was raised to 8M. Let's adjust things on old kernels too, and
58 * in containers so that our children inherit that. */
59 #define DEFAULT_RLIMIT_MEMLOCK (1024ULL*1024ULL*8ULL)
60
61 /* Path where PID1 listens for varlink subscriptions from systemd-oomd to notify of changes in ManagedOOM settings. */
62 #define VARLINK_PATH_MANAGED_OOM_SYSTEM "/run/systemd/io.systemd.ManagedOOM"
63 /* Path where systemd-oomd listens for varlink connections from user managers to report changes in ManagedOOM settings. */
64 #define VARLINK_PATH_MANAGED_OOM_USER "/run/systemd/oom/io.systemd.ManagedOOM"
65 /* Path where systemd-machined listens to userdb varlink queries */
66 #define VARLINK_PATH_MACHINED_USERDB "/run/systemd/userdb/io.systemd.Machine"
67 /* Path where systemd-machined listens to resolve.hook varlink queries */
68 #define VARLINK_PATH_MACHINED_RESOLVE_HOOK "/run/systemd/resolve.hook/io.systemd.Machine"
69 /* Path where to connect to send varlink prekill events */
70 #define VARLINK_DIR_OOMD_PREKILL_HOOK "/run/systemd/oomd.prekill.hook/"
71
72 /* Recommended baseline - see README for details */
73 #define KERNEL_BASELINE_VERSION "5.14"