ANSWERALL := @ANSWERALL@
USEPAM := @USEPAM@
FCRONDYN := @FCRONDYN@
+SYSTEMD_DIR := @SYSTEMD_DIR@
# Options
# -DDEBUG even more verbose
-DFCRON_EDITOR="\"${FCRON_EDITOR}\"" -DBINDIREX="\"${DESTBIN}\"" \
-c $<
-install: install-staged strip perms
-ifeq ($(BOOTINSTALL), 1)
+initscripts:
if test ! -d script; then mkdir script ; fi
- for F in sysVinit-launcher fcron.sh fcron.init.suse ; do \
+ for F in sysVinit-launcher fcron.sh fcron.init.suse fcron.init.systemd ; do \
$(SRCDIR)/script/gen-in.pl $(SRCDIR)/script/$${F}.in script/$${F} ./ ; \
- done
+ done
+
+install: install-staged strip perms initscripts
+ifeq ($(BOOTINSTALL), 1)
$(SRCDIR)/script/boot-install "$(INSTALL) -o $(ROOTNAME)" $(DESTSBIN) $(DEBUG) $(FCRONTABS) $(ANSWERALL) $(SRCDIR)
endif
+ifneq ($(SYSTEMD_DIR), no)
+ if test ! -d $(DESTDIR)$(SYSTEMD_DIR); then $(INSTALL) -m 755 -d $(DESTDIR)$(SYSTEMD_DIR) ; fi
+ $(INSTALL) -m 644 files/fcron.init.systemd $(DESTDIR)$(SYSTEMD_DIR)/fcron.service
+endif
install-staged: all
strip $(DESTDIR)$(DESTBIN)/fcrondyn
endif
-install-boot: install
- if test ! -d script; then mkdir script ; fi
- for F in sysVinit-launcher fcron.sh fcron.init.suse ; do \
- $(SRCDIR)/script/gen-in.pl $(SRCDIR)/script/$${F}.in script/$${F} ./ ; \
- done
+install-boot: install initscripts
$(SRCDIR)/script/boot-install "$(INSTALL) -o $(ROOTNAME)" $(DESTSBIN) $(DEBUG) $(FCRONTABS) $(ANSWERALL) $(SRCDIR)
install-restart: install
vclean: ciclean
rm -f config.log config.status config.h config.cache Makefile PREVIOUS_VERSION \
- files/fcron.conf script/fcron.init.suse script/fcron.sh script/sysVinit-launcher
+ files/fcron.conf script/fcron.init.suse script/fcron.init.systemd \
+ script/fcron.sh script/sysVinit-launcher
make -C doc clean
AC_SUBST(DOCDIR)
+dnl systemd init system
+SYSTEMD_DIR="no"
+
+AC_CHECK_PROGS(PKG_CONFIG, $PKG_CONFIG pkg-config, , $PATH:/local/bin:/usr/local/bin:/opt/sfw/bin)
+AC_MSG_CHECKING(for systemd)
+AC_ARG_WITH([systemdsystemunitdir],
+[ --with-systemdsystemunitdir=DIR Directory for systemd service files.],
+[], [ if test "x" != "x$PKG_CONFIG"; then
+ with_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
+ fi])
+if test "x$with_systemdsystemunitdir" != xno; then
+ if test "x" != "x$with_systemdsystemunitdir"; then
+ SYSTEMD_DIR="$with_systemdsystemunitdir"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+else
+ AC_MSG_RESULT(disabled)
+fi
+AC_SUBST(SYSTEMD_DIR)
+
+
dnl ---------------------------------------------------------------------
dnl Users and groups ...
--- /dev/null
+#systemd service configuration file for fcron
+
+[Unit]
+Description=fcron periodical command scheduler
+After=remote-fs.target syslog.target time-sync.target
+Before=shutdown.target
+
+[Service]
+Type=forking
+PIDFile=@@PIDFILE@
+ExecStart=@@DESTSBIN@/fcron
+ExecReload=/bin/kill -USR1 $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target