chiark / gitweb /
tests: clarify test_path_startswith return value (#4508)
[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 #ifndef SYSTEMD_CGROUP_CONTROLLER
37 #  define SYSTEMD_CGROUP_CONTROLLER "name=elogind"
38 #endif
39
40 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
41 #define SIGNALS_IGNORE SIGPIPE
42
43 #ifdef HAVE_SPLIT_USR
44 #define KBD_KEYMAP_DIRS                         \
45         "/usr/share/keymaps/\0"                 \
46         "/usr/share/kbd/keymaps/\0"             \
47         "/usr/lib/kbd/keymaps/\0"               \
48         "/lib/kbd/keymaps/\0"
49 #else
50 #define KBD_KEYMAP_DIRS                         \
51         "/usr/share/keymaps/\0"                 \
52         "/usr/share/kbd/keymaps/\0"             \
53         "/usr/lib/kbd/keymaps/\0"
54 #endif
55
56 #define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
57 #define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
58 #define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
59 #define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
60 #define KERNEL_USER_BUS_ADDRESS_FMT "kernel:path=/sys/fs/kdbus/"UID_FMT"-user/bus"
61
62 #define PLYMOUTH_SOCKET {                                       \
63                 .un.sun_family = AF_UNIX,                       \
64                 .un.sun_path = "\0/org/freedesktop/plymouthd",  \
65         }
66
67 #ifndef TTY_GID
68 #define TTY_GID 5
69 #endif
70
71 #define NOTIFY_FD_MAX 768
72 #define NOTIFY_BUFFER_MAX PIPE_BUF
73
74 #ifdef HAVE_SPLIT_USR
75 #define _CONF_PATHS_SPLIT_USR(n) "/lib/" n "\0"
76 #else
77 #define _CONF_PATHS_SPLIT_USR(n)
78 #endif
79
80 /* Return a nulstr for a standard cascade of configuration paths,
81  * suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr()
82  * to implement drop-in directories for extending configuration
83  * files. */
84 #define CONF_PATHS_NULSTR(n) \
85         "/etc/" n "\0" \
86         "/run/" n "\0" \
87         "/usr/local/lib/" n "\0" \
88         "/usr/lib/" n "\0" \
89         _CONF_PATHS_SPLIT_USR(n)