1 |
commit: dd5a41de524cfdebe47425e70513f95f9937e406 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 21 16:35:32 2020 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 31 05:13:17 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=dd5a41de |
7 |
|
8 |
net/dhcpcd.sh: fetch pidfile location from dhcpcd |
9 |
|
10 |
There's a -P switch for this but we also need to take into account the |
11 |
-4 and -6 switches as they both alter the pidfile's name. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/718114 |
14 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
15 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
16 |
|
17 |
net/dhcpcd.sh | 13 +++++++++++-- |
18 |
1 file changed, 11 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/net/dhcpcd.sh b/net/dhcpcd.sh |
21 |
index 0a306b8..c0639e0 100644 |
22 |
--- a/net/dhcpcd.sh |
23 |
+++ b/net/dhcpcd.sh |
24 |
@@ -16,9 +16,12 @@ _config_vars="$_config_vars dhcp dhcpcd" |
25 |
|
26 |
dhcpcd_start() |
27 |
{ |
28 |
- local args= opt= opts= pidfile="/run/dhcpcd-${IFACE}.pid" new=true |
29 |
+ # check for pidfile after we gathered the user's opts because they can |
30 |
+ # alter the pidfile's name (#718114) |
31 |
+ local args= opt= pidfile= opts= new=true |
32 |
eval args=\$dhcpcd_${IFVAR} |
33 |
[ -z "${args}" ] && args=${dhcpcd} |
34 |
+ pidfile="$(dhcpcd -P ${args} ${IFACE})" |
35 |
|
36 |
# Get our options |
37 |
eval opts=\$dhcp_${IFVAR} |
38 |
@@ -75,7 +78,13 @@ dhcpcd_start() |
39 |
|
40 |
dhcpcd_stop() |
41 |
{ |
42 |
- local pidfile="/run/dhcpcd-${IFACE}.pid" opts= sig=SIGTERM |
43 |
+ local args= pidfile= opts= sig=SIGTERM |
44 |
+ |
45 |
+ # check for pidfile after we gathered the user's opts because they can |
46 |
+ # alter the pidfile's name (#718114) |
47 |
+ eval args=\$dhcpcd_${IFVAR} |
48 |
+ [ -z "${args}" ] && args=${dhcpcd} |
49 |
+ pidfile="$(dhcpcd -P ${args} ${IFACE})" |
50 |
[ ! -f "${pidfile}" ] && return 0 |
51 |
|
52 |
ebegin "Stopping dhcpcd on ${IFACE}" |