← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1756987] Re: chrony install does not stop systemd-timesyncd

 

The way the newer versions solve this is to have a native systemd
service and in there there is:

Conflicts=systemd-timesyncd.service openntpd.service

That ensures only one of these can be started.

Xenial has no systemd service at all, it has sysV and uses the systemd generator.
So there is no "just add the line" fix available.

Xenial as-is
$ timedatectl status
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no
systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: active (running) since Wed 2018-03-21 16:00:19 UTC; 1min 30s ago

This isn't even fully protected if you install ntp (not chrony) as it
was the ntp server back in Xenial. (Right after install it still runs).

What stops it there for NTPd is that this uses a config dir which pulls in:
  /lib/systemd/system/systemd-timesyncd.service.d/disable-with-time-daemon.conf

So any further starts will be blocked:
# don't run timesyncd if we have another NTP daemon installed
ConditionFileIsExecutable=!/usr/sbin/ntpd
ConditionFileIsExecutable=!/usr/sbin/openntpd
ConditionFileIsExecutable=!/usr/sbin/chronyd
ConditionFileIsExecutable=!/usr/sbin/VBoxService

You see that if you check systemd-timesyncd.service:
$ systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Wed 2018-03-21 16:06:42 UTC; 44s ago
           ConditionFileIsExecutable=!/usr/sbin/ntpd was not met

After installing Chrony this is the same:

Condition: start condition failed at Wed 2018-03-21 16:11:37 UTC; 1s ago
           ConditionFileIsExecutable=!/usr/sbin/chronyd was not met

That is good (no special issue to chrony) and bad (actually all
timeservers "collide" right after install).

A reboot or restart will pick that up.
OTOH it is discouraged to start/stop/restart other packages services form a postinst - as the first thought would be to do refresh for that condition after installing any of these.

Given that there was not a single complaint about it in 2 years of
Xenial other than us now looking for it in detail I'd rate it low, but
it is a valid issue.

** Also affects: ntp (Ubuntu)
   Importance: Undecided
       Status: New

** Also affects: openntpd (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: ntp (Ubuntu Xenial)
       Status: New => Confirmed

** Changed in: ntp (Ubuntu Xenial)
   Importance: Undecided => Low

** Changed in: chrony (Ubuntu Bionic)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1756987

Title:
  chrony install does not stop systemd-timesyncd

Status in chrony package in Ubuntu:
  Fix Released
Status in ntp package in Ubuntu:
  New
Status in openntpd package in Ubuntu:
  New
Status in chrony source package in Xenial:
  New
Status in ntp source package in Xenial:
  Confirmed
Status in openntpd source package in Xenial:
  New
Status in chrony source package in Artful:
  New
Status in ntp source package in Artful:
  New
Status in openntpd source package in Artful:
  New
Status in chrony source package in Bionic:
  Fix Released
Status in ntp source package in Bionic:
  New
Status in openntpd source package in Bionic:
  New

Bug description:
  1.
  root@ubuntu:~# lsb_release -rd
  Description:	Ubuntu 16.04.4 LTS
  Release:	16.04

  root@ubuntu:~# uname -a
  Linux ubuntu 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

  2. 
  root@ubuntu:~# apt-cache policy systemd
  systemd:
    Installed: 229-4ubuntu21.1
    Candidate: 229-4ubuntu21.1
    Version table:
   *** 229-4ubuntu21.1 500
          500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
          500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
          100 /var/lib/dpkg/status
       229-4ubuntu4 500
          500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
  root@ubuntu:~# apt-cache policy chrony
  chrony:
    Installed: 2.1.1-1
    Candidate: 2.1.1-1
    Version table:
   *** 2.1.1-1 500
          500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
          100 /var/lib/dpkg/status

  3. installing chrony should stop systemd-timesyncd so they both don't
  try to adjust time

  4. after chrony is installed both systemd-timesyncd and chronyd are
  running.

  root@ubuntu:~# ps aux | egrep "(chrony|timesync)"
  systemd+  1086  0.0  0.2 100324  2368 ?        Ssl  19:34   0:00 /lib/systemd/systemd-timesyncd
  _chrony   2770  0.0  0.2 105780  2920 ?        S    19:38   0:00 /usr/sbin/chronyd
  root      3077  0.0  0.0  12944   924 pts/0    S+   19:52   0:00 grep -E --color=auto (chrony|timesync)

  
  Note, on bionic the chrony package successfully stops systemd-timesyncd and only chronyd remains running after install.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: chrony 2.1.1-1
  ProcVersionSignature: Ubuntu 4.4.0-116.140-generic 4.4.98
  Uname: Linux 4.4.0-116-generic x86_64
  ApportVersion: 2.20.1-0ubuntu2.15
  Architecture: amd64
  Date: Mon Mar 19 19:51:06 2018
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: chrony
  UpgradeStatus: No upgrade log present (probably fresh install)

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


References