console prompt delayed by 5 min when no internet connection
When the board has no internet connection (yet a LAN connection), it takes around 5 minutes before the serial console prompt appears. You actually see the kernel messages, but at some point they stop and during 5 min you don't get anything at the console. Most people will not wait, think something is wrong with the system and maybe reboot.
Actually this is due to the-s
flag passed to openntpd daemon.-s
flag tells openntpd to set system time at startup. When there is no internet connection, openntpd takes around 5 min to switch to daemon mode (dns timeout?).
During those 5 min,init
waits and the startup of the variousgetty
processes inside/etc/inittab
are delayed.
I think it is wrong that the console is not available as fast as possible. It gives the wrong feeling that the system boot has hung.
Also, given the limited system installed on the devuan image, this image is more tailored at the maker world. I guess several of them will first try to establish a serial console connection before even connecting it to the internet.
I believe it would be better to remove this-s
flag and let openntpd adjust the system time in daemon mode only.
-s
is introduced through thecopy-root-overlay
function. It is not set by the/etc/default/openntpd
file shipped with the openntpd package. So it is matter of removing the fileextra/generic-root/etc/default/openntpd
-
I understand the
-s
is set to circumvent the erroradjtime failed: Invalid argument
when openntpd refuses to set the system time because the offset is too large with respect to the NTP servers time.it is a pity openntpd does not provide a flag similar to the
-g
flag of ntp package. This flag allows once to set the system time even if the offset is very large w.rt. to NTP servers time.It would then be interesting considering switching to ntp package instead of openntpd. An added benefit of ntp package: it provides the
ntpq
command, handy to check the synchronisation towards the NTP servers:ntpq -pn
Edited by Giovanni Rapagnani -
I shall switch (back) to
ntp
then if this is the case. Thank you for investigating! -
closed
-
Solved with the replacement of openntpd with ntp. Thank you.