PREUN
/bin/sh
if [ "$1" = "0" ]; then
service crond stop >/dev/null 2>&1 ||:
/sbin/chkconfig --del crond
fi
POSTIN
/bin/sh
/sbin/chkconfig --add crond
POSTUN
/bin/sh
if [ "$1" -ge "1" ]; then
service crond condrestart > /dev/null 2>&1 ||:
fi
# empty /etc/crontab in case there are only old regular jobs
Triggers
cronie <
1.4.1
/bin/sh
cp -a /etc/crontab /etc/crontab.rpmsave
sed -e '/^01 \* \* \* \* root run-parts \/etc\/cron\.hourly/d'\
-e '/^02 4 \* \* \* root run-parts \/etc\/cron\.daily/d'\
-e '/^22 4 \* \* 0 root run-parts \/etc\/cron\.weekly/d'\
-e '/^42 4 1 \* \* root run-parts \/etc\/cron\.monthly/d' /etc/crontab.rpmsave > /etc/crontab
exit 0
#copy the lock, remove old daemon from chkconfig
vixie-cron
/bin/sh
cp -a /var/lock/subsys/crond /var/lock/subsys/cronie > /dev/null 2>&1 ||:
#if the lock exist, then we restart daemon (it was running in the past).
#add new daemon into chkconfig everytime, when we upgrade to cronie from vixie-cron
vixie-cron
/bin/sh
/sbin/chkconfig --add crond
[ -f /var/lock/subsys/cronie ] && ( rm -f /var/lock/subsys/cronie ; service crond restart ) > /dev/null 2>&1 ||: