*.o
src/crond
src/crontab
+src/cron-paths.h
*~
*.tar.*
fi ]
)
+dnl CRON_VAR_DEFAULT (VAR, DESCRIPTION, DEFAULT)
+dnl --------------------------------------------
+AC_DEFUN([CRONIE_CONF_VAR],
+[AC_ARG_VAR([$1], [$2 @<:@$3@:>@])
+if test "$$1" = ""; then
+ $1='$3'
+fi
+])
+CRONIE_CONF_VAR([SYSCRONTAB], [the current working directory of the running daemon], [${sysconfdir}/crontab])
+CRONIE_CONF_VAR([SYS_CROND_DIR], [the current working directory of the running daemon], [${sysconfdir}/cron.d])
+CRONIE_CONF_VAR([CRONDIR], [the current working directory of the running daemon], [${localstatedir}/spool])
+CRONIE_CONF_VAR([SPOOL_DIR], [the directory where all the user cron tabs reside], [${CRONDIR}/cron])
+
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
AC_OUTPUT
common_src = entry.c env.c misc.c pw_dup.c security.c cron.h \
externs.h funcs.h globals.h macros.h pathnames.h structs.h \
bitstring.h
+common_nodist = cron-paths.h
+nodist_crond_SOURCES = $(common_nodist)
+nodist_crontab_SOURCES = $(common_nodist)
+BUILT_SOURCES = $(common_nodist)
LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
## if DEBUG
## noinst_PROGRAMS = debug
## endif
+
+# This header contains all the paths.
+# If they are configurable, they are declared in configure script.
+# Depends on this Makefile, because it uses make variables.
+cron-paths.h: Makefile
+ @echo 'creating $@'
+ @sed >$@ 's/ *\\$$//' <<\END #\
+ /* This file has been automatically generated. Do not edit. */ \
+ \
+ #ifndef _CRON_PATHS_H_ \
+ #define _CRON_PATHS_H_ \
+ \
+ /* CRONDIR is where cron(8) and crontab(1) both chdir \
+ * to; SPOOL_DIR, CRON_ALLOW, CRON_DENY, and LOG_FILE \
+ * are all relative to this directory. \
+ * FIXME: Hey, but do we need this at all? --kasal \
+ */ \
+ #define CRONDIR "$(CRONDIR)" \
+ \
+ /* SPOOLDIR is where the crontabs live. \
+ * This directory will have its modtime updated \
+ * whenever crontab(1) changes a crontab; this is \
+ * the signal for cron(8) to look at each individual \
+ * crontab file and reload those whose modtimes are \
+ * newer than they were last time around (or which \
+ * didn't exist last time around...) \
+ */ \
+ #define SPOOL_DIR "$(SPOOL_DIR)" \
+ \
+ /* cron allow/deny file. At least cron.deny must \
+ * exist for ordinary users to run crontab. \
+ */ \
+ #define CRON_ALLOW "$(sysconfdir)/cron.allow" \
+ #define CRON_DENY "$(sysconfdir)/cron.deny" \
+ \
+ /* 4.3BSD-style crontab */ \
+ #define SYSCRONTAB "$(SYSCRONTAB)" \
+ \
+ /* system crontab dir */ \
+ #define SYS_CROND_DIR "$(SYS_CROND_DIR)" \
+ \
+ #define SYSCONFDIR "$(sysconfdir)" \
+ \
+ #endif /* _CRON_PATHS_H_ */ \
+ END
# include <paths.h>
#endif /*BSD*/
-#define REBOOT_LOCK "/var/run/cron.reboot"
-
-#ifndef CRONDIR
- /* CRONDIR is where cron(8) and crontab(1) both chdir
- * to; SPOOL_DIR, CRON_ALLOW, CRON_DENY, and LOG_FILE
- * are all relative to this directory.
- */
-#define CRONDIR "/var/spool"
-#endif
-
- /* SPOOLDIR is where the crontabs live.
- * This directory will have its modtime updated
- * whenever crontab(1) changes a crontab; this is
- * the signal for cron(8) to look at each individual
- * crontab file and reload those whose modtimes are
- * newer than they were last time around (or which
- * didn't exist last time around...)
- */
-#define SPOOL_DIR "cron"
-
- /* cron allow/deny file. At least cron.deny must
- * exist for ordinary users to run crontab.
- */
-#define CRON_ALLOW "/etc/cron.allow"
-#define CRON_DENY "/etc/cron.deny"
+#include "cron-paths.h"
/* where should the daemon stick its PID?
* PIDDIR must end in '/'.
+ * (Don't ask why the default is "/etc/".)
*/
#ifdef _PATH_VARRUN
# define PIDDIR _PATH_VARRUN
#else
-# define PIDDIR "/etc/"
+# define PIDDIR SYSCONFDIR "/"
#endif
#define PIDFILE "crond.pid"
#define _PATH_CRON_PID PIDDIR PIDFILE
-
- /* 4.3BSD-style crontab */
-#define SYSCRONTAB "/etc/crontab"
-
- /* system crontab dir */
-#define SYS_CROND_DIR "/etc/cron.d"
+#define REBOOT_LOCK PIDDIR "cron.reboot"
/* what editor to use if no EDITOR or VISUAL
* environment variable specified.