summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2019-11-30 14:07:34 -0600
committerWilliam Hubbs <williamh@gentoo.org>2019-11-30 14:07:44 -0600
commitefdd416d20966196cf0ac8dd3231c5919b984ae8 (patch)
tree021ca49eda3a85514acc55fd783fc50def3d6528
parentDo not use the --daemon option in the udev service script (diff)
downloadudev-gentoo-scripts-efdd416d20966196cf0ac8dd3231c5919b984ae8.tar.gz
udev-gentoo-scripts-efdd416d20966196cf0ac8dd3231c5919b984ae8.tar.bz2
udev-gentoo-scripts-efdd416d20966196cf0ac8dd3231c5919b984ae8.zip
init.d: style fixes
Signed-off-by: William Hubbs <williamh@gentoo.org>
-rw-r--r--init.d/udev20
-rw-r--r--init.d/udev-settle8
-rw-r--r--init.d/udev-trigger23
3 files changed, 21 insertions, 30 deletions
diff --git a/init.d/udev b/init.d/udev
index d0f9d61..6aea5a5 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -9,17 +9,17 @@ description="udev manages device permissions and symbolic links in /dev"
extra_started_commands="reload"
description_reload="Reload the udev rules and databases"
-depend()
-{
+depend() {
need sysfs dev-mount
before checkfs fsck
keyword -lxc -systemd-nspawn -vserver
}
get_udevd_binary() {
- local bins="/sbin/udevd /lib/systemd/systemd-udevd /usr/lib/systemd/systemd-udevd"
+ local bins
+ bins="/sbin/udevd /lib/systemd/systemd-udevd /usr/lib/systemd/systemd-udevd"
for f in ${bins}; do
- if [ -x "$f" -a ! -L "$f" ]; then
+ if [ -x "$f" ] && [ ! -L "$f" ]; then
command="$f"
fi
done
@@ -29,8 +29,7 @@ get_udevd_binary() {
fi
}
-start_pre()
-{
+start_pre() {
# make sure devtmpfs is in the kernel
if ! grep -qs devtmpfs /proc/filesystems; then
eerror "CONFIG_DEVTMPFS=y is required in your kernel configuration"
@@ -73,9 +72,9 @@ start_pre()
return 0
}
-stop()
-{
- local rc=0
+stop() {
+ local rc
+ rc=0
ebegin "Stopping ${name:-$RC_SVCNAME}"
udevadm control --exit
rc=$?
@@ -89,8 +88,7 @@ stop()
eend $rc "Failed to stop $RC_SVCNAME"
}
-reload()
-{
+reload() {
ebegin "reloading udev rules and databases"
udevadm control --reload
eend $?
diff --git a/init.d/udev-settle b/init.d/udev-settle
index c495769..f6e0707 100644
--- a/init.d/udev-settle
+++ b/init.d/udev-settle
@@ -2,18 +2,16 @@
# Copyright 2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-depend()
-{
+depend() {
need udev
after udev-trigger
provide dev-settle
keyword -lxc -systemd-nspawn -vserver
}
-start()
-{
+start() {
ebegin "Waiting for uevents to be processed"
udevadm settle \
- ${udev_settle_timeout:+--timeout=}$udev_settle_timeout
+ ${udev_settle_timeout:+--timeout=}"${udev_settle_timeout}"
eend $?
}
diff --git a/init.d/udev-trigger b/init.d/udev-trigger
index bdd4884..dfca873 100644
--- a/init.d/udev-trigger
+++ b/init.d/udev-trigger
@@ -7,15 +7,13 @@ description="udev Coldplug all Devices"
udevmonitor_log=/run/udevmonitor.log
udevmonitor_pid=/run/udevmonitor.pid
-depend()
-{
+depend() {
need udev
provide dev
keyword -lxc -systemd-nspawn -vserver
}
-start_pre()
-{
+start_pre() {
if yesno "${udev_monitor:-no}"; then
einfo "Running udevadm monitor ${udev_monitor_opts} to log all events"
start-stop-daemon --start --stdout "${udevmonitor_log}" \
@@ -25,9 +23,8 @@ start_pre()
return 0
}
-display_hotplugged_services()
-{
- local svcfile= svc= services=
+display_hotplugged_services() {
+ local svcfile svc services
for svcfile in "${RC_SVCDIR}"/hotplugged/*; do
svc="${svcfile##*/}"
[ -x "${svcfile}" ] || continue
@@ -38,8 +35,7 @@ display_hotplugged_services()
return 0
}
-start_post()
-{
+start_post() {
if yesno "${udev_monitor:-no}"; then
if yesno "${udev_monitor_keep_running:-no}"; then
ewarn "udevmonitor is still writing into ${udevmonitor_log}"
@@ -56,9 +52,9 @@ start_post()
# This is here because some software expects /dev/root to exist.
# For more information, see this bug:
# https://bugs.gentoo.org/show_bug.cgi?id=438380
-dev_root_link()
-{
- local RULESDIR=/run/udev/rules.d
+dev_root_link() {
+ local RULESDIR
+ RULESDIR=/run/udev/rules.d
[ -d $RULESDIR ] || mkdir -p $RULESDIR
eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/ ||
true)
@@ -71,8 +67,7 @@ dev_root_link()
return 0
}
-start()
-{
+start() {
if yesno ${rc_dev_root_symlink:-yes}; then
ebegin "Generating a rule to create a /dev/root symlink"
dev_root_link