summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-05-30 12:47:24 -0400
committerjim-p <jimp@pfsense.org>2012-05-30 12:47:24 -0400
commitbb39c28350d4a41158775672e4ef432990674c9f (patch)
tree611a85e620870df5b8c737f043b0f5858e17ee04 /etc
parent829fd8c1b81e088510bb0831f3c527732b601713 (diff)
downloadpfsense-bb39c28350d4a41158775672e4ef432990674c9f.zip
pfsense-bb39c28350d4a41158775672e4ef432990674c9f.tar.gz
Switch to ntpd from ports, add Services > NTP to select interfaces for binding. Respect old ntp settings in the process.
Conflicts: etc/inc/system.inc usr/local/www/fbegin.inc
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/system.inc22
1 files changed, 20 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 8429758..e7f671d 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -33,7 +33,7 @@
pfSense_BUILDER_BINARIES: /usr/sbin/powerd /usr/bin/killall /sbin/sysctl /sbin/route
pfSense_BUILDER_BINARIES: /bin/hostname /bin/ls /usr/sbin/syslogd
pfSense_BUILDER_BINARIES: /usr/sbin/pccardd /usr/local/sbin/lighttpd /bin/chmod /bin/mkdir
- pfSense_BUILDER_BINARIES: /usr/bin/tar /usr/sbin/ntpd /usr/sbin/ntpdate
+ pfSense_BUILDER_BINARIES: /usr/bin/tar /usr/local/bin/ntpd /usr/sbin/ntpdate
pfSense_BUILDER_BINARIES: /usr/bin/nohup /sbin/dmesg /usr/local/sbin/atareinit /sbin/kldload
pfSense_MODULE: utils
*/
@@ -1120,6 +1120,24 @@ function system_ntp_configure($start_ntpd=true) {
$ntpcfg .= "driftfile {$driftfile}\n";
+ if (empty($config['ntpd']['interface']))
+ if (empty($config['openntpd']['config']['interface']))
+ $interfaces = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']);
+ else
+ $interfaces = array();
+ else
+ $interfaces = explode(",", $config['ntpd']['interface']);
+
+ if (is_array($interfaces) && count($interfaces)) {
+ $ntpcfg .= "interface ignore all\n";
+ foreach ($interfaces as $interface) {
+ if (!is_ipaddr($interface)) {
+ $interface = get_real_interface($interface);
+ }
+ $ntpcfg .= "interface listen {$interface}\n";
+ }
+ }
+
/* open configuration for wrting or bail */
$fd = fopen("{$g['varetc_path']}/ntpd.conf","w");
if(!$fd) {
@@ -1145,7 +1163,7 @@ function system_ntp_configure($start_ntpd=true) {
exec("/bin/mkdir -p /var/empty && chmod ug+rw /var/empty/.");
/* start ntpd, allow a large initial skew, and use /var/etc/ntpd.conf - run through tcsh to work around a PHP shell exec bug. */
- exec("echo /usr/sbin/ntpd -g -c {$g['varetc_path']}/ntpd.conf | tcsh");
+ exec("echo /usr/local/bin/ntpd -g -c {$g['varetc_path']}/ntpd.conf | tcsh");
// Note that we are starting up
log_error("NTPD is starting up.");
OpenPOWER on IntegriCloud