summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2013-03-19 12:20:43 -0500
committerWilliam Hubbs <williamh@gentoo.org>2013-03-19 12:20:43 -0500
commit7642c09da2caac6a9f4b510158f8faefb02315a3 (patch)
tree3fc71e3dc0e1e349ccd34e9a56957161ef0c0d7c
parentudev: fix permissions and symlinks when rc_coldplug="no" (diff)
downloadudev-gentoo-scripts-7642c09da2caac6a9f4b510158f8faefb02315a3.tar.gz
udev-gentoo-scripts-7642c09da2caac6a9f4b510158f8faefb02315a3.tar.bz2
udev-gentoo-scripts-7642c09da2caac6a9f4b510158f8faefb02315a3.zip
re-arrange variable settings
Move the settings for udevmonitor_pid and udevmonitor_log to global scope since they are used in two functions. Also, we do not need to set the rc_coldplug, udev_debug, udev_monitor_keep_running and udev_settle_timeout to their default values in global scope; we can just use the default values when we refer to the variables.
-rw-r--r--init.d/udev17
1 files changed, 6 insertions, 11 deletions
diff --git a/init.d/udev b/init.d/udev
index f21361b..a2f0ec1 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -7,11 +7,9 @@ description="udev manages device permissions and symbolic links in /dev"
extra_started_commands="reload"
description_reload="Reload the udev rules and databases"
-rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}}
-udev_debug="${udev_debug:-no}"
udev_monitor="${udev_monitor:-no}"
-udev_monitor_keep_running="${udev_monitor_keep_running:-no}"
-udev_settle_timeout="${udev_settle_timeout:-60}"
+udevmonitor_log=/run/udevmonitor.log
+udevmonitor_pid=/run/udevmonitor.pid
depend()
{
@@ -53,7 +51,7 @@ start_pre()
fi
fi
- if yesno "${udev_debug}"; then
+ if yesno "${udev_debug:-NO}"; then
command_args="${command_args} --debug 2> /run/udevdebug.log"
fi
@@ -89,9 +87,6 @@ start_udevmonitor()
{
yesno "${udev_monitor}" || return 0
- udevmonitor_log=/run/udevmonitor.log
- udevmonitor_pid=/run/udevmonitor.pid
-
einfo "udev: Running udevadm monitor ${udev_monitor_opts} to log all events"
start-stop-daemon --start --stdout "${udevmonitor_log}" \
--make-pidfile --pidfile "${udevmonitor_pid}" \
@@ -101,7 +96,7 @@ start_udevmonitor()
populate_dev()
{
get_bootparam "nocoldplug" && rc_coldplug="no"
- if ! yesno $rc_coldplug; then
+ if ! yesno ${rc_coldplug:-${RC_COLDPLUG:-yes}}; then
einfo "Setting /dev permissions and symbolic links"
udevadm trigger --attr-match=dev --action=add
ewarn "Skipping udev coldplug sequence"
@@ -114,7 +109,7 @@ populate_dev()
eend $?
ebegin "Waiting for uevents to be processed"
- udevadm settle --timeout=${udev_settle_timeout}
+ udevadm settle --timeout=${udev_settle_timeout:-60}
eend $?
return 0
}
@@ -123,7 +118,7 @@ stop_udevmonitor()
{
yesno "${udev_monitor}" || return 0
- if yesno "${udev_monitor_keep_running}"; then
+ 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}"