#
# chkconfig: 2345 40 60
#
-# description: cron is a standard UNIX program that runs user-specified \
-# programs at periodic scheduled times. hc-cron adds a number \
-# of features to the basic UNIX cron, including better security \
-# and more powerful configuration options.
+# description: Fcron is a periodical command scheduler which aims at replacing \
+# Vixie Cron, so it implements most of its functionalities.
#
# processname: crond
# config: /etc/fcron.conf
-# pidfile: /var/run/fcron.pid
+# pidfile: /var/run/crond.pid
# Source function library
start)
# Check if the service is already running?
if [ ! -f /var/lock/subsys/crond ]; then
- msg_starting fcron
- daemon /usr/sbin/fcron -b -c /etc/fcron.conf
+ msg_starting fcron
+ [ -f /var/spool/cron/systab.orig ] && rm -rf /var/spool/cron/systab.orig
+ FIND=`find /etc/cron.d/ \( -type f ! -name '*~' ! -name \*\.swp \
+ ! -name \*\.rpmorig ! -name \*\.rpmnew ! -name \*\.rpmsave \)`
+ for FILE in $FIND; do
+ cat $FILE >>/var/spool/cron/systab.orig
+ done
+ fcrontab -u systab -z > /dev/null 2>&1
+ daemon /usr/sbin/crond -b -c /etc/fcron.conf
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/crond
else
# Stop daemons.
if [ -f /var/lock/subsys/crond ]; then
msg_stopping fcron
- killproc fcron
+ killproc crond
rm -f /var/lock/subsys/crond >/dev/null 2>&1
else
msg_not_running fcron
fi
-
+
;;
status)
- status fcron
+ status crond
exit $?
;;
restart|force-reload)