Keep your OmniOS server time synced

       287 words, 2 minutes

While reading logs, I saw that my OmniOS server was not really time synced with the rest of the Wild Wild World. After a quick check, I realised I forgot to set up NTP on this server.

Let’s solve this now!

Log in to the OmniOS server and install the NTP daemon.
Note that OmniOS uses Image Packaging System (IPS). Other illumos distributions may use different packaging systems.

# pkg install ntpsec

Once installed, the service is not automatically started.

# svcs -l ntp
fmri         svc:/network/ntp:default
name         Network Time Protocol (NTP) Version 4
enabled      false
state        disabled
(...)

I tend to always force a synchronization before starting the daemon. Mostly because the first adjustment may be too big for ntpd to correct time in one step.

# ntpdate nl.pool.ntp.org
{"time":"2024-10-18T00:11:36.010467+0200","offset":491.832848,
"precision":0.001872,"host":"nl.pool.ntp.org","ip":"167.99.42.106",
"stratum":2,"leap":"no-leap","adjusted":true,"delay":0.003743}
CLOCK: time stepped by 491.832848

Enable the NTP service and check that it is synchronized properly:

# svcadm enable ntp

# svcs -l ntp
fmri         svc:/network/ntp:default
name         Network Time Protocol (NTP) Version 4
enabled      true
state        online
(...)

# ntpq -p
     remote                                   refid      st t when poll reach   delay   offset   jitter
=======================================================================================================
 0.omnios.pool.ntp.org                   .POOL.          16 p    -  256    0   0.0000   0.0000   0.0002
-::ffff:5.255.124.190                    192.171.1.150    2 u  234 1024  377   2.5341   0.6112   0.4740
+time3.panq.nl                           192.171.1.150    2 u  796 1024  377   0.8267  -0.0016   0.7362
+::ffff:193.148.248.179                  193.79.237.14    2 u  728 1024  377   0.5096  -0.1762   0.4605
+time1.panq.nl                           192.171.1.150    2 u  103 1024  377   0.7958   0.3907   0.5641
+connected.by.freedominter.net           10.1.105.4       2 u  152 1024  377   4.2471  -0.3054   0.6122
*leontp3.office.panq.nl                  .GPS.            1 u  331 1024  377   4.2903  -0.5263   0.4765
-ntp3.duocast.net                        .PPS0.           1 u  465 1024  377   3.8975  -1.0171   0.4919
+ntp.emenders.nl                         .PPS.            1 u  426 1024  377   8.8568   0.1491   0.4585
+connected.by.freedominter.net           10.1.105.4       2 u  798 1024  377   4.6654  -0.0411   0.5168

That’s All Folks!