From: Thibault Godouet Date: Tue, 27 Nov 2012 00:12:40 +0000 (+0000) Subject: startup script removes fcron.reboot (in case the OS doesn't do it) X-Git-Tag: ver3_1_0~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7573f2e7db6e288919e0098391d37c04c113d684;p=fcron startup script removes fcron.reboot (in case the OS doesn't do it) --- diff --git a/Makefile.in b/Makefile.in index 5a927ef..6390990 100644 --- a/Makefile.in +++ b/Makefile.in @@ -129,6 +129,10 @@ exe_list_test: exe_list.o u_list.o exe_list_test.o log.o subs.o install: install-staged strip perms ifeq ($(BOOTINSTALL), 1) + 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 $(SRCDIR)/script/boot-install "$(INSTALL) -o $(ROOTNAME)" $(DESTSBIN) $(DEBUG) $(FCRONTABS) $(ANSWERALL) $(SRCDIR) endif @@ -227,6 +231,10 @@ ifeq ($(FCRONDYN), 1) 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 $(SRCDIR)/script/boot-install "$(INSTALL) -o $(ROOTNAME)" $(DESTSBIN) $(DEBUG) $(FCRONTABS) $(ANSWERALL) $(SRCDIR) install-restart: install @@ -253,7 +261,8 @@ ciclean: clean rm -fR autom4te* vclean: ciclean - rm -f config.log config.status config.h config.cache Makefile PREVIOUS_VERSION + 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 make -C doc clean diff --git a/script/.gitignore b/script/.gitignore new file mode 100644 index 0000000..f0ef23b --- /dev/null +++ b/script/.gitignore @@ -0,0 +1,4 @@ +# Auto-generated files: +fcron.sh +sysVinit-launcher +fcron.init.suse diff --git a/script/boot-install b/script/boot-install index 3aa4a71..ca0c658 100755 --- a/script/boot-install +++ b/script/boot-install @@ -122,13 +122,11 @@ if test $IS_FREEBSD -eq 1; then INSTALL="n" fi if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then - cp -f $SRCDIR/script/fcron.sh /usr/local/etc/rc.d/ + cp -f script/fcron.sh /usr/local/etc/rc.d/ if test $DEBUG -eq 1; then cat /usr/local/etc/rc.d/fcron.sh | sed 's: -b: -b -d:' > /usr/local/etc/rc.d/fcron.sh2 mv -f /usr/local/etc/rc.d/fcron.sh2 /usr/local/etc/rc.d/fcron.sh fi - cat /usr/local/etc/rc.d/fcron.sh | sed "s:@@DESTSBIN@:$DESTBIN:" > /usr/local/etc/rc.d/fcron.sh2 - mv -f /usr/local/etc/rc.d/fcron.sh2 /usr/local/etc/rc.d/fcron.sh chmod +x /usr/local/etc/rc.d/fcron.sh INSTALLED=1 else @@ -161,14 +159,12 @@ if test \( ! "$INSTALLED" -eq 1 \) -a \( "$ROOTDIR" != "" \); then INSTALL="n" fi if test \( -z "$INSTALL" \) -o \( "$INSTALL" = "y" \); then - $INSPROG -c -m 755 $SRCDIR/script/sysVinit-launcher $ROOTDIR/init.d/fcron + $INSPROG -c -m 755 script/sysVinit-launcher $ROOTDIR/init.d/fcron if test $DEBUG -eq 1; then cat $ROOTDIR/init.d/fcron | sed 's: -b: -b -d:' >$ROOTDIR/init.d/fcron2 mv -f $ROOTDIR/init.d/fcron2 $ROOTDIR/init.d/fcron chmod +x $ROOTDIR/init.d/fcron fi - cat $ROOTDIR/init.d/fcron | sed "s:@@DESTSBIN@:$DESTBIN:" >$ROOTDIR/init.d/fcron2 - mv -f $ROOTDIR/init.d/fcron2 $ROOTDIR/init.d/fcron chmod +x $ROOTDIR/init.d/fcron for j in 2 3 4 5 diff --git a/script/fcron.init.suse b/script/fcron.init.suse.in similarity index 93% rename from script/fcron.init.suse rename to script/fcron.init.suse.in index a493352..dad96c7 100644 --- a/script/fcron.init.suse +++ b/script/fcron.init.suse.in @@ -17,6 +17,7 @@ DAEMON_PIDFILE="/var/run/fcron.pid" #DAEMON_OPT="" DAEMON_USER="root" SUPPORTS_HUP="yes" +REBOOT_LOCK=@@REBOOT_LOCK@ pid_par=${DAEMON_PIDFILE:+"-p $DAEMON_PIDFILE"} usr_par=${DAEMON_USER:+"-u $DAEMON_USER"} @@ -78,6 +79,12 @@ case "$1" in echo -n " Warning: daemon not running. " killproc $pid_par -t 10 ${DAEMON_BIN} rc_status -v + if test \( "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "6" \) \ + -a -f "$REBOOT_LOCK" ; then + # Make sure the lock file is deleted on reboot/shutdown + # in case the OS doesn't do it itself + rm -f "$REBOOT_LOCK" + fi ;; try-restart|condrestart) if test "$1" = "condrestart"; then diff --git a/script/fcron.sh b/script/fcron.sh deleted file mode 100755 index 1f994a9..0000000 --- a/script/fcron.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Start fcron at boot time under FreeBSD - -SBIN=@@DESTSBIN@ - -case "$1" in - start) - $SBIN/fcron -b && echo -n " fcron" - ;; - stop) - killall -TERM fcron - ;; - *) - echo "Usage: fcron start|stop" - exit 1 - ;; -esac \ No newline at end of file diff --git a/script/fcron.sh.in b/script/fcron.sh.in new file mode 100755 index 0000000..09fbd85 --- /dev/null +++ b/script/fcron.sh.in @@ -0,0 +1,24 @@ +#!/bin/sh +# Start fcron at boot time under FreeBSD + +SBIN=@@DESTSBIN@ +REBOOT_LOCK=@@REBOOT_LOCK@ + +case "$1" in + start) + $SBIN/fcron -b && echo -n " fcron" + ;; + stop) + killall -TERM fcron + if test \( "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "6" \) \ + -a -f "$REBOOT_LOCK" ; then + # Make sure the lock file is deleted on reboot/shutdown + # in case the OS doesn't do it itself + rm -f "$REBOOT_LOCK" + fi + ;; + *) + echo "Usage: fcron start|stop" + exit 1 + ;; +esac diff --git a/script/sysVinit-launcher b/script/sysVinit-launcher.in similarity index 90% rename from script/sysVinit-launcher rename to script/sysVinit-launcher.in index 3e96f7c..c66027d 100755 --- a/script/sysVinit-launcher +++ b/script/sysVinit-launcher.in @@ -24,6 +24,7 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin" FUNCTION=0 SBIN=@@DESTSBIN@ +REBOOT_LOCK=@@REBOOT_LOCK@ EXEC="$SBIN/fcron" @@ -77,6 +78,13 @@ case "$1" in if test -d /var/lock/subsys/; then [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/fcron fi + if test \( "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "6" \) \ + -a -f "$REBOOT_LOCK" ; then + # Make sure the lock file is deleted on reboot/shutdown + # in case the OS doesn't do it itself + rm -f "$REBOOT_LOCK" + fi + $FINALECHO ;; status)