-
Notifications
You must be signed in to change notification settings - Fork 0
/
rc.single
44 lines (36 loc) · 870 Bytes
/
rc.single
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
#
# /etc/rc.single: single-user startup script
#
# Load configuration.
. /etc/rc.conf
if [ "$PREVLEVEL" = "2" ]; then
# Shutdown services.
if [ -n "$SERVICES" ]; then
for service in $SERVICES; do
R_SERVICES="$service $R_SERVICES"
done
for service in $R_SERVICES; do
"/etc/rc.d/$service" stop 2>&1 |
/usr/bin/logger -t "$service"
done
fi
fi
if [ "$PREVLEVEL" != "N" ]; then
# Terminate all processes.
/sbin/killall5 -15
/bin/sleep 5
/sbin/killall5 -9
/bin/mountpoint -q /proc || /bin/mount -n -t proc none /proc
/bin/mountpoint -q /sys || /bin/mount -n -t sysfs none /sys
# Start udev.
/sbin/start_udev
if [ -f /etc/rc.d/"$SYSLOG" ] && [ -x /etc/rc.d/"$SYSLOG" ]; then
/etc/rc.d/"$SYSLOG" start >/dev/null 2>&1
fi
fi
if [ "$RUNLEVEL" = "1" ]; then
# Enter single-user mode.
exec /sbin/init -t1 S
fi
# End of file.