Commit a711740d authored by Franco Fichtner's avatar Franco Fichtner

ntp: #1256

parent b74970ee
...@@ -1500,7 +1500,7 @@ function system_ntp_setup_pps($serialport) ...@@ -1500,7 +1500,7 @@ function system_ntp_setup_pps($serialport)
return true; return true;
} }
function system_ntp_configure($start_ntpd = true) function system_ntp_configure($start_ntpd = true, $verbose = false)
{ {
global $config; global $config;
...@@ -1513,6 +1513,11 @@ function system_ntp_configure($start_ntpd = true) ...@@ -1513,6 +1513,11 @@ function system_ntp_configure($start_ntpd = true)
return; return;
} }
if ($verbose) {
echo 'Starting NTP service...';
flush();
}
$driftfile = '/var/db/ntpd.drift'; $driftfile = '/var/db/ntpd.drift';
$statsdir = '/var/log/ntp'; $statsdir = '/var/log/ntp';
$gps_device = '/dev/gps0'; $gps_device = '/dev/gps0';
...@@ -1758,6 +1763,9 @@ function system_ntp_configure($start_ntpd = true) ...@@ -1758,6 +1763,9 @@ function system_ntp_configure($start_ntpd = true)
if (!$start_ntpd) { if (!$start_ntpd) {
/* write out the config and delay startup */ /* write out the config and delay startup */
mwexec_bg('/usr/local/sbin/ntpdate_sync_once.sh'); mwexec_bg('/usr/local/sbin/ntpdate_sync_once.sh');
if ($verbose) {
echo "deferred.\n";
}
return; return;
} }
...@@ -1770,8 +1778,9 @@ function system_ntp_configure($start_ntpd = true) ...@@ -1770,8 +1778,9 @@ function system_ntp_configure($start_ntpd = true)
array('/var/etc/ntpd.conf', '/var/run/ntpd.pid') array('/var/etc/ntpd.conf', '/var/run/ntpd.pid')
); );
// Note that we are starting up if ($verbose) {
log_error("NTPD is starting up."); echo "done.\n";
}
} }
function system_halt($sync = false) function system_halt($sync = false)
......
...@@ -179,23 +179,11 @@ echo "Configuring CRON..."; ...@@ -179,23 +179,11 @@ echo "Configuring CRON...";
configure_cron(); configure_cron();
echo "done.\n"; echo "done.\n";
/* set up static routes */
system_routing_configure(); system_routing_configure();
/* enable routing */
system_routing_enable(); system_routing_enable();
/* start dnsmasq service */
services_dnsmasq_configure(true); services_dnsmasq_configure(true);
/* start unbound service */
services_unbound_configure(true); services_unbound_configure(true);
system_ntp_configure(false, true);
/* Do an initial time sync */
echo "Starting NTP time client...";
system_ntp_configure(false);
echo "done.\n";
services_dhcpd_configure('all', array(), true); services_dhcpd_configure('all', array(), true);
services_dhcpleases_configure(); services_dhcpleases_configure();
services_dhcrelay_configure(true); services_dhcrelay_configure(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment