diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index f57133b1e..313734e1a 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -1553,9 +1553,11 @@ function system_ntp_configure($start_ntpd = true) return; } - /* At bootup we just want to write out the config. */ - if (!$start_ntpd) + if (!$start_ntpd) { + /* write out the config and delay startup */ + mwexec_bg('/usr/local/sbin/ntpdate_sync_once.sh'); return; + } /* if ntpd is running, kill it */ while (isvalidpid('/var/run/ntpd.pid')) { @@ -1567,7 +1569,10 @@ function system_ntp_configure($start_ntpd = true) @mkdir('/var/empty', 0775, true); /* start opentpd, set time now and use new config */ - mwexec('/usr/local/sbin/ntpd -g -c /var/etc/ntpd.conf -p /var/run/ntpd.pid', false, true); + mwexecf( + '/usr/local/sbin/ntpd -g -c %s -p %s', + array('/var/etc/ntpd.conf', '/var/run/ntpd.pid') + ); // Note that we are starting up log_error("NTPD is starting up."); diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup index 02cdb35d1..ef6976d8b 100755 --- a/src/etc/rc.bootup +++ b/src/etc/rc.bootup @@ -259,9 +259,7 @@ services_unbound_configure(); /* Do an initial time sync */ echo "Starting NTP time client..."; -/* At bootup this will just write the config, ntpd will launch from ntpdate_sync_once.sh */ system_ntp_configure(false); -mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh", false, true); echo "done.\n"; /* start load balancer daemon */ diff --git a/src/etc/rc.newwanip b/src/etc/rc.newwanip index c859d199d..00539799d 100755 --- a/src/etc/rc.newwanip +++ b/src/etc/rc.newwanip @@ -200,7 +200,6 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface /* reconfigure ntpd */ system_ntp_configure(false); - mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh", false, true); } /* signal filter reload */ diff --git a/src/etc/rc.newwanipv6 b/src/etc/rc.newwanipv6 index 58b0ba167..432682adf 100755 --- a/src/etc/rc.newwanipv6 +++ b/src/etc/rc.newwanipv6 @@ -160,4 +160,3 @@ services_igmpproxy_configure(); /* reconfigure ntpd */ system_ntp_configure(false); -mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh", false, true);