Reproducer

#!/bin/bash
set -eu
IF=$(ls /sys/class/net | grep -v lo | head -1)

echo "== chrony $(dpkg-query -W -f='${Version}' chrony), hooks installed: =="
ls /usr/lib/networkd-dispatcher/*.d/*

# Only IPv4 sources
mv -f /etc/chrony/sources.d/ubuntu-ntp-pools.sources /root/ 2>/dev/null || true
printf 'server 185.125.190.121 iburst\nserver 185.125.190.122 iburst\nserver 
91.189.91.112 iburst\n' \
    > /etc/chrony/conf.d/ipv4only.conf
systemctl restart chrony; sleep 20
chronyc online > /dev/null 2>&1; sleep 5
START=$(date -u +%H:%M:%S)
echo "== baseline at $START =="; chronyc -n sources

nft add table netdev flap
nft "add chain netdev flap ing { type filter hook ingress device $IF priority 
0; }"
nft add rule netdev flap ing udp sport 67 drop

ip link set "$IF" down; sleep 5; ip link set "$IF" up
sleep 40
nft delete table netdev flap
sleep 60

echo "== result at $(date -u +%H:%M:%S), route back for ~60s =="
ip -4 r | head -1
chronyc -n sources
if chronyc -n sources | awk 'NR>2 && $5 == 0 {bad++} END {exit !bad}'; then
    echo "FAIL: sources left offline after the link came back"
    exit 1
fi
echo "PASS: sources restored"

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2161782

Title:
  chrony: NTP sources left permanently offline after link flap;
  networkd-dispatcher hook runs before the interface is usable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/chrony/+bug/2161782/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to