Hello!
I set my machine to synchronize the clock when the machine boots up. Ntpdate would do the trick. Quote from ntpdate man page:
"Note: The functionality of this program is now available in the ntpd(8) program. See the -q command line option in the ntpd(8) page. After a suitable period of mourning, the ntpdate utility is to be retired from this distribution."
So I chose to use ntpd instead of ntpdate.
Starting ntpd with option -q does seem to do what ntpdate would do.
From ntpd man page:
"-q
Exit the ntpd just after the first time the clock is set. This behavior mimics that of the ntpdate(8) program, which is to be retired. The -g and -x options can be used with this option. Note: The kernel time discipline is disabled with this option."
However, seems like rc.conf man page would have mixed -g and -q.
From rc.conf man page:
"ntpd_sync_on_start
(bool) If set to ``YES'', ntpd(8) is run with the -g flag, which syncs the system's clock on startup. See ntpd(8) for more information regarding the -g option. This is a preferred alternative to using ntpdate(8) or specifying the ntpdate_enable variable."
From ntd man page:
"-g
Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows thetime to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options. See the tinker command for other options."
So I tested rc.conf with "ntpd_sync_on_start" and it indeed started ntpd with "-g" option.
Then I replaced that with "ntpd_flags="-g -q -x" and got what I wanted, only one run of ntpd at boot time, then ntpd exits.
Have I misunderstood something here, or is there little confusion between g and q in rc.conf "ntpd_sync_on_start" option?
:q
I set my machine to synchronize the clock when the machine boots up. Ntpdate would do the trick. Quote from ntpdate man page:
"Note: The functionality of this program is now available in the ntpd(8) program. See the -q command line option in the ntpd(8) page. After a suitable period of mourning, the ntpdate utility is to be retired from this distribution."
So I chose to use ntpd instead of ntpdate.
Starting ntpd with option -q does seem to do what ntpdate would do.
From ntpd man page:
"-q
Exit the ntpd just after the first time the clock is set. This behavior mimics that of the ntpdate(8) program, which is to be retired. The -g and -x options can be used with this option. Note: The kernel time discipline is disabled with this option."
However, seems like rc.conf man page would have mixed -g and -q.
From rc.conf man page:
"ntpd_sync_on_start
(bool) If set to ``YES'', ntpd(8) is run with the -g flag, which syncs the system's clock on startup. See ntpd(8) for more information regarding the -g option. This is a preferred alternative to using ntpdate(8) or specifying the ntpdate_enable variable."
From ntd man page:
"-g
Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows thetime to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options. See the tinker command for other options."
So I tested rc.conf with "ntpd_sync_on_start" and it indeed started ntpd with "-g" option.
Then I replaced that with "ntpd_flags="-g -q -x" and got what I wanted, only one run of ntpd at boot time, then ntpd exits.
Have I misunderstood something here, or is there little confusion between g and q in rc.conf "ntpd_sync_on_start" option?
:q