Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 718114 - net-misc/netifrc-0.7.1 does not stop dhcpcd started with -4 or -6 command line parameter
Summary: net-misc/netifrc-0.7.1 does not stop dhcpcd started with -4 or -6 command lin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-19 06:38 UTC by drserge
Modified: 2020-09-07 09:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-net-dhcpcd.sh-fetch-pidfile-location-from-dhcpcd.patch (0001-net-dhcpcd.sh-fetch-pidfile-location-from-dhcpcd.patch,1.55 KB, patch)
2020-05-23 06:19 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details | Diff
0002-net-dhcpcd.sh-Put-user-args-into-a-temp-file.patch (0002-net-dhcpcd.sh-Put-user-args-into-a-temp-file.patch,2.03 KB, patch)
2020-05-23 06:21 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description drserge 2020-04-19 06:38:30 UTC
dhcpcd started with one of the -4 or -6 command line argument creates PID file with name dhcpcd-${IFACE}-{4,6}.pid, while dhcpcd.sh is looking only for dhcpcd-${IFACE}.pid to determine if dhcpcd is running for the interface netifrc is trying to stop.
Then the interface could not be started back as new dhcpcd instance checks all PID file names and determines that the previous instance is still running.

Reproducible: Always

Steps to Reproduce:
1. /etc/conf.d/net: dhcpcd_eth0="-4"
2. rc-service net.eth0 start
3. (dhcpcd-eth0-4.pid is created by 'dhcpcd -4')
4. rc-service net.eth0 stop
(the same for -6 option)
Actual Results:  
dhcpcd is still running as dhcpcd.sh could not find dhcpcd-eth0.pid to stop it, rc-service net.eth0 start could not start the interface back.

Expected Results:  
dhcpcd.sh should use dhcpcd -P to determine actual PID file name and stop running dhcpcd using the same args it was started with (https://roy.marples.name/cgit/dhcpcd.git/commit/?id=c85baeae3e9f3e1a0965bf956b59c74a9aa208e9).
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-05-23 06:19:22 UTC
Created attachment 640960 [details, diff]
0001-net-dhcpcd.sh-fetch-pidfile-location-from-dhcpcd.patch
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-05-23 06:21:25 UTC
Created attachment 640962 [details, diff]
0002-net-dhcpcd.sh-Put-user-args-into-a-temp-file.patch

Possible fix(es). The first patch is enough to fix the issue while the second patch IMHO is the better solution because it even works if a user has changed dhcpcd_args between start and stop of the corresponding interface.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2020-05-31 05:07:16 UTC
Merged, will be included in 0.7.2 release.
Comment 4 Larry the Git Cow gentoo-dev 2020-05-31 05:13:25 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=dd5a41de524cfdebe47425e70513f95f9937e406

commit dd5a41de524cfdebe47425e70513f95f9937e406
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2020-05-21 16:35:32 +0000
Commit:     Robin H. Johnson <robbat2@gentoo.org>
CommitDate: 2020-05-31 05:13:17 +0000

    net/dhcpcd.sh: fetch pidfile location from dhcpcd
    
    There's a -P switch for this but we also need to take into account the
    -4 and -6 switches as they both alter the pidfile's name.
    
    Bug: https://bugs.gentoo.org/718114
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

 net/dhcpcd.sh | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
Comment 5 Maciej S. Szmigiero 2020-07-05 13:49:29 UTC
It would be nice to either do a new netifrc release, or include this patch in netifrc 0.7.1 ebuild.

No current netifrc version in tree works correctly with the latest net-misc/dhcpcd, as it moves its PID file location to /run/dhcpcd/${IFACE}.pid from  /run/dhcpcd-${IFACE}.pid that the old code expected.
Comment 6 Larry the Git Cow gentoo-dev 2020-09-07 09:15:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e4296e80802f9fae11aed270f15903bbd2acc89

commit 9e4296e80802f9fae11aed270f15903bbd2acc89
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2020-09-07 09:06:29 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2020-09-07 09:14:59 +0000

    net-misc/netifrc: Revbump fixing issue with >=net-misc/dhcpcd-9.0.0
    
    Committed as revbump due to maintainer timeout...
    
    Closes: https://bugs.gentoo.org/718114
    Package-Manager: Portage-3.0.5, Repoman-3.0.1
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 .../files/netifrc-0.7.1-dhcpcd_args_tempfile.patch | 65 +++++++++++++++++++
 .../netifrc-0.7.1-dhcpcd_pidfile_location.patch    | 50 +++++++++++++++
 net-misc/netifrc/netifrc-0.7.1-r1.ebuild           | 75 ++++++++++++++++++++++
 3 files changed, 190 insertions(+)