diff --git a/SNAP/crontab b/CONFIG/etc/crontab similarity index 100% rename from SNAP/crontab rename to CONFIG/etc/crontab diff --git a/Makefile b/Makefile index 459e262..e20c610 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ URL = http://ftp.isc.org/isc/cron/ REPO = main BRIEF = daemon to execute scheduled commands DESC = An implimentation of cron based on the SysV cron (aka Vixie cron) -SNAPVER = 1 +SNAPVER = 2 ARCHIVE := $(PWD)/$(shell ls SRC/*.shar|tail -1) SRCDIR := cron-$(shell echo $(ARCHIVE)|egrep -o '[0-9]\.[0-9]') @@ -64,8 +64,6 @@ $(ROOT): $(SRCDIR)/cron install -v -m 644 crontab.5 $(ROOT)/usr/share/man/man5/crontab.5 && \ install -v -m 644 cron.8 $(ROOT)/usr/share/man/man8/cron.8 && \ install -v -m 755 $(SNAPDIR)/cron.init $(ROOT)/etc/init.d/cron && \ - install -v -m 600 $(SNAPDIR)/crontab \ - $(ROOT)/usr/share/cron/crontab && \ install -v -m 755 $(SNAPDIR)/runall $(ROOT)/bin test: $(ROOT) @@ -77,5 +75,6 @@ clean: $(SNAPINFO) \ $(MANIFEST) \ $(FILES) \ + $(CONFIG) \ $(SRCDIR) diff --git a/SNAP/cron.init b/SNAP/cron.init index c3c7aca..5e523ee 100755 --- a/SNAP/cron.init +++ b/SNAP/cron.init @@ -36,13 +36,7 @@ case "$1" in $0 start ;; status) - pid=$(pidofproc -p "$PIDFILE" "$DAEMON") - - if [ "$?" -ne 0 ]; then - echo "cron not running" - else - echo "cron running with PID: $pid" - fi + status_of_proc -p "$PIDFILE" "$DAEMON" || exit 1 ;; *) echo "Usage: $0 [start|stop|restart|status]" diff --git a/SNAP/usher b/SNAP/usher index 83d04ca..03733fc 100755 --- a/SNAP/usher +++ b/SNAP/usher @@ -7,12 +7,11 @@ case $1 in exit 0 ;; postinst) - [ -f "/run/cron.pid" ] && /etc/init.d/cron restart - [ -f "/etc/crontab" ] || cp /usr/share/cron/crontab /etc/crontab + /etc/init.d/cron status 2>&1 > /dev/null && /etc/init.d/cron restart exit 0 ;; prerm) - [ -f "/run/cron.pid" ] && /etc/init.d/cron stop + /etc/init.d/cron status 2>&1 > /dev/null && /etc/init.d/cron stop exit 0 ;; postrm)