1 |
commit: 6f98cf89f54a9ad1c9625577d100f6ca8b8a2b0b |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 20 16:53:59 2019 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 20 17:07:30 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/udev-gentoo-scripts.git/commit/?id=6f98cf89 |
7 |
|
8 |
Do not use the --daemon option in the udev service script |
9 |
|
10 |
Using this option does not allow OpenRC to show the status correctly |
11 |
since udevd doesn't write a pid file. |
12 |
We need to create the pidfile ourselves. |
13 |
|
14 |
Signed-off-by: William Hubbs <williamh <AT> gentoo.org> |
15 |
|
16 |
init.d/udev | 8 +++++--- |
17 |
1 file changed, 5 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/init.d/udev b/init.d/udev |
20 |
index 6ff21b2..d0f9d61 100644 |
21 |
--- a/init.d/udev |
22 |
+++ b/init.d/udev |
23 |
@@ -2,7 +2,9 @@ |
24 |
# Copyright 1999-2013 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
|
27 |
-command_args="--daemon ${udev_opts}" |
28 |
+command_args="${udev_opts}" |
29 |
+command_background=yes |
30 |
+pidfile=/run/udev.pid |
31 |
description="udev manages device permissions and symbolic links in /dev" |
32 |
extra_started_commands="reload" |
33 |
description_reload="Reload the udev rules and databases" |
34 |
@@ -79,11 +81,11 @@ stop() |
35 |
rc=$? |
36 |
if [ $rc -ne 0 ]; then |
37 |
eend $rc "Failed to stop $RC_SVCNAME using udevadm" |
38 |
- get_udevd_binary || return 1 |
39 |
ebegin "Trying with start-stop-daemon" |
40 |
- start-stop-daemon --stop --exec ${command} |
41 |
+ start-stop-daemon --stop --pidfile "${pidfile}" |
42 |
rc=$? |
43 |
fi |
44 |
+ [ $rc -eq 0 ] && rm -f "${pidfile}" |
45 |
eend $rc "Failed to stop $RC_SVCNAME" |
46 |
} |