The following changes were made:
* Moved crontab from usher into CONFIG * Modified init script to use status_of_proc from init-functions * Modified usher to use init script status to check if daemon running
This commit is contained in:
@@ -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]"
|
||||
|
||||
11
SNAP/crontab
11
SNAP/crontab
@@ -1,11 +0,0 @@
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
# we use the runall script to execute any scripts in the cron.hourly,
|
||||
# cron.daily, cron.weekly, and cron.monthly directories
|
||||
|
||||
# m h dom mon dow user command
|
||||
17 * * * * root cd / && runall /etc/cron.hourly
|
||||
25 6 * * * root cd / && runall /etc/cron.daily
|
||||
47 6 * * 7 root cd / && runall /etc/cron.weekly
|
||||
52 6 1 * * root cd / && runall /etc/cron.monthly
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user