summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-09-08 17:00:08 +0100
committerGitHub <noreply@github.com>2026-09-08 17:00:08 +0100
commit438463db0d290e58cb733893478cdb4537d922f8 (patch)
tree03aeab01eeb742caf5b454e88c3944a94e669498 /data
parente152d756fdd9d43c31e3ce3a79c64370f2df9615 (diff)
parente091ee7220efa89d3e9566db12279a771fba17a2 (diff)
downloadvyos-1x-438463db0d290e58cb733893478cdb4537d922f8.tar.gz
vyos-1x-438463db0d290e58cb733893478cdb4537d922f8.zip
Merge pull request #5446 from c-po/dhcp-static-route-flakiness
static: T9278: reconcile FRR config after every DHCP lease event
Diffstat (limited to 'data')
-rw-r--r--data/templates/dhcp-client/dhcp6c-script.j232
1 files changed, 30 insertions, 2 deletions
diff --git a/data/templates/dhcp-client/dhcp6c-script.j2 b/data/templates/dhcp-client/dhcp6c-script.j2
index 14fb25cf6..1df690a5a 100644
--- a/data/templates/dhcp-client/dhcp6c-script.j2
+++ b/data/templates/dhcp-client/dhcp6c-script.j2
@@ -2,6 +2,34 @@
# Update DNS information for DHCPv6 clients
# should be used only if vyos-hostsd is running
+# This script is executed standalone by dhcp6c and can not source the dhclient
+# hook /etc/dhcp/dhclient-enter-hooks.d/01-vyos-logging, which is only pulled
+# into the dhclient-script shell. It therefore carries its own logmsg() - keep
+# the tag, the priorities and the debug flag file in sync with that file.
+LOG_TAG="dhclient-script-vyos"
+LOG_DEBUG_ENABLE="/tmp/vyos.dhclient.debug"
+
+logmsg () {
+ log_level=$1
+ shift
+
+ case ${log_level} in
+ debug)
+ # Do not even build the message when debugging is not requested
+ [ -f "${LOG_DEBUG_ENABLE}" ] || return 0
+ log_prio="daemon.debug" ;;
+ info) log_prio="daemon.info" ;;
+ warn) log_prio="daemon.warning" ;;
+ error) log_prio="daemon.err" ;;
+ *)
+ # Unknown level - do not lose the message, it was never a level
+ log_prio="daemon.info"
+ set -- "${log_level}" "$@" ;;
+ esac
+
+ /usr/bin/logger -e --id=$$ -p ${log_prio} -t ${LOG_TAG} "$@"
+}
+
if /usr/bin/systemctl -q is-active vyos-hostsd; then
hostsd_client="/usr/bin/vyos-hostsd-client"
hostsd_changes=
@@ -23,9 +51,9 @@ if /usr/bin/systemctl -q is-active vyos-hostsd; then
fi
if [ $hostsd_changes ]; then
- logmsg info "Applying changes via vyos-hostsd-client"
+ logmsg debug "Applying changes via vyos-hostsd-client"
$hostsd_client --apply
else
- logmsg info "No changes to apply via vyos-hostsd-client"
+ logmsg debug "No changes to apply via vyos-hostsd-client"
fi
fi