From 558ca760a90eb4f558216c7992c70e18bedb36ca Mon Sep 17 00:00:00 2001 From: Yang Song Date: Thu, 31 Oct 2024 07:48:53 +0000 Subject: [PATCH] Add pd daemon service: using systemd to run pd daemon service --- script/_dhcpv6_pd_ref | 71 ++++++++++++++--- script/reference-device/dhcp6_pd_daemon.py | 91 ++++++++++++++-------- script/reference-device/dhcpcd.enter-hook | 13 +++- script/reference-device/dhcpcd.exit-hook | 10 ++- 4 files changed, 139 insertions(+), 46 deletions(-) diff --git a/script/_dhcpv6_pd_ref b/script/_dhcpv6_pd_ref index b431ce625da..9f03afc7513 100644 --- a/script/_dhcpv6_pd_ref +++ b/script/_dhcpv6_pd_ref @@ -30,15 +30,41 @@ # This script manipulates DHCPv6-PD-REF configuration. # -customise_dhcpcd_conf() +DHCPCD_ENTER_HOOK="/etc/dhcpcd.enter-hook" +DHCPCD_EXIT_HOOK="/etc/dhcpcd.exit-hook" + +PD_DAEMON_DIR="/opt/pd-daemon" +PD_DAEMON_PATH="${PD_DAEMON_DIR}/dhcp6_pd_daemon.py" +PD_DAEMON_SERVICE_NAME="dhcp6_pd_daemon.service" +PD_DAEMON_SERVICE_PATH="/etc/systemd/system/${PD_DAEMON_SERVICE_NAME}" + +create_pd_dhcpcd_conf() { - # This has to be run after script/_border_routing, and this will - # invalidate all changes to dhcpcd.conf made by script/_border_routing. - sudo tee /etc/dhcpcd.conf >/dev/null </dev/null <