Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533262 - sys-apps/systemd - systemd-timsesyncd does not start in VMs (prevented by default configuration)
Summary: sys-apps/systemd - systemd-timsesyncd does not start in VMs (prevented by def...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL: https://bugs.debian.org/cgi-bin/bugre...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-22 07:37 UTC by Michael Mounteney
Modified: 2014-12-23 17:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Mounteney 2014-12-22 07:37:32 UTC
"timedatectl set-ntp true" has no effect, or at least is not reading its configuration information.

On my network, machine cortex is the NTP server.  The command:

ntpclient -h cortex -i 10

shows that the skew is increasing by between 40 and 150 microseconds every ten seconds.

The file /etc/systemd/timesyncd.conf contains the line:

NTP=cortex

This may be related to the Gentoo machine being virtual;  a KVM guest.  The command: "systemctl status systemd-timesyncd" outputs:

● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Mon 2014-12-22 17:08:47 AEST; 17min ago
           ConditionVirtualization=no was not met
     Docs: man:systemd-timesyncd.service(8)

The command "ntpclient -s -h cortex" resets the skew to about 420 microseconds.

Invoking /usr/lib/systemd/systemd-timesyncd directly causes the skew to settle at around 500 microseconds.

So the bug is that systemd's NTP does not work, by design or accident, on VM guest machines.
Comment 1 Matthias Maier gentoo-dev 2014-12-22 10:51:41 UTC
No, the point is that systemd's timesyncd does not run under virtualization environments per default configuration, as is evidenced by

  ConditionVirtualization=no was not met

in your configuration.

I'm not terribly convinced to change such upstream configuration in Gentoo - quite a bunch of good reasons not to enable it per default come to my mind.

Other Opinions? Otherwise, CANTFIX/INVALID.


Anyway, you can override this configuration by creating a small file

  /etc/systemd/system/systemd-timesyncd.service.d/override_virtualization.conf

containing

  [Unit]
  ConditionVritualization=

After that a

  # systemctl daemon-reload
  # systemctl restart systemd-timesyncd

should succeed. Whether it does anything meaningful is another question.
Comment 2 Matthias Maier gentoo-dev 2014-12-22 10:52:56 UTC
Typo:

> containing
> 
>   [Unit]
    ConditionVirtualization=
Comment 3 Michael Mounteney 2014-12-22 12:55:10 UTC
Thanks Matthias;  that does appear to fix it.  My reason for raising this as a bug is that it seems that there is, by design, no way to synchronise time on a virtual machine.  Maybe that's because it's expected that the time should remain synchronised by the host, but in fact, with KVM at least, that doesn't happen.