3

I wanted to setup ntpd the right way - so not with a crontab entry.

I followed the guide in the FreeBSD docs:

  • create an entry with ntpd_enable="YES" in /etc/rc.conf
  • checked that everything works fine when service ntpd start is executed
  • restart the machine and checked service ntpd status

there I'll get an ntpd is not running.

what am I missing here?


my /etc/rc.conf:

hostname="myspecialhostname"
keymap="german.cp850.kbd"
ifconfig_em0="inet 192.168.5.55 netmask 255.255.255.0"
defaultrouter="192.168.5.1"
sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
dumpdev="AUTO"
zfs_enable="YES"
php_fpm_enable="YES"
apache24_enable="YES"
nfs_client_enable="YES"

my /etc/ntp.conf:

driftfile /var/db/ntpd.drift

server de.pool.ntp.org iburst
server 0.freebsd.pool.ntp.org iburst
server 1.freebsd.pool.ntp.org iburst
server 2.freebsd.pool.ntp.org iburst

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
restrict 127.127.1.0
5
  • If it doesn't start and there's nothing about it in any log file, that's either a typing error (number of times I've been searching for what was a letter inversion in config file) or a bug ... I don't see any other reason. May 29, 2015 at 7:59
  • 1
    If you run ntpd manually, does it give you any error messages?
    – Jenny D
    May 29, 2015 at 8:27
  • if I try to start ntpd via "service ntpd start" it doesn't print error messages and doesn'T start either... :(
    – Mr.Gosh
    May 29, 2015 at 11:11
  • I was wrong! ntpd was running but not via "service ntpd start" but via direct start of an manually triggered "ntpd" - that one wasn't listed in "service ntpd status" so I had to kill the running ntpd daemon and now I am able to start ntpd via service... - I'll post if it is working after an reboot after the next reboot!
    – Mr.Gosh
    May 29, 2015 at 11:16
  • @Mr.Gosh When I said "run it manually", I should have been clearer - what I meant starting it directly, not from a script and not using service.
    – Jenny D
    May 31, 2015 at 10:19

2 Answers 2

1

Make sure that the system on which you are trying to install ntpd has its clock set to within 1000 seconds of the true time. ntpd will give up and produce a message on start if you have verbosity set to, say 10. I assumed that ntpd would correct the time for you, but if the system time is off by a large amount, in my case about 30 minute ... it doesn't.

0

You need to enable/start also ntpdate. It synchronizes the clock even if the datetime is off by a lot.

sysrc ntpdate_enable="YES"
service ntpdate start

Cheers!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .