summaryrefslogtreecommitdiff
path: root/rc/rc.single
blob: 3b37428ac72f2a18a5ec7001e4e69015a3c75b38 (plain)
    1 #!/bin/bash
    2 #
    3 # /etc/rc.single: single-user startup script
    4 #
    5 
    6 # Load configuration
    7 . /etc/rc.conf
    8 
    9 if [ "$PREVLEVEL" = "2" ]; then
   10 	# Shutdown services
   11 	if [ "${SERVICES[*]}" ]; then
   12 		for service in "${SERVICES[@]}"; do
   13 			R_SERVICES=($service ${R_SERVICES[@]})
   14 		done
   15 		for service in "${R_SERVICES[@]}"; do
   16 			/etc/rc.d/$service stop &> /tmp/rc.$$
   17 			/usr/bin/logger -t $service -f /tmp/rc.$$
   18 			/bin/rm -f /tmp/rc.$$
   19 		done
   20 	fi
   21 fi
   22 
   23 if [ "$PREVLEVEL" != "N" ]; then
   24 	# Terminate all processes
   25 	/sbin/killall5 -15
   26 	/usr/bin/sleep 5
   27 	/sbin/killall5 -9
   28 
   29         # Start udev
   30         /bin/mount -n -t proc none /proc
   31         /bin/mount -n -t sysfs none /sys
   32         /sbin/start_udev
   33         
   34 	/usr/sbin/syslogd
   35 	/usr/sbin/klogd -c 4
   36 fi
   37 
   38 if [ "$RUNLEVEL" = "1" ]; then
   39 	# Enter single-user mode
   40 	exec /sbin/init -t1 S
   41 fi
   42 
   43 # End of file

Generated by cgit