forked from pool/systemd
0227bf9cb1
- make 'reload' and 'force-reload' LSB compliant (bnc#793936). OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=325
75 lines
1.5 KiB
Bash
75 lines
1.5 KiB
Bash
#!/bin/sh
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: boot.udev
|
|
# Required-Start:
|
|
# Required-Stop:
|
|
# Should-Start:
|
|
# Should-Stop:
|
|
# Default-Start: B
|
|
# Default-Stop:
|
|
# Short-Description: manage /dev and kernel device-events
|
|
# Description: udevd daemon to manage /dev and kernel device events
|
|
### END INIT INFO
|
|
|
|
. /etc/rc.status
|
|
|
|
PATH="/sbin:/bin:/usr/sbin:/usr/bin"
|
|
DAEMON="@@SYSTEMD@@/systemd-udevd"
|
|
UDEVADM="@@BINDIR@@/udevadm"
|
|
WRITERULE="@@PREFIX@@/write_dev_root_rule"
|
|
udev_timeout=180
|
|
|
|
case "$1" in
|
|
start)
|
|
# create /dev/root symlink with dynamic rule
|
|
if [ -x ${WRITERULE} ]; then
|
|
${WRITERULE} >/dev/null 2>&1 || true
|
|
fi
|
|
|
|
# start udevd
|
|
echo -n "Starting udevd: "
|
|
${DAEMON} --daemon
|
|
if [ $? -ne 0 ]; then
|
|
rc_status -v
|
|
rc_exit
|
|
fi
|
|
rc_status -v
|
|
|
|
# trigger events for all devices
|
|
echo -n "Loading drivers, configuring devices: "
|
|
${UDEVADM} trigger --type=subsystems --action=add
|
|
${UDEVADM} trigger --type=devices --action=add
|
|
|
|
# wait for events to finish
|
|
${UDEVADM} settle --timeout=$udev_timeout
|
|
rc_status -v
|
|
;;
|
|
stop)
|
|
echo -n "Stopping udevd: "
|
|
killproc ${DAEMON}
|
|
rc_status -v
|
|
;;
|
|
restart)
|
|
echo -n "Restarting udevd: "
|
|
killproc ${DAEMON}
|
|
${DAEMON} --daemon
|
|
rc_status -v
|
|
;;
|
|
status)
|
|
echo -n "Checking for udevd: "
|
|
checkproc ${DAEMON}
|
|
rc_status -v
|
|
;;
|
|
reload|force-reload)
|
|
echo -n "Reloading udevd: "
|
|
killproc -G -HUP ${DAEMON}
|
|
rc_status -v
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|status|reload|force-reload}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
rc_exit
|