summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.d/udev17
1 files changed, 5 insertions, 12 deletions
diff --git a/init.d/udev b/init.d/udev
index 6aea5a5..4e618ca 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -73,19 +73,12 @@ start_pre() {
}
stop() {
- local rc
- rc=0
+ get_udevd_binary || return 1
ebegin "Stopping ${name:-$RC_SVCNAME}"
- udevadm control --exit
- rc=$?
- if [ $rc -ne 0 ]; then
- eend $rc "Failed to stop $RC_SVCNAME using udevadm"
- ebegin "Trying with start-stop-daemon"
- start-stop-daemon --stop --pidfile "${pidfile}"
- rc=$?
- fi
- [ $rc -eq 0 ] && rm -f "${pidfile}"
- eend $rc "Failed to stop $RC_SVCNAME"
+ udevadm control --exit ||
+ start-stop-daemon --stop --exec "${command}" --pidfile "${pidfile}" &&
+ rm -f "${pidfile}"
+ eend $? "Failed to stop $RC_SVCNAME"
}
reload() {