#!/sbin/runscript # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $$ depend() { need clock localmount logger provide cron } checkconfig() { if [ ${VIXIE_EMULATION} == "YES" ]; then if [ ! -f "/etc/crontab" ]; then eerror "Please create /etc/crontab, see the mcron info page for more information." return 1 fi else #Check for crontab files in /root/.cron FILES=$(find /root/.cron -type f) if [ -z ${FILES} ]; then eerror "You must place root's crontab files in the /root/.cron directory." eerror "See the mcron info page for more information." return 1 fi fi } start() { checkconfig || return 1 if [ ${VIXIE_EMULATION} == "YES" ]; then ebegin "Starting mcron: vixie-cron emulation" start-stop-daemon --start --quiet --exec /usr/bin/cron -- --noetc else ebegin "Starting mcron" start-stop-daemon --start --quiet --exec /usr/bin/mcron -- -d fi eend $? } stop() { ebegin "Stopping mcron" if [ ${VIXIE_EMULATION} == "YES" ]; then start-stop-daemon --stop --quiet --pidfile /var/run/cron.pid else #When using mcron a pid file isn't created. So we use #pkill to kill roots version of mcron. pkill -o -u root mcron || return 1 fi eend $? }