2 * FCRON - periodic command scheduler
4 * Copyright 2000-2014 Thibault Godouet <fcron@free.fr>
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.
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.
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
20 * The GNU General Public License can also be found in the file
21 * `LICENSE' that comes with the fcron source distribution.
26 /* *********************************************************** */
27 /* This file is destined to be edited to match your preference */
28 /* *********************************************************** */
31 /* ****************************************************************** */
32 /* ****************************************************************** */
33 /* beginning of configurable stuff ********************************** */
36 #define DEFAULT_JOB_PATH "/usr/bin:/bin" /* Default PATH to use when running jobs*/
38 #define SENDMAIL_ARGS "-Ffcron", "-odi" /* args of mail command */
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 */
45 #define LAVG_SLEEP 30 /* the time we sleep when some jobs are in lavg queue */
47 #define SAVE 1800 /* save every n seconds */
49 /* *** behavior *** */
50 #define SERIAL_ONCE 0 /* can a job be several times in the serial queue at
51 * the same moment ? */
53 #define LAVG_ONCE 1 /* can a job be several times in the lavg queue at
54 * the same moment ? */
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 */
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
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
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
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 */
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
100 #define MAXENTRIES 1024 /* max lines in non-root fcrontabs */
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) */
107 /* WARNING : do not set this too low, or add some more tests in print_field, print_line,
109 #define TERM_LEN 196 /* max nb of char in a term line */
111 #define MAX_MSG 175 /* max length of a log message */
113 #define WRITE_BUF_LEN 1024 /* length of the buffer used for saving files to disk */
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
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 */
131 /* Syslog facility and priorities messages will be logged to (see syslog(3)) */
133 /* NOTE : if you change anything here, check if the doc should not
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 */
143 /* end of configurable stuff **************************************** */
144 /* ****************************************************************** */
145 /* ****************************************************************** */
148 /* ****************************************************************** */
149 /* ****************************************************************** */
150 /* *** options which are set by configure script ******************** */
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. */
157 #undef VERSION_QUOTED
158 #undef COPYRIGHT_QUOTED
162 /* ****************************************************************** */
167 /* ****************************************************************** */
168 /* *** Compilation options *** */
171 /* 1 if we want to compile and install fcrondyn */
174 /* 1 if you want debug mode */
176 /* 1 if you want foreground mode by default */
178 #undef RUN_NON_PRIVILEGED
180 /* Define if we should use sete[ug]id() funcs */
183 /* root name and group */
187 /* user and group name to run under */
191 /* special user for the system fcrontab */
194 /* ****************************************************************** */
197 /* Define to empty if the keyword does not work. */
200 /* Define to `int' if <sys/types.h> doesn't define. */
203 /* Define to `int' if <sys/types.h> doesn't define. */
206 /* Define to `unsigned' if <sys/types.h> doesn't define. */
209 /* Define to `int' if <sys/types.h> doesn't define. */
212 /* Define as the return type of signal handlers (int or void). */
215 /* Define if your struct nlist has an n_un member. */
216 #undef NLIST_NAME_UNION
218 /* Define for DGUX with <sys/dg_sys_info.h>. */
221 /* Define for Encore UMAX. */
224 /* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
225 instead of <sys/cpustats.h>. */
228 /* Define on System V Release 4. */
231 /* ****************************************************************** */
232 /* *** Functions *** */
234 /* Define if you have the crypt function. */
237 /* Define if you have the flock function. */
240 /* Define if you have the lockf function. */
243 /* Define if your system has its own `getloadavg' function. */
244 #undef HAVE_GETLOADAVG
246 /* Define if the `getloadavg' function needs to be run setuid or setgid. */
247 #undef GETLOADAVG_PRIVILEGED
249 /* Define if you have the getcwd function. */
252 /* Define if you have the gethostname function. */
253 #undef HAVE_GETHOSTNAME
255 /* Define if you have the getopt_long function. */
256 #undef HAVE_GETOPT_LONG
258 /* Define if you have the getpeereid function. */
259 #undef HAVE_GETPEEREID
261 /* Define if you have the getpeerucred function. */
262 #undef HAVE_GETPEERUCRED
264 /* Define if you have the getspnam function. */
267 /* Define if you have the gettimeofday function. */
268 #undef HAVE_GETTIMEOFDAY
270 /* Define if you have the kstat* functions. */
273 /* Define if you have the mkstemp function. */
276 /* Define if you have the mktime function. */
279 /* Define if you have the putenv function. */
282 /* Define if (struct sockaddr) has an sa_len field. */
285 /* Define if you have the setenv function. */
288 /* Define if you have the setegid function. */
291 /* Define if you have the seteuid function. */
294 /* Define if you have the setlinebuf function. */
295 #undef HAVE_SETLINEBUF
297 /* Define if you have the setpriority function. */
298 #undef HAVE_SETPRIORITY
300 /* Define if you have the strerror function. */
303 /* Define if you have the setresgid function. */
304 #undef HAVE_SETRESGID
306 /* Define if you have the setresuid function. */
307 #undef HAVE_SETRESUID
309 /* Define if you have the signal function. */
312 /* Define if you have the sigset function. */
315 /* Define if you have the strftime function. */
318 /* Define if you have the wait3 system call. */
321 /* ****************************************************************** */
322 /* *** Headers *** */
324 /* Define if you have the ANSI C header files. */
327 /* Define if you can safely include both <sys/time.h> and <time.h>. */
328 #undef TIME_WITH_SYS_TIME
330 /* Define if your <sys/time.h> declares struct tm. */
331 #undef TM_IN_SYS_TIME
333 /* Define if you have the <cred.h> header file. */
336 /* Define if you have the <crypt.h> header file. */
339 /* Define if you have the <dirent.h> header file. */
342 /* Define if you have the <errno.h> header file. */
345 /* Define if you have the <fcntl.h> header file. */
348 /* Define if you have the <getopt.h> header file. */
351 /* Define if you have the <grp.h> header file. */
354 /* Define if you have the <history.h> header file. */
355 #undef HAVE_HISTORY_H
357 /* Define if you have the <libaudit.h> header file. */
358 #undef HAVE_LIBAUDIT_H
360 /* Define if you have the <readline.h> header file. */
361 #undef HAVE_READLINE_H
363 /* Define if you have the <readline/history.h> header file. */
364 #undef HAVE_READLINE_HISTORY_H
366 /* Define if you have the <readline/readline.h> header file. */
367 #undef HAVE_READLINE_READLINE_H
369 /* Define if you have the <limits.h> header file. */
372 /* Define if you have the <mach/mach.h> header file. */
373 #undef HAVE_MACH_MACH_H
375 /* Define if you have the <ndir.h> header file. */
378 /* Define if you have the <pam/pam_appl.h> header file. */
379 #undef HAVE_PAM_PAM_APPL_H
381 /* Define if you have <shadow.h>. */
384 /* Define if you have the unsetenv function. */
387 /* Define if you have <nlist.h>. */
390 /* Define if you have the <security/pam_appl.h> header file. */
391 #undef HAVE_SECURITY_PAM_APPL_H
393 /* Define if you have the <stdarg.h> header file. */
396 /* Define if you have the <strings.h> header file. */
397 #undef HAVE_STRINGS_H
399 /* Define if you have the <sys/cred.h> header file. */
400 #undef HAVE_SYS_CRED_H
402 /* Define if you have the <sys/dir.h> header file. */
403 #undef HAVE_SYS_DIR_H
405 /* Define if you have the <sys/fcntl.h> header file. */
406 #undef HAVE_SYS_FCNTL_H
408 /* Define if you have the <sys/file.h> header file. */
409 #undef HAVE_SYS_FILE_H
411 /* Define if you have the <sys/ioctl.h> header file. */
412 #undef HAVE_SYS_IOCTL_H
414 /* Define if you have the <sys/ndir.h> header file. */
415 #undef HAVE_SYS_NDIR_H
417 /* Define if you have the <sys/resource.h> header file. */
418 #undef HAVE_SYS_RESOURCE_H
420 /* Define if you have the <sys/socket.h> header file. */
421 #undef HAVE_SYS_SOCKET_H
423 /* Define if you have the <sys/time.h> header file. */
424 #undef HAVE_SYS_TIME_H
426 /* Define if you have the <sys/types.h> header file. */
427 #undef HAVE_SYS_TYPES_H
429 /* Define if you have the <sys/ucred.h> header file. */
430 #undef HAVE_SYS_UCRED_H
432 /* Define if you have the <sys/un.h> header file. */
435 /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
436 #undef HAVE_SYS_WAIT_H
438 /* Define if you have the <syslog.h> header file. */
441 /* Define if you have the <termios.h> header file. */
442 #undef HAVE_TERMIOS_H
444 /* Define if you have the <ucred.h> header file. */
447 /* Define if you have the <unistd.h> header file. */
450 /* ****************************************************************** */
451 /* *** Libraries *** */
453 /* Define if you have the audit library (-laudit). */
456 /* Define if you have the dgc library (-ldgc). */
459 /* Define if you have the pam library (-lpam). */
462 /* Define if you have the readline library. */
463 #undef HAVE_LIBREADLINE
465 /* Define if you have the readline history library. */
466 #undef HAVE_READLINE_HISTORY
468 /* Have audit trails (libaudit) support */
471 /* Have SE Linux support */
474 /* Define if you have the xnet library (-lxnet). */
477 /* some systems (*BSD, ...) use O_FSYNC instead of O_SYNC for open() */
480 #elif HAVE_SYS_FCNTL_H
481 #include <sys/fcntl.h>
484 #define O_SYNC O_FSYNC
487 /* ****************************************************************** */
488 /* *** Size of *** */
490 /* These SIZEOF_* constants are defined by the AC_CHECK_SIZEOF macro */
493 #undef SIZEOF_SHORT_INT
495 #undef SIZEOF_LONG_INT
496 #undef SIZEOF_LONG_LONG_INT
498 /* We need all these types in global.h to know which conversion string we whould
499 * use when reading a pid_t or a time_t */
501 #error "sizeof pid_t unknown."
504 #ifndef SIZEOF_TIME_T
505 #error "sizeof time_t unknown."
508 #ifndef SIZEOF_SHORT_INT
509 #error "sizeof short int unknown."
513 #error "sizeof int unknown."
516 #ifndef SIZEOF_LONG_INT
517 #error "sizeof long int unknown."
520 #ifndef SIZEOF_LONG_LONG_INT
521 #error "sizeof long long int unknown."