# How to keep time correct on VPS?



## cbrace (Apr 24, 2015)

Hi all,

I have a VPS running FreeBSD v10.1-p9.

Just now I noticed to my astonishment that the system time was approx. 45 minutes off (uptime of around nine days).

Related (or not) I saw a whole bunch of "kernel: calcru: runtime went backwards" in /var/log/mesages errors starting about 36 hours ago.

I then noticed that ntpd wasn't running. Either it didn't start properly or it crashed. Here is what I have in /etc/rc.conf

```
# NTP
ntpd_enable="YES"
ntpdate_enable="YES" 
ntpdate_hosts="server 3.nl.pool.ntp.org"
daily_status_ntpd_enable="YES"
```
Clearly this set up isn't working. What do you all recommend?


----------



## wblock@ (Apr 24, 2015)

Use only ntpd(8).  Both ntpdate and ntpd will fight over the same port if they try to start at the same time.  To run ntpd but get the same effect as first running ntpdate, use:
/etc/rc.conf:

```
ntpd_enable="YES"
ntpd_sync_on_start="YES"
```


----------



## cbrace (Apr 24, 2015)

Thanks. Perhaps that is why ntpd didn't start.


----------



## LordGordon (May 17, 2015)

You can also check the status of ntpd with:
`ntpq -p`


----------



## Remington (May 17, 2015)

Are you using net/openntpd?  I had problems with FreeBSD's ntpd in jails so I use openntpd instead.  It's easier to configure and it doesn't listen to all ports.


----------

