--- 10Mar94+/user/pfsinit Sat Mar 26 18:22:23 1994 *************** *** 1,4 **** --- 1,5 ---- #!/bin/sh + # set -x # This scripts job is to start or stop pfs, depending on its argument # It is intended to be run by rc.d or whatever the equivalent is on your # system. *************** *** 9,29 **** # Ideally this should work through the "TOPDIR" variable, but I havent # figured out how to do that in a script - easier to link /usr/pfs # to the right place :-) case "$1" in start) - #set -x if [ -f /etc/hostanddomain ] then PSRV_HOSTNAME=`line $LOGDIR/rmg.often.log ! $GENERATION $LOGDIR/rmg.often.log ! if [ -f /usr/local/bin/rmg.often ] ! then /usr/local/bin/rmg.often >>$LOGDIR/rmg.often.log & ! fi ;; stop) ! if ps -fu pfs | egrep " 1[ ].*dirsrv" >/dev/null then /usr/pfs/bin/padmin -kill -force fi + + if ps -fu pfs | egrep " 1[ ].*dirsrv" >/dev/null + then + exec $0 kill + fi ;; install) if [ -d /etc/init.d ] *************** *** 33,38 **** --- 56,84 ---- ln /etc/init.d/pfsinit /etc/rc1.d/K58pfsinit ln /etc/init.d/pfsinit /etc/rc0.d/K58pfsinit fi + ;; + as_pfs_restart_on_err) + RMGLOG=$LOGDIR/rmg.log + PSRV_HOSTNAME=`line >$RMGLOG + tail -1f $RMGLOG | + $PERL -ne '/ERR:.*:Server Down:/ && (exit)' + Date="`date`" + echo " == ERR == ATTEMPTING RESTART == $Date " >>$RMGLOG + $0 aspfs_kill + PSRV_HOSTNAME="$PSRV_HOSTNAME" /usr/pfs/bin/pstart + echo " == ERR == DONE RESTART == $Date " >>$RMGLOG + done + ;; + restart_on_err) + exec su pfs -c "$0 as_pfs_restart_on_err" + ;; + *) + echo "$1" is not a valid command to pfsinit ;; esac