commit:     6f98cf89f54a9ad1c9625577d100f6ca8b8a2b0b
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 20 16:53:59 2019 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Feb 20 17:07:30 2019 +0000
URL:        
https://gitweb.gentoo.org/proj/udev-gentoo-scripts.git/commit/?id=6f98cf89

Do not use the --daemon option in the udev service script

Using this option does not allow OpenRC to show the status correctly
since udevd doesn't write a pid file.
We need to create the pidfile ourselves.

Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 init.d/udev | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/init.d/udev b/init.d/udev
index 6ff21b2..d0f9d61 100644
--- a/init.d/udev
+++ b/init.d/udev
@@ -2,7 +2,9 @@
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-command_args="--daemon ${udev_opts}"
+command_args="${udev_opts}"
+command_background=yes
+pidfile=/run/udev.pid
 description="udev manages device permissions and symbolic links in /dev"
 extra_started_commands="reload"
 description_reload="Reload the udev rules and databases"
@@ -79,11 +81,11 @@ stop()
        rc=$?
        if [ $rc -ne 0 ]; then
                eend $rc "Failed to stop $RC_SVCNAME using udevadm"
-               get_udevd_binary || return 1
                ebegin "Trying with start-stop-daemon"
-               start-stop-daemon --stop --exec ${command}
+               start-stop-daemon --stop --pidfile "${pidfile}"
                rc=$?
        fi
+       [ $rc -eq 0 ] && rm -f "${pidfile}"
        eend $rc "Failed to stop $RC_SVCNAME"
 }
 

Reply via email to