You are not logged in.

#1 2015-12-03 05:20:11

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

[SOLVED] NTP in a VM

Hey everyone.  I actually have two questions but I think I'll split them up into two different threads, as they may be unrelated..The first is about running NTP on Bunsenlabs, that's being run in a VM. My situation is from a cold boot, NTP works like a charm.


The main issue is when my computer falls into sleep mode, the NTP process on bunsen, in the vm, seems to stall. When I bring it back up from sleep, and open up the vm, the time is now lagged, by the amount the computer was sleeping. But when I do a

systemctl -l | grep ntp  

It shows the process as active/running. The same is true when I do a

systemctl status ntp

the process is still active running. In fact it shows an uptime of however long it's been on since the intial cold boot. It doesn't show any sign that it stopped.  With that being said, no ntp queries are being made anymore. In fact when I run a:

ntpq -p  

To show a list of my peers, I get a connection refused message. As well as when I perform a

timedatectl status  

This returns a NTP enabled : no


So to wrap this up, I'm getting conflicting reports here...systemctl says that ntp is up and running.
This timedatectl  (which I just learned about today) is showing a status of NTP not running.

This only happens when the computer goes into sleep mode, thus putting the VM into a suspend mode I'm guessing.

Last edited by Horizon_Brave (2015-12-10 22:29:13)


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#2 2015-12-03 07:54:00

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [SOLVED] NTP in a VM

Horizon_Brave wrote:

timedatectl  (which I just learned about today) is showing a status of NTP not running

From timedatectl(1):

set-ntp [BOOL]
           Takes a boolean argument. Controls whether NTP based network time
           synchronization is enabled (if available).

So try:

timedatectl set-ntp true

I'm in OpenBSD at the moment so I can't test this.

Have you enabled the NTP daemon?

I prefer openntpd, obviously tongue


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2015-12-03 14:20:42

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: [SOLVED] NTP in a VM

Horizon_Brave wrote:

Hey everyone.  I actually have two questions but I think I'll split them up into two different threads, as they may be unrelated..The first is about running NTP on Bunsenlabs, that's being run in a VM. My situation is from a cold boot, NTP works like a charm.


The main issue is when my computer falls into sleep mode, the NTP process on bunsen, in the vm, seems to stall. When I bring it back up from sleep, and open up the vm, the time is now lagged, by the amount the computer was sleeping. But when I do a

systemctl -l | grep ntp  

It shows the process as active/running. The same is true when I do a

systemctl status ntp

the process is still active running. In fact it shows an uptime of however long it's been on since the intial cold boot. It doesn't show any sign that it stopped.  With that being said, no ntp queries are being made anymore. In fact when I run a:

ntpq -p  

To show a list of my peers, I get a connection refused message. As well as when I perform a

timedatectl status  

This returns a NTP enabled : no


So to wrap this up, I'm getting conflicting reports here...systemctl says that ntp is up and running.
This timedatectl  (which I just learned about today) is showing a status of NTP not running.

This only happens when the computer goes into sleep mode, thus putting the VM into a suspend mode I'm guessing.

Is your network up and running when your computer sleeps? I ask because NetworkManager's behavior is to shut the network down on sleep and start it back up on resume. I ran into a bug on my laptop where NetworkManager was not properly resuming when the computer came back from sleep. I ended up having to build a unit file to do it myself. Perhaps a unit file to resync ntp when you resume is on order.

Last edited by tknomanzr (2015-12-03 14:26:19)

Offline

#4 2015-12-03 19:40:27

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] NTP in a VM

Head_on_a_Stick wrote:
Horizon_Brave wrote:

timedatectl  (which I just learned about today) is showing a status of NTP not running

From timedatectl(1):

set-ntp [BOOL]
           Takes a boolean argument. Controls whether NTP based network time
           synchronization is enabled (if available).

So try:

timedatectl set-ntp true

I'm in OpenBSD at the moment so I can't test this.

Have you enabled the NTP daemon?

I prefer openntpd, obviously tongue


So this is odd, and I"m not sure why I'm seeing two different conflicting answers...
Under the timedatectl  I get:

NTP enabled: no
NTP synchronized: no

but when I use the systemctl -l it shows

loaded active running LSB: Start ntp.service NTP daemon

Plus when I do a ps -aux it shows

ntp    833    /usr/sbin/ntpd -p

So are there two ntpd processes that need to be run? What's the difference, even in my ntpq -pe output I see connected peers.


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#5 2015-12-10 22:28:55

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] NTP in a VM

Solved! head_on_a_stick, you were right (of course). I still don't get why I could see the NTPd process running:

loaded active running LSB: Start ntp.service NTP daemon

but it gave me an NTP enabled: no and sync'd: no   

Both are set to yes now, and it auto sync'd. Just gotta see if it's persistent across reboots...Thanks guys. Any thoughts on the difference between the disparity?


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

Board footer

Powered by FluxBB