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