man dhcpcd -- snip -- -c <ExecFilePath> dhcpcd will try to execute <ExecFilePath> script instead of default /etc/dhcpc/dhcpcd.exe script every time it configures or brings down the interface. See the description of dhcpcd.exe script in FILES section below. ps auxww | grep dhcpcd /sbin/dhcpcd -h bubba -R -N -d -o -m 0 -c /lib/rcscripts/net.modules.d/helpers.d/dhcpcd-wrapper -e /var/lib/net-scripts/state/eth0 eth0 grep exe /lib/rcscripts/net.modules.d/helpers.d/dhcpcd-wrapper Unless I missed something here, the expected behavior of dhcpcd executing /etc/dhcpc/dhcpcd.exe just isn't happening. Perhaps something needs to happen in /etc/conf.d/net? Perhaps /lib/rcscripts/net.modules.d/helpers.d/dhcpcd-wrapper should call the default dhcpcd exe script?
I've really missed the point of this bug... the wrapper script is in /lib/rcscripts/net.modules.d/helpers.d/dhcpcd-wrapper and dhcpcd calls it w/ -c option as per man page. Closing INVALID.
It seems that you've missed my point. Let me give you a real world scenario: My machine at home uses dhcp to get its IP address from my cable modem provider. In the past, I've used the dhcpcd.exe file (per the man page) to 1) update my host name against my dyndns, 2) setup my somewhat complicated ipsec tunnel to my office, and 3) run my iptables script to reflect the new IP. This was actually working in gentoo, but then suddenly stopped working, because of the bug I've reported here. So, unless gentoo provides me the ability to always run a script when my dhcp comes up, I'm going to insist that this is a bug. So how about a few suggestions: 1) Make /lib/rcscripts/net.modules.d/helpers.d/dhcpcd-wrapper shell out to /etc/dhcpc/dhcpcd.exe, if present and executable, with the expected arguments. 2) Provide some sort of facility in /etc/conf.d/net to execute an arbitrary script when dhcp, be it dhcpcd or dhclient or whatever, obtains a new IP address. Thoughts?
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=5#doc_chap1 You can write a postup() function in /etc/conf.d/net which would work just as well and would work for all dhcp clients (dhcpcd isn't the only choice). Example postup() { local ip=$( interface_get_address "${IFACE}" ) # Strip the CIDR part returned by baselayout-1.12.0 ip="${ip%%/*}" register_dns_program "${ip}" $( hostname ) } Of course, we can always let the dhcpcd wrapper run a script as well
Created attachment 70227 [details, diff] allows the use of the -c dhcpcd option
Please test the above patch against baselayout-1.12.0_pre8 and tell me if it works or not. Thanks!
The patch didn't apply cleanly to baselayout-1.12.0_pre8-r2, which seems to be the latest ~x86. If you provide such a patch, I'll gladly test it.
pre9 is now in portage with this patch included
I'll test it once baselayout-1.12.0_pre9 hits portage and report back here.
Works great. Thanks.
Oops, clicked the wrong radio button.