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).
Created attachment 640960 [details, diff] 0001-net-dhcpcd.sh-fetch-pidfile-location-from-dhcpcd.patch
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.
Merged, will be included in 0.7.2 release.
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(-)
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.
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(+)