]> granicus.if.org Git - fcron/blob - config.h.in
Fixed occasional 1s slippage. Disable fcrondyn if we don't have gettimeofday() (or...
[fcron] / config.h.in
1 /*
2  * FCRON - periodic command scheduler 
3  *
4  *  Copyright 2000-2014 Thibault Godouet <fcron@free.fr>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  * 
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  *  The GNU General Public License can also be found in the file
21  *  `LICENSE' that comes with the fcron source distribution.
22  */
23
24
25
26 /* *********************************************************** */
27 /* This file is destined to be edited to match your preference */
28 /* *********************************************************** */
29
30
31 /* ****************************************************************** */
32 /* ****************************************************************** */
33 /* beginning of configurable stuff ********************************** */
34
35
36 #define DEFAULT_JOB_PATH "/usr/bin:/bin" /* Default PATH to use when running jobs*/
37
38 #define SENDMAIL_ARGS    "-Ffcron", "-odi"   /* args of mail command */
39
40 /* *** time *** */
41 #define FIRST_SLEEP 20        /* fcron sleep at least this time after startup
42                                * before executing a job, to avoid to run jobs
43                                * during system boot */
44
45 #define LAVG_SLEEP 30         /* the time we sleep when some jobs are in lavg queue */
46
47 #define SAVE            1800  /* save every n seconds */
48
49 /* *** behavior *** */
50 #define SERIAL_ONCE 0 /* can a job be several times in the serial queue at
51                        * the same moment ? */
52
53 #define LAVG_ONCE 1 /* can a job be several times in the lavg queue at
54                      * the same moment ? */
55
56 #define MAXYEAR_SCHEDULE_TIME 10 /* a job can't be scheduled further than
57                              * now + MAXYEAR_SCHEDULE years. This is used
58                              * to prevent infinite loop on corrupted lines */
59
60 /* *** memory *** */
61 #define ENVVAR_INITIAL_SIZE 10 /* initial number of possible env var for a job
62                                 * if more env var are required,
63                                 * fcron will have to realloc() more memory */
64 #define ENVVAR_GROW_SIZE 5 /* this is the number of entries that will be
65                             * added to env_list each time it has to grow
66                             * up */
67
68 #define EXE_INITIAL_SIZE 6 /* initial number of possible running job 
69                             * if more jobs have to be run simultaneously,
70                             * fcron will have to realloc() more memory */
71 #define EXE_GROW_SIZE 5 /* this is the number of entries that will be
72                          * added to exe_array each time it has to grow
73                          * up */
74
75 #define SERIAL_QUEUE_MAX 30 /* if serial queue contains this number of entries,
76                              * the next serial job to be executed will be run
77                              * non-serially each time a serial job is added */
78 #define SERIAL_INITIAL_SIZE 10 /* initial number of possible serial job. If
79                                 * more jobs have to be in queue simultaneously,
80                                 * fcron will have to realloc() more memory */
81 #define SERIAL_GROW_SIZE 10 /* this is the number of entries that will be
82                              * added to serial queue each time it has to grow
83                              * up */
84
85 #define SERIAL_MAX_RUNNING 1 /* fcron will run (by default) no more than this
86                               * number of serial job simultaneously.
87                               * (this may be overridden by fcron option -m */
88
89 #define LAVG_QUEUE_MAX 30 /* if lavg queue contains this number of entries,
90                            * the next lavg job to be executed will be run
91                            * before a new lavg job is added */
92 #define LAVG_INITIAL_SIZE 10 /* initial number of possible lavg job. If
93                               * more jobs have to be in queue simultaneously,
94                               * fcron will have to calloc() more memory */
95 #define LAVG_GROW_SIZE 10 /* this is the number of entries that will be
96                            * added to lavg queue each time it has to grow
97                            * up */
98
99
100 #define MAXENTRIES  1024  /* max lines in non-root fcrontabs */
101
102 #define LINE_LEN    1024     /* max line length in user's config file */
103 #define USER_NAME_LEN 128    /* max length of a user name */
104 #define PATH_LEN 512         /* max length of a file path */
105 #define SOCKET_MSG_LEN 20    /* max length of a socket msg (fcrondyn) */
106
107 /* WARNING : do not set this too low, or add some more tests in print_field, print_line,
108  *           etc ... */
109 #define TERM_LEN 196         /* max nb of char in a term line */
110
111 #define MAX_MSG 175          /* max length of a log message */
112
113 #define WRITE_BUF_LEN 1024   /* length of the buffer used for saving files to disk */
114
115
116 /* *** socket *** */
117 #define MAX_CONNECTION 25    /* max simultaneous connection allowed */
118 #define MAX_IDLE_TIME 600    /* time (in sec) a socket stay idle before being closed */
119 #define MAX_AUTH_TIME 60     /* time (in sec) before a socket is closed if not auth'ed */
120 #define MAX_WAIT_TIME 10     /* time (in sec) we wait for data on a socket */
121 #define MAX_AUTH_FAIL 10     /* auth nobody for some time if more than x fails */
122 #define AUTH_WAIT 60         /* if too many fails, wait this time (seconds) before auth
123                               * another client */
124
125
126 /* *** system dependent *** */
127 #define EXIT_ERR   1         /* code returned by fcron/fcrontab on error */
128 #define EXIT_OK    0         /* code returned  on normal exit */
129
130
131 /* Syslog facility and priorities messages will be logged to (see syslog(3)) */
132
133 /* NOTE : if you change anything here, check if the doc should not
134           be updated
135 */
136 #define SYSLOG_FACILITY LOG_CRON
137 #define EXPLAIN_LEVEL LOG_NOTICE  /* informational messages */
138 #define WARNING_LEVEL LOG_WARNING /* warning messages */
139 #define COMPLAIN_LEVEL LOG_ERR    /* error messages */
140 #define DEBUG_LEVEL LOG_DEBUG     /* only used when DEBUG is defined */
141
142
143 /* end of configurable stuff **************************************** */
144 /* ****************************************************************** */
145 /* ****************************************************************** */
146
147
148 /* ****************************************************************** */
149 /* ****************************************************************** */
150 /* *** options which are set by configure script ******************** */
151
152 /* The following should not be edited manually (use configure options)
153  * If you must do it, BEWARE : some of the following is also defined
154  * in the Makefile, so you must modify config.h AND Makefile in order
155  * to set the same values in the two files. */
156
157 #undef VERSION_QUOTED
158 #undef COPYRIGHT_QUOTED
159
160 #undef CFLAGS
161
162 /* ****************************************************************** */
163 /* *** paths *** */
164
165 #undef PROC
166
167 /* ****************************************************************** */
168 /* *** Compilation options *** */
169
170 #undef USE_SENDMAIL
171 /* 1 if we want to compile and install fcrondyn */
172 #undef FCRONDYN
173 #undef NOLOADAVG
174 /* 1 if you want debug mode */
175 #undef DEBUG
176 /* 1 if you want foreground mode by default */
177 #undef FOREGROUND
178 #undef RUN_NON_PRIVILEGED
179
180 /* Define if we should use sete[ug]id() funcs */
181 #undef USE_SETE_ID
182
183 /* root name and group */
184 #undef ROOTNAME
185 #undef ROOTGROUP
186
187 /* user and group name to run under */
188 #undef USERNAME
189 #undef GROUPNAME
190
191 /* special user for the system fcrontab */
192 #undef SYSFCRONTAB
193
194 /* ****************************************************************** */
195 /* *** Types *** */
196
197 /* Define to empty if the keyword does not work.  */
198 #undef const
199
200 /* Define to `int' if <sys/types.h> doesn't define.  */
201 #undef gid_t
202
203 /* Define to `int' if <sys/types.h> doesn't define.  */
204 #undef pid_t
205
206 /* Define to `unsigned' if <sys/types.h> doesn't define.  */
207 #undef size_t
208
209 /* Define to `int' if <sys/types.h> does not define. */
210 #undef ssize_t
211
212 /* Define to `int' if <sys/types.h> doesn't define.  */
213 #undef uid_t
214
215 /* Define as the return type of signal handlers (int or void).  */
216 #undef RETSIGTYPE
217
218 /* Define if your struct nlist has an n_un member.  */
219 #undef NLIST_NAME_UNION
220
221 /* Define for DGUX with <sys/dg_sys_info.h>.  */
222 #undef DGUX
223
224 /* Define for Encore UMAX.  */
225 #undef UMAX
226
227 /* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
228    instead of <sys/cpustats.h>.  */
229 #undef UMAX4_3
230
231 /* Define on System V Release 4.  */
232 #undef SVR4
233
234 /* ****************************************************************** */
235 /* *** Functions *** */
236
237 /* Define if you have the crypt function.  */
238 #undef HAVE_CRYPT
239
240 /* Define if you have the flock function.  */
241 #undef HAVE_FLOCK
242
243 /* Define if you have the lockf function.  */
244 #undef HAVE_LOCKF
245
246 /* Define if your system has its own `getloadavg' function.  */
247 #undef HAVE_GETLOADAVG
248
249 /* Define if the `getloadavg' function needs to be run setuid or setgid.  */
250 #undef GETLOADAVG_PRIVILEGED
251
252 /* Define if you have the getcwd function.  */
253 #undef HAVE_GETCWD
254
255 /* Define if you have the gethostname function.  */
256 #undef HAVE_GETHOSTNAME
257
258 /* Define if you have the getopt_long function.  */
259 #undef HAVE_GETOPT_LONG
260
261 /* Define if you have the getpeereid function.  */
262 #undef HAVE_GETPEEREID
263
264 /* Define if you have the getpeerucred function.  */
265 #undef HAVE_GETPEERUCRED
266
267 /* Define if you have the getspnam function.  */
268 #undef HAVE_GETSPNAM
269
270 /* Define if you have the gettimeofday function.  */
271 #undef HAVE_GETTIMEOFDAY
272
273 /* Define if you have the kstat* functions.  */
274 #undef HAVE_KSTAT
275
276 /* Define if you have the mkstemp function.  */
277 #undef HAVE_MKSTEMP
278
279 /* Define if you have the mktime function.  */
280 #undef HAVE_MKTIME
281
282 /* Define if you have the putenv function.  */
283 #undef HAVE_PUTENV
284
285 /* Define if (struct sockaddr) has an sa_len field.  */
286 #undef HAVE_SA_LEN
287
288 /* Define if you have the setenv function.  */
289 #undef HAVE_SETENV
290
291 /* Define if you have the setegid function.  */
292 #undef HAVE_SETEGID
293
294 /* Define if you have the seteuid function.  */
295 #undef HAVE_SETEUID
296
297 /* Define if you have the setlinebuf function.  */
298 #undef HAVE_SETLINEBUF
299
300 /* Define if you have the setpriority function.  */
301 #undef HAVE_SETPRIORITY
302
303 /* Define if you have the strerror function.  */
304 #undef HAVE_STRERROR
305
306 /* Define if you have the setresgid function.  */
307 #undef HAVE_SETRESGID
308
309 /* Define if you have the setresuid function.  */
310 #undef HAVE_SETRESUID
311
312 /* Define if you have the signal function.  */
313 #undef HAVE_SIGNAL
314
315 /* Define if you have the sigset function.  */
316 #undef HAVE_SIGSET
317
318 /* Define if you have the strftime function.  */
319 #undef HAVE_STRFTIME
320
321 /* Define if you have the wait3 system call.  */
322 #undef HAVE_WAIT3
323
324 /* ****************************************************************** */
325 /* *** Headers *** */
326
327 /* Define if you have the ANSI C header files.  */
328 #undef STDC_HEADERS
329
330 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
331 #undef TIME_WITH_SYS_TIME
332
333 /* Define if your <sys/time.h> declares struct tm.  */
334 #undef TM_IN_SYS_TIME
335
336 /* Define if you have the <cred.h> header file.  */
337 #undef HAVE_CRED_H
338
339 /* Define if you have the <crypt.h> header file.  */
340 #undef HAVE_CRYPT_H
341
342 /* Define if you have the <dirent.h> header file.  */
343 #undef HAVE_DIRENT_H
344
345 /* Define if you have the <errno.h> header file.  */
346 #undef HAVE_ERRNO_H
347
348 /* Define if you have the <fcntl.h> header file.  */
349 #undef HAVE_FCNTL_H
350
351 /* Define if you have the <getopt.h> header file.  */
352 #undef HAVE_GETOPT_H
353
354 /* Define if you have the <grp.h> header file.  */
355 #undef HAVE_GRP_H
356
357 /* Define if you have the <history.h> header file.  */
358 #undef HAVE_HISTORY_H
359
360 /* Define if you have the <libaudit.h> header file.  */
361 #undef HAVE_LIBAUDIT_H
362
363 /* Define if you have the <readline.h> header file.  */
364 #undef HAVE_READLINE_H
365
366 /* Define if you have the <readline/history.h> header file.  */
367 #undef HAVE_READLINE_HISTORY_H
368
369 /* Define if you have the <readline/readline.h> header file.  */
370 #undef HAVE_READLINE_READLINE_H
371
372 /* Define if you have the <limits.h> header file.  */
373 #undef HAVE_LIMITS_H
374
375 /* Define if you have the <mach/mach.h> header file.  */
376 #undef HAVE_MACH_MACH_H
377
378 /* Define if you have the <ndir.h> header file.  */
379 #undef HAVE_NDIR_H
380
381 /* Define if you have the <pam/pam_appl.h> header file.  */
382 #undef HAVE_PAM_PAM_APPL_H
383
384 /* Define if you have <shadow.h>.  */
385 #undef HAVE_SHADOW_H
386
387 /* Define if you have the unsetenv function.  */
388 #undef HAVE_UNSETENV
389
390 /* Define if you have <nlist.h>.  */
391 #undef NLIST_STRUCT
392
393 /* Define if you have the <security/pam_appl.h> header file.  */
394 #undef HAVE_SECURITY_PAM_APPL_H
395
396 /* Define if you have the <stdarg.h> header file.  */
397 #undef HAVE_STDARG_H
398
399 /* Define if you have the <strings.h> header file.  */
400 #undef HAVE_STRINGS_H
401
402 /* Define if you have the <sys/cred.h> header file.  */
403 #undef HAVE_SYS_CRED_H
404
405 /* Define if you have the <sys/dir.h> header file.  */
406 #undef HAVE_SYS_DIR_H
407
408 /* Define if you have the <sys/fcntl.h> header file.  */
409 #undef HAVE_SYS_FCNTL_H
410
411 /* Define if you have the <sys/file.h> header file.  */
412 #undef HAVE_SYS_FILE_H
413
414 /* Define if you have the <sys/ioctl.h> header file.  */
415 #undef HAVE_SYS_IOCTL_H
416
417 /* Define if you have the <sys/ndir.h> header file.  */
418 #undef HAVE_SYS_NDIR_H
419
420 /* Define if you have the <sys/resource.h> header file.  */
421 #undef HAVE_SYS_RESOURCE_H
422
423 /* Define if you have the <sys/socket.h> header file.  */
424 #undef HAVE_SYS_SOCKET_H
425
426 /* Define if you have the <sys/time.h> header file.  */
427 #undef HAVE_SYS_TIME_H
428
429 /* Define if you have the <sys/types.h> header file.  */
430 #undef HAVE_SYS_TYPES_H
431
432 /* Define if you have the <sys/ucred.h> header file.  */
433 #undef HAVE_SYS_UCRED_H
434
435 /* Define if you have the <sys/un.h> header file.  */
436 #undef HAVE_SYS_UN_H
437
438 /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
439 #undef HAVE_SYS_WAIT_H
440
441 /* Define if you have the <syslog.h> header file.  */
442 #undef HAVE_SYSLOG_H
443
444 /* Define if you have the <termios.h> header file.  */
445 #undef HAVE_TERMIOS_H
446
447 /* Define if you have the <ucred.h> header file.  */
448 #undef HAVE_UCRED_H
449
450 /* Define if you have the <unistd.h> header file.  */
451 #undef HAVE_UNISTD_H
452
453 /* ****************************************************************** */
454 /* *** Libraries *** */
455
456 /* Define if you have the audit library (-laudit).  */
457 #undef HAVE_LIBAUDIT
458
459 /* Define if you have the dgc library (-ldgc).  */
460 #undef HAVE_LIBDGC
461
462 /* Define if you have the pam library (-lpam).  */
463 #undef HAVE_LIBPAM
464
465 /* Define if you have the readline library.  */
466 #undef HAVE_LIBREADLINE
467
468 /* Define if you have the readline history library.  */
469 #undef HAVE_READLINE_HISTORY
470
471 /* Have audit trails (libaudit) support */
472 #undef WITH_AUDIT
473
474 /* Have SE Linux support */
475 #undef WITH_SELINUX
476
477 /* Define if you have the xnet library (-lxnet).  */
478 #undef HAVE_LIBXNET
479
480 /* some systems (*BSD, ...) use O_FSYNC instead of O_SYNC for open() */
481 #ifdef HAVE_FCNTL_H
482 #include <fcntl.h>
483 #elif HAVE_SYS_FCNTL_H
484 #include <sys/fcntl.h>
485 #endif
486 #ifndef O_SYNC
487 #define O_SYNC O_FSYNC
488 #endif
489
490 /* ****************************************************************** */
491 /* *** Size of *** */
492
493 /* These SIZEOF_* constants are defined by the AC_CHECK_SIZEOF macro */
494 #undef SIZEOF_TIME_T
495 #undef SIZEOF_PID_T
496 #undef SIZEOF_SHORT_INT
497 #undef SIZEOF_INT
498 #undef SIZEOF_LONG_INT
499 #undef SIZEOF_LONG_LONG_INT
500
501 /* We need all these types in global.h to know which conversion string we whould
502  * use when reading a pid_t or a time_t */
503 #ifndef SIZEOF_PID_T
504 #error "sizeof pid_t unknown."
505 #endif
506
507 #ifndef SIZEOF_TIME_T
508 #error "sizeof time_t unknown."
509 #endif
510
511 #ifndef SIZEOF_SHORT_INT
512 #error "sizeof short int unknown."
513 #endif
514
515 #ifndef SIZEOF_INT
516 #error "sizeof int unknown."
517 #endif
518
519 #ifndef SIZEOF_LONG_INT
520 #error "sizeof long int unknown."
521 #endif
522
523 #ifndef SIZEOF_LONG_LONG_INT
524 #error "sizeof long long int unknown."
525 #endif
526