CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
procps: updated to 3.3.3 and aligned with upstream. Cleaned cross patches.
[crossrootfs.git] / rc / rc.single
CommitLineData
6dca1d21
JB
1#!/bin/bash
2#
3# /etc/rc.single: single-user startup script
4#
5
6# Load configuration
7. /etc/rc.conf
8
9if [ "$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
21fi
22
23if [ "$PREVLEVEL" != "N" ]; then
24 # Terminate all processes
25 /sbin/killall5 -15
26 /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 if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then
35 /etc/rc.d/$SYSLOG start &> /dev/null
36 fi
37fi
38
39if [ "$RUNLEVEL" = "1" ]; then
40 # Enter single-user mode
41 exec /sbin/init -t1 S
42fi
43
44# End of file