diff options
Diffstat (limited to 'sys-fs/udev/files/136/udev.initd')
-rw-r--r-- | sys-fs/udev/files/136/udev.initd | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/sys-fs/udev/files/136/udev.initd b/sys-fs/udev/files/136/udev.initd index 1707ccea7737..a9c98fb5cbb3 100644 --- a/sys-fs/udev/files/136/udev.initd +++ b/sys-fs/udev/files/136/udev.initd @@ -90,13 +90,39 @@ populate_dev() eend $? ebegin "Waiting for uevents to be processed" - udevadm settle --timeout=60 + udevadm settle --timeout=${udev_settle_timeout:-60} eend $? udevadm control --env do_not_run_plug_service= return 0 } +# for debugging +start_udevmonitor() +{ + yesno "${udev_monitor:-no}" || return 0 + + udevmonitor_log=/dev/.udev/udevmonitor.log + udevmonitor_pid=/dev/.udev/udevmonitor.pid + + einfo "udev: Running udevadm monitor ${udev_monitor_opts} to get a log of all events" + start-stop-daemon --start --stdout "${udevmonitor_log}" \ + --make-pidfile --pidfile "${udevmonitor_pid}" \ + --background --exec /sbin/udevadm -- monitor ${udev_monitor_opts} +} + +stop_udevmonitor() +{ + yesno "${udev_monitor:-no}" || return 0 + + if yesno "${udev_monitor_keep_running:-no}"; then + ewarn "udev: udevmonitor is still running and writing into ${udevmonitor_log}" + else + einfo "udev: Stopping udevmonitor: Log is in ${udevmonitor_log}" + start-stop-daemon --stop --pidfile "${udevmonitor_pid}" --exec /sbin/udevadm + fi +} + display_hotplugged_services() { local svcfile= svc= services= for svcfile in "${RC_SVCDIR}"/hotplugged/*; do @@ -191,11 +217,13 @@ _start() disable_hotplug_agent start_udevd || cleanup + start_udevmonitor populate_dev || cleanup check_persistent_net check_udev_works || cleanup + stop_udevmonitor return 0 } |