bofc manual pages




ntpd-setwait - sets system time from ntp server before running ntpd daemon.  


ntpd-setwait [-f] [-i<ip>] <max-deviation> <ntpd-bin> [ntpd-opts]  


ntpd-setwait is very simple program that will do the following:

* wait indefinitely for internet connection
* read current UTC time from ntp server
* if local and ntp time differance is bigger than max-deviation - set system time with ntp time
* start ntpd-bin program.

If at any point there is an error, program goes back to start and tries again, until all steps succeed and ntpd-bin is executed. ntpd-bin is executed with execve() syscall, so after that ntpd-setwait cease to exist.  


All options are positional.

Run program in foreground - this may be usefull when you want to stop system boot until time is synchronized (pass proper option to your ntpd to make it go into background if you don't want to hang up your boot completely). Or you want to use external supervisor - remember ntpd pid will be the same as ntpd-setwait due to execve() function. By default, program forks into background.
By default, programs takes ntp server from pool.ntp.org, but if you want to specify own server (on local network) you can do it by passing -i argument. Usefull when your board does not really have internet access, but it can access internal server with ntpd server.
Positional argument. At startup program will read ntp time and localtime. If local time is different than the one on the ntp server for more than max-deviation seconds, ntpd-setwait will set system time to time returned by ntp server.
Positional argument. Absolute path to ntpd binary you want to use. It's usually /usr/sbin/ntpd.
Positional and optional argument. Options that should be passed to ntpd-bin executable.


Please report all bugs to "Michał Łyszczek <michal.lyszczek@bofc.pl>"


7 December 2020 (v0.2.0)