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