dhcpcd icon indicating copy to clipboard operation
dhcpcd copied to clipboard

dhcpcd --exit --persistent only works for manager

Open DanielG opened this issue 1 month ago • 3 comments

Hi Roy,

The following sequence will remove addressess at exit despite the -p option:

$ killall dhcpcd; dhcpcd wlan0; dhcpcd -x -p wlan0

whereas with a manager addressess are left alone as expected:

$ killall dhcpcd; dhcpcd -M wlan0; dhcpcd -x -p wlan0

Seems to me signal sending should be skipped if -p is given, falling back to sending a command to the daemon instead.

--Daniel

DanielG avatar Nov 06 '25 16:11 DanielG

I think the issue here is the first sequence is not being run in managed mode, so you're effectively trying to "run" dhcpcd twice instead of sending a command to the previously run instance? So it's just executing the exit, but ignoring any other options.

Are you expecting the first sequence to behave as if it were in managed mode (ie updating the currently running instance)?

ColinMcInnes avatar Nov 27 '25 15:11 ColinMcInnes

Similar to #548 ?

ColinMcInnes avatar Nov 27 '25 15:11 ColinMcInnes

@ColinMcInnes Look more closely at the code (or debug output or strace) please I already root-caused this on my end :-). LMK if you need pointers to the right spots.

The second command in the pairs will always talk to a daemon launched by the first, be that a manager or per-iface daemon. Either through signals or control commands both of which dhcpcd supports already (#ifdef USE_SIGNALS) but when the ifdef is enabled the former will be preferred.

This is merely an inconsidency in the details of that behaviour.

--Daniel

DanielG avatar Dec 07 '25 16:12 DanielG