diff options
author | jim-p <jimp@pfsense.org> | 2012-05-30 12:44:55 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-05-30 12:44:55 -0400 |
commit | cf180ccc2a6f91e37b3738bb4a1b14bebbf9ef63 (patch) | |
tree | 19ff89c4c811c61847790cc1eb519d2a4d865818 /etc | |
parent | 0551a524d4486a5fdc934c371dcb073337d4b7f1 (diff) | |
download | pfsense-cf180ccc2a6f91e37b3738bb4a1b14bebbf9ef63.zip pfsense-cf180ccc2a6f91e37b3738bb4a1b14bebbf9ef63.tar.gz |
Switch to ntpd from ports, add Services > NTP to select interfaces for binding. Respect old ntp settings in the process.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/system.inc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index b22d170..c807c0e 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 */ @@ -1266,6 +1266,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) { @@ -1293,7 +1311,7 @@ function system_ntp_configure($start_ntpd=true) { /* start opentpd, set time now and use /var/etc/ntpd.conf */ $oldset = array(); pcntl_sigprocmask(SIG_SETMASK, array(), $oldset); - exec("/usr/sbin/ntpd -g -c {$g['varetc_path']}/ntpd.conf"); + exec("/usr/local/bin/ntpd -g -c {$g['varetc_path']}/ntpd.conf"); pcntl_sigprocmask(SIG_SETMASK, $oldset); // Note that we are starting up |