Home | History | Annotate | Line # | Download | only in etc
rc.shutdown revision 1.1
      1 #	$NetBSD: rc.shutdown,v 1.1 1998/10/29 20:24:57 bad Exp $
      2 
      3 # System shutdown script run by shutdown before halting/rebooting
      4 # or going single-user.
      5 
      6 stty status '^T'
      7 
      8 export HOME=/
      9 export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
     10 
     11 if [ -f /etc/rc.subr ]; then
     12 	. /etc/rc.subr
     13 else
     14 	echo "Can't read /etc/rc.subr; aborting."
     15 	exit 1;
     16 fi
     17 
     18 if [ -f /etc/rc.conf ]; then
     19 	. /etc/rc.conf
     20 fi
     21 
     22 if checkyesno do_rcshutdown; then
     23 	: # Everything's hunkdory
     24 else
     25 	echo "Skipping shutdown hooks."
     26 	exit 0
     27 fi
     28 
     29 if [ -f /etc/rc.shutdown.local ]; then
     30 	. /etc/rc.shutdown.local
     31 fi
     32 
     33 # Kill xdm and wait for it to terminate.
     34 if checkyesno xdm; then
     35 	XDM_PID=`sed 1q /var/run/xdm-pid`
     36 	if [ -n "$XDM_PID" ]; then
     37 		echo -n ' xdm'
     38 		kill $XDM_PID
     39 		while kill -0 $XDM_PID; do
     40 			sleep 1
     41 		done
     42 	fi
     43 fi
     44 
     45 exit 0
     46