mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
56 lines
1.3 KiB
Bash
Executable file
56 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# /etc/rc.single: Single-user startup script.
|
|
#
|
|
|
|
. /etc/rc.conf
|
|
. /etc/rc.d/functions
|
|
|
|
run_hook single_start
|
|
|
|
if [[ $PREVLEVEL != N ]]; then
|
|
kill_everything single
|
|
status "Starting UDev Daemon" /sbin/udevd --daemon
|
|
run_hook single_udevlaunched
|
|
|
|
# Trigger udev uevents
|
|
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
|
|
stat_busy "Triggering UDev uevents"
|
|
/sbin/udevadm trigger --action=add --type=subsystems
|
|
/sbin/udevadm trigger --action=add --type=devices
|
|
stat_done
|
|
fi
|
|
|
|
# Wait for udev uevents
|
|
if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then
|
|
status "Waiting for UDev uevents to be processed" \
|
|
/sbin/udevadm settle --quiet --timeout=${UDEV_TIMEOUT:-30}
|
|
fi
|
|
|
|
run_hook single_udevsettled
|
|
|
|
# try syslog-NG first, then fall back to good ol' syslogd
|
|
if [[ -x /etc/rc.d/syslog-ng ]]; then
|
|
/etc/rc.d/syslog-ng start
|
|
elif [[ -x /etc/rc.d/syslogd ]]; then
|
|
/etc/rc.d/syslogd start
|
|
[[ -x /etc/rc.d/klogd ]] && /etc/rc.d/klogd start
|
|
fi
|
|
fi
|
|
|
|
run_hook single_end
|
|
|
|
if [[ $RUNLEVEL = 1 ]]; then
|
|
printsep
|
|
printhl "Entering single-user mode..."
|
|
# make sure /dev/initctl is in place
|
|
kill -HUP 1
|
|
exec /sbin/init -t1 S
|
|
fi
|
|
|
|
/bin/touch /var/log/boot
|
|
kill `/bin/cat /run/bootlogd.pid`
|
|
/bin/rm /run/bootlogd.pid
|
|
|
|
# End of file
|
|
# vim: set ts=2 sw=2 noet:
|