Commit fd987e63 authored by Franco Fichtner's avatar Franco Fichtner

ntpd: it's a plugin!

parent 4a6a53bc
This diff is collapsed.
...@@ -1858,16 +1858,6 @@ function services_get() ...@@ -1858,16 +1858,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.
...@@ -179,7 +179,6 @@ system_routing_configure(); ...@@ -179,7 +179,6 @@ system_routing_configure();
system_routing_enable(); system_routing_enable();
dnsmasq_configure_do(true); dnsmasq_configure_do(true);
unbound_configure_do(true); unbound_configure_do(true);
system_ntp_configure(false, true);
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);
......
...@@ -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