ntp init script

Jeremy Huntwork jhuntwork at lightcubesolutions.com
Mon Aug 23 11:18:10 PDT 2010


Hi,

This has come up before, but I want to bring it up again now because 
it's such a simple fix to an old problem.

Given that the purpose of the init script is to (as the book puts it): 
"run ntpd continuously and allow it to synchronize the time in a gradual 
manner.", the current options passed to ntpd are incorrect.

The init script currently uses 'ntpd -gqx'. The '-q' is the main 
problem, since it means:

"-q, --quit
               Set the time and quit.

               ntpd will exit just after the first time the clock is 
set. This behavior mimics that of the ntpdate program, which is to be 
retired."

In this manner, nptd is never forked into the background, it only runs 
once on boot. This also explains why the boot process will hang on ntpd 
when there is no network connection - when using -q, the shell is 
waiting for ntpd to finish and return.

Simply removing the -q makes things work as expected, and is more in 
harmony with the instructions here: http://www.pool.ntp.org/en/use.html

Thanks,

Jeremy



More information about the blfs-dev mailing list