PREIN
/bin/sh
if [ -n "`/usr/bin/getgid crontab`" ]; then
if [ "`/usr/bin/getgid crontab`" != "117" ]; then
echo "Error: group crontab doesn't have gid=117. Correct this before installing vixie-cron." 1>&2
exit 1
fi
else
echo "Adding group crontab GID=117."
/usr/sbin/groupadd -g 117 -r crontab 1>&2 || exit $?
[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || :
fi;
PREUN
/bin/sh
if [ "$1" = "0" ]; then
{
if [ -f /var/lock/subsys/crond ]; then
/sbin/service crond stop 1>&2 || :;
fi }; /sbin/chkconfig --del crond
fi
POSTIN
/bin/sh
/sbin/chkconfig --add crond
umask 027
touch /var/log/cron
chgrp crontab /var/log/cron
chmod 660 /var/log/cron
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/crond ] && . /etc/sysconfig/crond
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/crond ]; then
/sbin/service crond restart 1>&2 || :;
else
echo 'Run "/sbin/service crond start" to start cron daemon.'
fi
fi };
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
/usr/lib/rpm/user_group.sh group del crontab
fi
Triggers
vixie-cron <=
3.0.1-85
/bin/sh
for i in `/bin/ls /var/spool/cron 2>/dev/null`
do
chown ${i} /var/spool/cron/${i} 2>/dev/null || :
done
/bin/chmod 660 /var/log/cron
/bin/chgrp crontab /var/log/cron
/bin/chmod 640 /etc/cron/cron.*
/bin/chgrp crontab /etc/cron/cron.*
vixie-cron <=
3.0.1-73
/bin/sh
if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
fi
if [ -f /etc/cron.d/cron.allow ]; then
mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
fi
if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
fi
if [ -f /etc/cron.d/cron.deny ]; then
mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
fi
vixie-cron <=
3.0.1-70
/bin/sh
if [ -f /etc/cron.allow ]; then
mv -f /etc/cron.allow /etc/cron/cron.allow
fi
if [ -f /etc/cron.deny ]; then
mv -f /etc/cron.deny /etc/cron/cron.deny
fi
hc-cron
/bin/sh
/sbin/chkconfig --del crond
/sbin/chkconfig --add crond
hc-cron <=
0.14-12
/bin/sh
for i in `/bin/ls /var/spool/cron 2>/dev/null`
do
chown ${i} /var/spool/cron/${i} 2>/dev/null || :
done
/bin/chmod 660 /var/log/cron
/bin/chgrp crontab /var/log/cron
/bin/chmod 640 /etc/cron/cron.*
/bin/chgrp crontab /etc/cron/cron.*