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