Run dhcpcd in manager mode
There are plans for dhcpcd to switch to "manager" mode only in version 11. See https://github.com/NetworkConfiguration/dhcpcd/discussions/271.
In this mode, only one instance of dhcpcd can run; privilege separated proxies are started for each interface / address as needed. The current Alpine setup, coordinated between dhcpcd's init script and ifupdown starts a separate process per interface which will no longer be allowed.
Changes will need to be made to aports for dhcpcd and ifupdown-ng to support this (maybe the Debian ifupdown port too, depending on deprecation status):
- In /etc/init.d/dhcpcd, remove
provide net
and change before dns tobefore networking dns
- Make sure dhcpcd is set to run at the boot run level, not default.
- In /usr/libexec/ifupdown-ng/dhcp, change the start command to /sbin/dhcpcd -q -n $optargs $IFACE (adding -n). This makes ifup rebind instead of starting in non-manager mode. The stop function, for ifdown, already had -k in the args.
There may be a more subtle way to get dhcpcd to start before any interfaces are ifup'ed but the first 2 steps as brute force work well enough. dhcpcd is smart enough to wait for carrier status (i.e. ifup) before trying to make dhcp requests, so it's ok to start before networking, then ifup all the interfaces, then let ifupdown-ng's use dhcp
trigger the rebind (and a possible router solicitation for ipv6).
Not sure if making the changes to ifupdown-ng in the aport make sense or if it's better to push to upstream since this is a general issue for any ifupdown-ng user.
Note that these changes can be made now since the configuration of dhcpcd 10 is identical.