From 18c11228433f630b41a763fa40f1fc9817d32a2a Mon Sep 17 00:00:00 2001 From: Yang Song Date: Tue, 7 Jan 2025 09:48:58 +0000 Subject: [PATCH] [pd] Disable PD daemon which caused mDNS disruptions --- script/_dhcpv6_pd_ref | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/script/_dhcpv6_pd_ref b/script/_dhcpv6_pd_ref index e0b950617eb..84fbd395b9c 100644 --- a/script/_dhcpv6_pd_ref +++ b/script/_dhcpv6_pd_ref @@ -137,9 +137,31 @@ dhcpv6_pd_ref_install() create_dhcpcd_conf_no_pd create_dhcp6_pd_daemon_service + # The dhcp6_pd_daemon is currently disabled because it restarts dhcpcd + # when the PD state changes. This restart disrupts mDNS, causing + # connectivity issues. The daemon and its associated systemd service + # files are still installed for potential future use. + # + # TODO: Re-enable and start the daemon when a solution is found + # for dhcpcd restarts breaking mDNS. + # + # if have systemctl; then + # sudo systemctl daemon-reload + # sudo systemctl enable ${PD_DAEMON_SERVICE_NAME} + # sudo systemctl start ${PD_DAEMON_SERVICE_NAME} + # fi + + # Always enable PD, which is a workaround for the currently disabled + # dhcp6_pd_daemon which caused mDNS disruptions. + sudo cp ${DHCP_CONFIG_PD_PATH} ${DHCP_CONFIG_PATH} + if have systemctl; then sudo systemctl daemon-reload - sudo systemctl enable ${PD_DAEMON_SERVICE_NAME} - sudo systemctl start ${PD_DAEMON_SERVICE_NAME} + + # Restart dhcpcd only if it's running. This is unnecessary when the dhcp6_pd_daemon + # is enabled,as the daemon will handle dhcpcd restarts based on PD state changes. + if systemctl is-active dhcpcd; then + sudo systemctl restart dhcpcd || true + fi fi }