void-packages/templates/initscripts/files/rc.single
Juan RP ed07259681 Added initscripts-2009.01 template.
This package contains all files required for booting the lsXL
linux system built through xbps.

Currently it uses the NetBSD rc.d(8) system, sysvinit and
modified BSD style scripts modified from Arch linux.

--HG--
extra : convert_revision : 4584be26dd672ba33f9b1d76534a22d4715664ea
2009-03-06 05:17:46 +01:00

57 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
#
# /etc/rc.single: Single-user startup script.
#
export HOME=/
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
umask 022
. /etc/rc.subr
. /etc/rc.conf
_rc_conf_loaded=true
if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then
# Determine the shutdown order of the /etc/rc.d scripts,
# and perform the operation
#
files=$(rcorder ${rcshutdown_rcorder_flags} /etc/rc.d/*)
for _rc_elem in $(reverse_list $files); do
run_rc_script $_rc_elem stop
done
fi
if [ "$PREVLEVEL" != "N" ]; then
echo -n "=> Sending SIGTERM to processes... "
killall5 -15 &> /dev/null
sleep 5
echo "done."
echo -n "=> Sending SIGKILL to processes... "
killall5 -9
sleep 1
echo "done."
if [ -x /sbin/udevadm -a -d /sys/block ]; then
/etc/rc.d/udevd start
/etc/rc.d/udev_events start
else
# Static /dev, our last resort
echo "=> Using static /dev filesystem"
fi
# Start syslogd.
if [ -x /etc/rc.d/syslogd -a -x /etc/rc.d/klogd ]; then
/etc/rc.d/klogd start
/etc/rc.d/syslogd start
fi
fi
if [ "$RUNLEVEL" = "1" ]; then
echo
echo "*** Entering single-user mode..."
# make sure /dev/initctl is in place
kill -HUP 1
exec /sbin/init -t1 S
fi