Public bug reported:

Network manager gets NTP servers from DHCP but do not update timesyncd to use 
it which keeps using ntp.ubuntu.com.
 
This is a problem on private networks which do not have access to public 
internet. On this type of network the configuration of timesyncd must be 
updated manually instead of inheriting the conf from the dhcp servers.

This can be integrated with a NM dispatcher script such as below:

etc/NetworkManager/dispatcher.d/10-update-timesyncd for example:

==8<=====8<=====8<=====8<=====8<==
#! /usr/bin/bash

[ -n "$CONNECTION_UUID" ] || exit

INTERFACE=$1
ACTION=$2

case $ACTION in
    up | dhcp4-change | dhcp6-change)
        [ -n "$DHCP4_NTP_SERVERS" ] || exit
        mkdir -p /etc/systemd/timesyncd.conf.d/
        cat<<EOF > /etc/systemd/timesyncd.conf.d/$CONNECTION_UUID.conf
[Time]
NTP=$DHCP4_NTP_SERVERS
RootDistanceMaxSec=15
EOF
        systemctl restart systemd-timesyncd
       ;;
    down)
        rm -f /etc/systemd/timesyncd.conf.d/$CONNECTION_UUID.conf
        systemctl restart systemd-timesyncd
        ;;
esac
==8<=====8<=====8<=====8<=====8<==

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: network-manager 1.30.0-1ubuntu3
ProcVersionSignature: Ubuntu 5.11.0-18.19+21.10.1-generic 5.11.17
Uname: Linux 5.11.0-18-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu67
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Mon Jun 28 14:08:52 2021
InstallationDate: Installed on 2020-05-31 (393 days ago)
InstallationMedia: Ubuntu 20.10 "Groovy Gorilla" - Alpha amd64 (20200527)
RebootRequiredPkgs:
 linux-image-5.11.0-20-generic
 linux-base
SourcePackage: network-manager
UpgradeStatus: No upgrade log present (probably fresh install)
nmcli-nm:
 RUNNING  VERSION  STATE      STARTUP  CONNECTIVITY  NETWORKING  WIFI-HW  WIFI  
    WWAN-HW  WWAN    
 running  1.30.0   connected  started  full          enabled     enabled  
disabled  enabled  enabled

** Affects: network-manager (Ubuntu)
     Importance: High
         Status: New


** Tags: amd64 apport-bug impish

** Changed in: network-manager (Ubuntu)
   Importance: Undecided => High

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

Title:
  NTP servers from DCHP are not propagated to timesyncd

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1933828/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to