diff options
author | Lukc <lukc@upyum.com> | 2010-12-11 19:15:23 +0100 |
---|---|---|
committer | Lukc <lukc@upyum.com> | 2010-12-11 19:15:35 +0100 |
commit | 6d908a38e05b9d4135c65d23114a5874215b5bb8 (patch) | |
tree | b5e6da6d95b9a1235d82032b509b80483a886ff5 /rc/rc.single | |
download | base-6d908a38e05b9d4135c65d23114a5874215b5bb8.tar.gz base-6d908a38e05b9d4135c65d23114a5874215b5bb8.tar.bz2 base-6d908a38e05b9d4135c65d23114a5874215b5bb8.tar.xz base-6d908a38e05b9d4135c65d23114a5874215b5bb8.zip |
Engagement initial.
Diffstat (limited to 'rc/rc.single')
-rwxr-xr-x | rc/rc.single | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/rc/rc.single b/rc/rc.single new file mode 100755 index 0000000..4291eb0 --- /dev/null +++ b/rc/rc.single @@ -0,0 +1,44 @@ +#!/bin/bash +# +# /etc/rc.single: single-user startup script +# + +# Load configuration +. /etc/rc.conf + +if [ "$PREVLEVEL" = "2" ]; then + # Shutdown services + if [ "${SERVICES[*]}" ]; then + for service in "${SERVICES[@]}"; do + R_SERVICES=($service ${R_SERVICES[@]}) + done + for service in "${R_SERVICES[@]}"; do + /etc/rc.d/$service stop &> /tmp/rc.$$ + /usr/bin/logger -t $service -f /tmp/rc.$$ + /bin/rm -f /tmp/rc.$$ + done + fi +fi + +if [ "$PREVLEVEL" != "N" ]; then + # Terminate all processes + /sbin/killall5 -15 + /bin/sleep 5 + /sbin/killall5 -9 + + # Start udev + /bin/mount -n -t proc none /proc + /bin/mount -n -t sysfs none /sys + /sbin/start_udev + + if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then + /etc/rc.d/$SYSLOG start &> /dev/null + fi +fi + +if [ "$RUNLEVEL" = "1" ]; then + # Enter single-user mode + exec /sbin/init -t1 S +fi + +# End of file |