Go to the documentation of this file. 1 #ifndef __CONFIGURATION_H
2 #define __CONFIGURATION_H
10 #define MAXRULES (1<<8)
13 #define MAXARGUMENTS (1<<8)
16 #define MAXNODES ((1<<8)-1)
18 #define MAXSIGNALNUM (1<<9)
21 #define USER_LEN (1<<8)
22 #define GROUP_LEN USER_LEN
25 #define SOCKET_BACKLOG 2
28 #define SOCKET_MAX_CLSYNC 8
31 #define SOCKET_MAX_LIBCLSYNC (1<<16)
34 #define MAXCHILDREN (1<<8)
36 #define MAXMOUNTPOINTS (1<<8)
37 #define MAXPERMITTEDHOOKFILES (1<<8)
40 # ifdef __CLSYNC_COMMON_H
41 # ifndef DEFAULT_NOTIFYENGINE
43 # ifdef INOTIFY_SUPPORT
44 # define DEFAULT_NOTIFYENGINE NE_INOTIFY
48 # ifndef DEFAULT_NOTIFYENGINE
49 # if __FreeBSD__ | __FreeBSD_kernel__
50 # ifdef KQUEUE_SUPPORT
51 # define DEFAULT_NOTIFYENGINE NE_KQUEUE
55 # ifndef DEFAULT_NOTIFYENGINE
56 # ifdef INOTIFY_SUPPORT
57 # define DEFAULT_NOTIFYENGINE NE_INOTIFY
60 # ifndef DEFAULT_NOTIFYENGINE
62 # define DEFAULT_NOTIFYENGINE NE_GIO
65 # ifndef DEFAULT_NOTIFYENGINE
66 # ifdef KQUEUE_SUPPORT
67 # define DEFAULT_NOTIFYENGINE NE_KQUEUE
70 # ifndef DEFAULT_NOTIFYENGINE
72 # define DEFAULT_NOTIFYENGINE NE_BSM
75 # ifndef DEFAULT_NOTIFYENGINE
76 # error No monitor subsystem supported
77 # define DEFAULT_NOTIFYENGINE NE_UNDEFINED
82 #define DEFAULT_RULES_PERM RA_ALL
83 #define DEFAULT_COLLECTDELAY 30
84 #define DEFAULT_SYNCDELAY (DEFAULT_COLLECTDELAY)
85 #define DEFAULT_BFILETHRESHOLD (128 * 1024 * 1024)
86 #define DEFAULT_BFILECOLLECTDELAY 1800
87 #define DEFAULT_LABEL "nolabel"
88 #define DEFAULT_RSYNCINCLUDELINESLIMIT 20000
89 #define DEFAULT_SYNCTIMEOUT (3600 * 24)
90 #define DEFAULT_CLUSTERTIMEOUT 1000
91 #define DEFAULT_CLUSTERIPADDR "227.108.115.121"
92 #define DEFAULT_CLUSTERIPPORT 40079
93 #define DEFAULT_CLUSTERHDLMIN 1
94 #define DEFAULT_CLUSTERHDLMAX 16
95 #define DEFAULT_CLUSTERSDLMAX 32
96 #define DEFAULT_CONFIG_BLOCK "default"
97 #define DEFAULT_RETRIES 1
98 #define DEFAULT_VERBOSE 3
99 #define DEFAULT_DUMPDIR "/tmp/clsync-dump-%label%"
100 #define DEFAULT_DETACH_IPC 1
102 #define FANOTIFY_FLAGS (FAN_CLOEXEC|FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS)
103 #define FANOTIFY_EVFLAGS (O_LARGEFILE|O_RDONLY|O_CLOEXEC)
105 #define FANOTIFY_MARKMASK (FAN_OPEN|FAN_MODIFY|FAN_CLOSE|FAN_ONDIR|FAN_EVENT_ON_CHILD)
107 #define INOTIFY_FLAGS (IN_CLOEXEC)
109 #define INOTIFY_MARKMASK (IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_MOVED_FROM|IN_MOVED_TO|IN_MODIFY|IN_DONT_FOLLOW)
111 #define COUNTER_LIMIT (1<<10)
113 #define SLEEP_SECONDS 1
115 #define KILL_TIMEOUT 60
117 #define ALLOC_PORTION (1<<10)
118 #define CLUSTER_WINDOW_BUFSIZE_PORTION (1<<20)
119 #define CLUSTER_PACKET_MAXSIZE (1<<20)
120 #define CLUSTER_WINDOW_PCKTLIMIT (1<<20)
122 #define CONFIG_PATHS { ".clsync.conf", "/etc/clsync/clsync.conf", "/etc/clsync.conf", "/usr/local/etc/clsync/clsync.conf", "/usr/local/etc/clsync.conf", NULL }
124 #define API_PREFIX "clsyncapi_"
126 #define DUMP_DIRMODE 0750
127 #define DUMP_FILEMODE 0644
129 #define DEFAULT_CP_PATH "cp"
130 #define DEFAULT_RSYNC_PATH "rsync"
133 #define KQUEUE_EVENTLISTSIZE 256
135 #define AUDITPIPE_PATH "/dev/auditpipe"
136 #define AUDIT_CONTROL_PATH "/etc/security/audit_control"
137 #define AUDIT_CONTROL_INITSCRIPT "/etc/rc.d/auditd"
138 #define AUDIT_CONTROL_HEADER "#clsync\n"
139 #define AUDIT_CONTROL_CONTENT "\n\
141 flags:fc,fd,fw,fm,cl\n\
143 naflags:fc,fd,fw,fm,cl\n\
149 #define DTRACE_PATH "dtrace"
151 #define PIVOT_AUTO_DIR "/dev/shm/clsync-rootfs"
152 #define TMPDIR_PATH "/tmp"
153 #define TMPDIR_TEMPLATE "/clsync-XXXXXX"
155 #define SYSLOG_BUFSIZ (1<<16)
156 #define SYSLOG_FLAGS (LOG_PID|LOG_CONS)
157 #define SYSLOG_FACILITY LOG_DAEMON
159 #define CLSYNCSOCK_WINDOW (1<<8)
161 #define DEFAULT_SYNCHANDLER_ARGS_SIMPLE "sync %label% %EVENT-MASK% %INCLUDE-LIST%"
162 #define DEFAULT_SYNCHANDLER_ARGS_DIRECT "%INCLUDE-LIST% %destination-dir%/"
163 #define DEFAULT_SYNCHANDLER_ARGS_SHELL_NR "synclist %label% %INCLUDE-LIST-PATH%"
164 #define DEFAULT_SYNCHANDLER_ARGS_SHELL_R "initialsync %label% %INCLUDE-LIST%"
165 #define DEFAULT_SYNCHANDLER_ARGS_RDIRECT_E "-aH --delete --exclude-from %EXCLUDE-LIST-PATH% --include-from %INCLUDE-LIST-PATH% --exclude=* %watch-dir%/ %destination-dir%/"
166 #define DEFAULT_SYNCHANDLER_ARGS_RDIRECT_I "-aH --delete --include-from %INCLUDE-LIST-PATH% --exclude=* %watch-dir%/ %destination-dir%/"
167 #define DEFAULT_SYNCHANDLER_ARGS_RSHELL_E "rsynclist %label% %INCLUDE-LIST-PATH% %EXCLUDE-LIST-PATH%"
168 #define DEFAULT_SYNCHANDLER_ARGS_RSHELL_I "rsynclist %label% %INCLUDE-LIST-PATH%"
170 #define RSYNC_ARGS_E { \
174 "%EXCLUDE-LIST-PATH%", \
176 "%INCLUDE-LIST-PATH%", \
180 #define RSYNC_ARGS_I { \
184 "%INCLUDE-LIST-PATH%", \
188 #define DEFAULT_PRESERVE_CAPABILITIES ( CAP_TO_MASK(CAP_DAC_READ_SEARCH) | CAP_TO_MASK(CAP_SETUID) | CAP_TO_MASK(CAP_SETGID) | CAP_TO_MASK(CAP_KILL) )
190 #define DEFAULT_USER "nobody"
191 #define DEFAULT_GROUP "nogroup"
192 #define DEFAULT_UID 65534
193 #define DEFAULT_GID 65534
194 #define DEFAULT_CAPS_INHERIT CI_EMPTY
195 #define DEFAULT_PIVOT_MODE (PW_OFF)
197 #define DEVZERO "/dev/zero"
202 #define HL_LOCK_TRIES_INITIAL (1<<13)
205 #define HL_LOCK_TRIES_AUTO
207 #define HL_LOCK_AUTO_INTERVAL 7
209 #define HL_LOCK_AUTO_K 1.1
211 #define HL_LOCK_AUTO_THREADHOLD 0.2
213 #define HL_LOCK_AUTO_DECELERATION 1.1
215 #define HL_LOCK_AUTO_K_FINISH 0.001
217 #define HL_LOCK_AUTO_LIMIT_HIGH (1<<20)
219 #define HL_LOCK_NONPRIV_TRIES (HL_LOCK_AUTO_LIMIT_HIGH << 5)
223 #define CG_DEV_CONSOLE "c 5:1"
224 #define CG_DEV_ZERO "c 1:5"
225 #define CG_DEV_RANDOM "c 1:8"
226 #define CG_DEV_URANDOM "c 1:9"
227 #define CG_DEV_NULL "c 1:3"
229 #define CG_ALLOWED_DEVICES { \
230 CG_DEV_CONSOLE " rw", \
232 CG_DEV_URANDOM " r", \
233 CG_DEV_RANDOM " r", \
238 #define DEFAULT_CG_GROUPNAME "clsync/%PID%"
241 #define OUTPUT_LOCK_TIMEOUT (100*1000*1000)
242 #define WAITPID_TIMED_GRANULARITY (30*1000*1000)
244 #define BSM_QUEUE_LENGTH_MAX (1024*1024)
245 #define GIO_QUEUE_LENGTH_MAX BSM_QUEUE_LENGTH_MAX