From a711740da7f2829df378865eb2abcb67984346b9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 14 Nov 2016 23:00:38 +0100 Subject: [PATCH] ntp: #1256 --- src/etc/inc/system.inc | 15 ++++++++++++--- src/etc/rc.bootup | 14 +------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 99e2a503c..f3c28f7bc 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -1500,7 +1500,7 @@ function system_ntp_setup_pps($serialport) return true; } -function system_ntp_configure($start_ntpd = true) +function system_ntp_configure($start_ntpd = true, $verbose = false) { global $config; @@ -1513,6 +1513,11 @@ function system_ntp_configure($start_ntpd = true) return; } + if ($verbose) { + echo 'Starting NTP service...'; + flush(); + } + $driftfile = '/var/db/ntpd.drift'; $statsdir = '/var/log/ntp'; $gps_device = '/dev/gps0'; @@ -1758,6 +1763,9 @@ function system_ntp_configure($start_ntpd = true) if (!$start_ntpd) { /* write out the config and delay startup */ mwexec_bg('/usr/local/sbin/ntpdate_sync_once.sh'); + if ($verbose) { + echo "deferred.\n"; + } return; } @@ -1770,8 +1778,9 @@ function system_ntp_configure($start_ntpd = true) array('/var/etc/ntpd.conf', '/var/run/ntpd.pid') ); - // Note that we are starting up - log_error("NTPD is starting up."); + if ($verbose) { + echo "done.\n"; + } } function system_halt($sync = false) diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup index 0576aeca9..f0870001b 100755 --- a/src/etc/rc.bootup +++ b/src/etc/rc.bootup @@ -179,23 +179,11 @@ echo "Configuring CRON..."; configure_cron(); echo "done.\n"; -/* set up static routes */ system_routing_configure(); - -/* enable routing */ system_routing_enable(); - -/* start dnsmasq service */ services_dnsmasq_configure(true); - -/* start unbound service */ services_unbound_configure(true); - -/* Do an initial time sync */ -echo "Starting NTP time client..."; -system_ntp_configure(false); -echo "done.\n"; - +system_ntp_configure(false, true); services_dhcpd_configure('all', array(), true); services_dhcpleases_configure(); services_dhcrelay_configure(true);