Commit 64699782 authored by Franco Fichtner's avatar Franco Fichtner

ntpd: it's a plugin!

(cherry picked from commit fd987e63)
(cherry picked from commit b30940b5)
(cherry picked from commit d539e535)
parent adca7253
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
/usr/local/etc/inc/plugins.inc.d/ipfw.inc /usr/local/etc/inc/plugins.inc.d/ipfw.inc
/usr/local/etc/inc/plugins.inc.d/miniupnpd.inc /usr/local/etc/inc/plugins.inc.d/miniupnpd.inc
/usr/local/etc/inc/plugins.inc.d/netflow.inc /usr/local/etc/inc/plugins.inc.d/netflow.inc
/usr/local/etc/inc/plugins.inc.d/ntpd.inc
/usr/local/etc/inc/plugins.inc.d/pf.inc /usr/local/etc/inc/plugins.inc.d/pf.inc
/usr/local/etc/inc/plugins.inc.d/relayd.inc /usr/local/etc/inc/plugins.inc.d/relayd.inc
/usr/local/etc/inc/plugins.inc.d/relayd/dns.proto /usr/local/etc/inc/plugins.inc.d/relayd/dns.proto
......
This diff is collapsed.
...@@ -2074,16 +2074,6 @@ function services_get() ...@@ -2074,16 +2074,6 @@ function services_get()
$services[] = $pconfig; $services[] = $pconfig;
} }
if (isset($config['system']['timeservers'])) {
$pconfig = array();
$pconfig['name'] = "ntpd";
$pconfig['description'] = gettext("NTP clock sync");
$pconfig['php']['restart'] = array('system_ntp_configure');
$pconfig['php']['start'] = array('system_ntp_configure');
$pconfig['pidfile'] = '/var/run/ntpd.pid';
$services[] = $pconfig;
}
if (isset($config['dhcrelay']['enable'])) { if (isset($config['dhcrelay']['enable'])) {
$pconfig = array(); $pconfig = array();
$pconfig['name'] = "dhcrelay"; $pconfig['name'] = "dhcrelay";
......
This diff is collapsed.
...@@ -184,11 +184,6 @@ services_dnsmasq_configure(true); ...@@ -184,11 +184,6 @@ services_dnsmasq_configure(true);
/* start unbound service */ /* start unbound service */
services_unbound_configure(true); services_unbound_configure(true);
/* Do an initial time sync */
echo "Starting NTP time client...";
system_ntp_configure(false);
echo "done.\n";
/* start DHCP service */ /* start DHCP service */
services_dhcpd_configure(); services_dhcpd_configure();
......
...@@ -215,9 +215,6 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface ...@@ -215,9 +215,6 @@ if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interface
if (function_exists('plugins_configure')) { if (function_exists('plugins_configure')) {
plugins_configure('interface'); plugins_configure('interface');
} }
/* reconfigure ntpd */
system_ntp_configure(false);
} }
/* reload filter, don't try to sync to carp slave */ /* reload filter, don't try to sync to carp slave */
......
...@@ -152,8 +152,9 @@ if (ipsec_configured_on_interface($interface)) { ...@@ -152,8 +152,9 @@ if (ipsec_configured_on_interface($interface)) {
} }
/* start OpenVPN server & clients */ /* start OpenVPN server & clients */
if (substr($interface_real, 0, 4) != "ovpn") if (substr($interface_real, 0, 4) != 'ovpn') {
openvpn_resync_all($interface); openvpn_resync_all($interface);
}
/* reload graphing functions */ /* reload graphing functions */
enable_rrd_graphing(); enable_rrd_graphing();
...@@ -162,6 +163,3 @@ enable_rrd_graphing(); ...@@ -162,6 +163,3 @@ enable_rrd_graphing();
if (function_exists('plugins_configure')) { if (function_exists('plugins_configure')) {
plugins_configure('interface'); plugins_configure('interface');
} }
/* reconfigure ntpd */
system_ntp_configure(false);
...@@ -54,9 +54,12 @@ system_routing_enable(); ...@@ -54,9 +54,12 @@ system_routing_enable();
interfaces_configure(); interfaces_configure();
services_dyndns_configure(); services_dyndns_configure();
system_cron_configure(); system_cron_configure();
system_ntp_configure();
mwexec_bg('/usr/local/etc/rc.sshd'); mwexec_bg('/usr/local/etc/rc.sshd');
mwexec_bg('/usr/local/etc/rc.restart_webgui'); mwexec_bg('/usr/local/etc/rc.restart_webgui');
if (function_exists('plugins_configure')) {
plugins_configure('local');
}
log_error("rc.reload_all: Reloading filter configuration."); log_error("rc.reload_all: Reloading filter configuration.");
filter_configure_sync(); filter_configure_sync();
...@@ -33,6 +33,7 @@ require_once("rrd.inc"); ...@@ -33,6 +33,7 @@ require_once("rrd.inc");
require_once("services.inc"); require_once("services.inc");
require_once("system.inc"); require_once("system.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("plugins.inc.d/ntpd.inc");
if (!isset($config['ntpd']) || !is_array($config['ntpd'])) { if (!isset($config['ntpd']) || !is_array($config['ntpd'])) {
$config['ntpd'] = array(); $config['ntpd'] = array();
...@@ -113,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -113,7 +114,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$a_ntpd['leapsec'] = base64_encode(file_get_contents($_FILES['leapfile']['tmp_name'])); $a_ntpd['leapsec'] = base64_encode(file_get_contents($_FILES['leapfile']['tmp_name']));
} }
write_config("Updated NTP Server Settings"); write_config("Updated NTP Server Settings");
system_ntp_configure(); ntpd_configure_start();
header(url_safe('Location: /services_ntpd.php')); header(url_safe('Location: /services_ntpd.php'));
exit; exit;
} }
......
...@@ -32,6 +32,7 @@ require_once("guiconfig.inc"); ...@@ -32,6 +32,7 @@ require_once("guiconfig.inc");
require_once("services.inc"); require_once("services.inc");
require_once("system.inc"); require_once("system.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("plugins.inc.d/ntpd.inc");
if (!isset($config['ntpd']['gps'])) { if (!isset($config['ntpd']['gps'])) {
$config['ntpd']['gps'] = array(); $config['ntpd']['gps'] = array();
...@@ -67,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -67,7 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$gps['initcmd']= base64_encode($gps['initcmd']); $gps['initcmd']= base64_encode($gps['initcmd']);
$config['ntpd']['gps'] = $gps; $config['ntpd']['gps'] = $gps;
write_config("Updated NTP GPS Settings"); write_config("Updated NTP GPS Settings");
system_ntp_configure(); ntpd_configure_start();
header(url_safe('Location: /services_ntpd_gps.php')); header(url_safe('Location: /services_ntpd_gps.php'));
exit; exit;
} }
......
...@@ -31,6 +31,7 @@ require_once("guiconfig.inc"); ...@@ -31,6 +31,7 @@ require_once("guiconfig.inc");
require_once("services.inc"); require_once("services.inc");
require_once("system.inc"); require_once("system.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("plugins.inc.d/ntpd.inc");
if (!isset($config['ntpd']) || !is_array($config['ntpd'])) { if (!isset($config['ntpd']) || !is_array($config['ntpd'])) {
$config['ntpd'] = array(); $config['ntpd'] = array();
...@@ -39,7 +40,6 @@ if (!isset($config['ntpd']['pps'])) { ...@@ -39,7 +40,6 @@ if (!isset($config['ntpd']['pps'])) {
$config['ntpd']['pps'] = array(); $config['ntpd']['pps'] = array();
} }
$copy_fields = array('port', 'fudge1', 'stratum', 'flag2', 'flag3', 'flag4', 'refid'); $copy_fields = array('port', 'fudge1', 'stratum', 'flag2', 'flag3', 'flag4', 'refid');
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array(); $pconfig = array();
...@@ -66,7 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -66,7 +66,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
$config['ntpd']['pps'] = $pps; $config['ntpd']['pps'] = $pps;
write_config("Updated NTP PPS Settings"); write_config("Updated NTP PPS Settings");
system_ntp_configure(); ntpd_configure_start();
header(url_safe('Location: /services_ntpd_pps.php')); header(url_safe('Location: /services_ntpd_pps.php'));
exit; exit;
} }
......
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