crux-initscripts

hacked CRUX initscripts to work with sinit
git clone git://git.2f30.org/crux-initscripts.git
Log | Files | Refs | README

rc.single (659B)


      1 #!/bin/bash
      2 #
      3 # /etc/rc.single: single-user startup script
      4 #
      5 
      6 # Load configuration
      7 . /etc/rc.conf
      8 
      9 # Shutdown services
     10 if [ "${SERVICES[*]}" ]; then
     11 	for service in "${SERVICES[@]}"; do
     12 		R_SERVICES=($service ${R_SERVICES[@]})
     13 	done
     14 	for service in "${R_SERVICES[@]}"; do
     15 		/etc/rc.d/$service stop &> /tmp/rc.$$
     16 		/usr/bin/logger -t $service -f /tmp/rc.$$
     17 		/bin/rm -f /tmp/rc.$$
     18 	done
     19 fi
     20 
     21 # Terminate all processes
     22 /sbin/killall5 -15
     23 /bin/sleep 5
     24 /sbin/killall5 -9
     25 
     26 if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
     27 	/etc/rc.d/$SYSLOG start &> /dev/null	
     28 fi
     29 
     30 source /etc/profile
     31 
     32 # Start a shell for recovery
     33 while :; do
     34 	/bin/sh
     35 done
     36 
     37 # End of file