[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: shutting down slapd



On Mon, 2006-05-15 at 22:04 -0400, matthew sporleder wrote:
> You wait for the pid to go away before moving on with the shutdown.

FWIW, the 'stop' stanza of my /etc/init.d/slapd is below.  It sends a
-INT and keeps trying, preventing the box from going down until slapd's
done.

'stop')
   if [ -f /var/run/slapd/slapd.pid ]
   then
           pid=`cat /var/run/slapd/slapd.pid`
           res=`ps -efl | grep slapd | grep $pid`
           if [ "$res" != "" ]
           then
                kill -INT `cat /var/run/slapd/slapd.pid`
                echo "-INT sent to slapd"
                sleep 1
                res=`ps -efl | grep slapd | grep $pid`
                while [ "$res" != "" ]
                do
                        echo "slapd still running, waiting..."
                        sleep 1
                        res=`ps -efl | grep slapd | grep $pid`
                done
                echo "slapd stopped"
           else
                echo "PID file found, but slapd not running"
           fi
   else
        echo "slapd not running"
   fi
   ;;
*)




-- 
John Madden
Sr. UNIX Systems Engineer
Ivy Tech Community College of Indiana
jmadden@ivytech.edu