#!/sbin/sh # /sbin/init.d/cron: Abgewandelte Fassung # @(#) $Revision: 78.1 $ # # NOTE: This script is not configurable! Any changes made to this # scipt will be overwritten when you upgrade to the next # release of HP-UX. # # WARNING: Changing this script in any way may lead to a system that # is unbootable. Do not modify this script. # # # Start cron # PATH=/sbin:/usr/sbin:/usr/bin export PATH rval=0 case $1 in start_msg) echo "Start cron daemon" ;; stop_msg) echo "Stop cron daemon" ;; 'start') if [ -f /etc/rc.config.d/cron ] ; then . /etc/rc.config.d/cron else echo "ERROR: /etc/rc.config.d/cron defaults file MISSING" fi if [ "$CRON" -eq 1 -a -x /usr/sbin/cron ]; then if [ -f /var/adm/cron/log ]; then mv /var/adm/cron/log /var/adm/cron/OLDlog fi /usr/sbin/cron && echo cron started rval=0 else rval=2 fi ;; 'stop') # # Determine PID of process(es) to stop # #pid=`ps -el | awk '( ($NF ~ /cron/) && ($4 != mypid) && ($5 != mypid) ){ print $4 }' mypid=$$ ` pid=$(ps -ef|grep cron|grep -v grep|sort -k2n|head -1|cut -c9-15) if [ "X$pid" != "X" ]; then if kill $pid; then echo "cron stopped" else rval=1 echo "Unable to stop cron" fi fi ;; *) echo "usage: $0 {start|stop}" ;; esac exit $rval