diff options
author | Dexuan Cui <dexuan.cui@intel.com> | 2010-09-02 22:29:51 +0800 |
---|---|---|
committer | Saul Wold <Saul.Wold@intel.com> | 2010-09-02 15:19:33 -0700 |
commit | c398c16aa518fcf481263694f01ce133238b8748 (patch) | |
tree | 198e3a89299f94b6152057649ec9954ee4a3b5ff /meta/recipes-extended/cronie/cronie/crond.init | |
parent | 883b09fefeacaabbc28c19c05c39c39c68b29dae (diff) | |
download | openembedded-core-c398c16aa518fcf481263694f01ce133238b8748.tar.gz |
cronie: add the latest version 1.4.4
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'meta/recipes-extended/cronie/cronie/crond.init')
-rwxr-xr-x | meta/recipes-extended/cronie/cronie/crond.init | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-extended/cronie/cronie/crond.init b/meta/recipes-extended/cronie/cronie/crond.init new file mode 100755 index 0000000000..050c37e453 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crond.init @@ -0,0 +1,71 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: crond crontab +# Default-Start: 2345 +# Default-Stop: 016 +# Short-Description: run cron daemon +# Description: cron is a standard UNIX program that runs user-specified +# programs at periodic scheduled times. vixie cron adds a +# number of features to the basic UNIX cron, including better +# security and more powerful configuration options. +### END INIT INFO + +CROND=/usr/sbin/crond +CONFIG=/etc/sysconfig/crond + +[ -f $CONFIG ] || exit 1 +[ -x $CROND ] || exit 1 + +. $CONFIG + +# Source function library. +. /etc/init.d/functions + +UID=`id -u` + +case "$1" in + start) + if [ $UID -ne 0 ] ; then + echo "User has insufficient privilege." + exit 1 + fi + echo -n "Starting crond: " + start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + stop) + if [ $UID -ne 0 ] ; then + echo "User has insufficient privilege." + exit 1 + fi + echo -n "Stopping crond: " + start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + status) + if [ -n "`/bin/pidof $CROND`" ] ; then + echo "crond is running." + else + echo "crond is not running." + fi + ;; + restart) + $0 stop && sleep 1 && $0 start + ;; + *) + echo "Usage: /etc/init.d/crond {start|stop|status|restart}" + exit 1 +esac + +exit 0 + |