|
From: <ow...@us...> - 2008-01-14 18:55:47
|
Revision: 1006
http://ipcop.svn.sourceforge.net/ipcop/?rev=1006&view=rev
Author: owes
Date: 2008-01-14 10:55:38 -0800 (Mon, 14 Jan 2008)
Log Message:
-----------
Change default ntp server to use our designated vendor pool zone.
Drop ntpdate and instant update, ntpd seems capable enough to
sync time.
We need to update our documentation to encourage those with static IP to
join the ntp pool.
Modified Paths:
--------------
ipcop/trunk/config/cfgroot/time-settings
ipcop/trunk/config/rootfiles/common/ntp
ipcop/trunk/html/cgi-bin/time.cgi
ipcop/trunk/src/misc-progs/restartntpd.c
Modified: ipcop/trunk/config/cfgroot/time-settings
===================================================================
--- ipcop/trunk/config/cfgroot/time-settings 2008-01-14 13:42:38 UTC (rev 1005)
+++ ipcop/trunk/config/cfgroot/time-settings 2008-01-14 18:55:38 UTC (rev 1006)
@@ -1,4 +1,5 @@
ENABLENTP=off
-NTP_ADDR_1=pool.ntp.org
-NTP_ADDR_2=
+NTP_ADDR_1=0.ipcop.pool.ntp.org
+NTP_ADDR_2=1.ipcop.pool.ntp.org
+NTP_ADDR_3=2.ipcop.pool.ntp.org
VALID=yes
Modified: ipcop/trunk/config/rootfiles/common/ntp
===================================================================
--- ipcop/trunk/config/rootfiles/common/ntp 2008-01-14 13:42:38 UTC (rev 1005)
+++ ipcop/trunk/config/rootfiles/common/ntp 2008-01-14 18:55:38 UTC (rev 1006)
@@ -5,7 +5,7 @@
#usr/bin/ntp-keygen
#usr/bin/ntp-wait
usr/bin/ntpd
-usr/bin/ntpdate
+#usr/bin/ntpdate
#usr/bin/ntpdc
usr/bin/ntpq
#usr/bin/ntptime
Modified: ipcop/trunk/html/cgi-bin/time.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/time.cgi 2008-01-14 13:42:38 UTC (rev 1005)
+++ ipcop/trunk/html/cgi-bin/time.cgi 2008-01-14 18:55:38 UTC (rev 1006)
@@ -38,6 +38,7 @@
$timesettings{'ENABLENTP'} = 'off';
$timesettings{'NTP_ADDR_1'} = '';
$timesettings{'NTP_ADDR_2'} = '';
+$timesettings{'NTP_ADDR_3'} = '';
$timesettings{'SETHOUR'} = '';
$timesettings{'SETMINUTES'} = '';
$timesettings{'SETDAY'} = '';
@@ -107,6 +108,12 @@
goto ERROR;
}
+ if (!($timesettings{'NTP_ADDR_2'}) && $timesettings{'NTP_ADDR_3'})
+ {
+ $errormessage = $Lang::tr{'cannot specify tertiary ntp without specifying secondary'};
+ goto ERROR;
+ }
+
if ($timesettings{'ENABLENTP'} eq 'on')
{
if ( ! ( &General::validfqdn($timesettings{'NTP_ADDR_1'}) ||
@@ -127,6 +134,16 @@
}
}
+ if ($timesettings{'NTP_ADDR_3'})
+ {
+ if ( ! ( &General::validfqdn($timesettings{'NTP_ADDR_3'}) ||
+ &General::validip ($timesettings{'NTP_ADDR_3'})))
+ {
+ $errormessage = $Lang::tr{'invalid tertiary ntp'};
+ goto ERROR;
+ }
+ }
+
ERROR:
if ($errormessage) {
$timesettings{'VALID'} = 'no'; }
@@ -162,8 +179,9 @@
if ($timesettings{'VALID'} eq '')
{
$timesettings{'ENABLENTP'} = 'off';
- $timesettings{'NTP_ADDR_1'} = 'pool.ntp.org';
- $timesettings{'NTP_ADDR_2'} = '';
+ $timesettings{'NTP_ADDR_1'} = '0.pool.ntp.org';
+ $timesettings{'NTP_ADDR_2'} = '1.pool.ntp.org';
+ $timesettings{'NTP_ADDR_2'} = '2.pool.ntp.org';
}
unless ($errormessage) {
@@ -224,21 +242,12 @@
<td width='25%'> </td>
</tr>
<tr>
- <td colspan='5'> </td>
-</tr>
-<tr>
<td> </td>
- <th colspan='4' align='left'>
- $Lang::tr{'update time'}
- </th>
+ <td width='25%' class='base'>$Lang::tr{'tertiary ntp server'}: <img src='/blob.gif' align='top' alt='*' /></td>
+ <td width='25%'><input type='text' name='NTP_ADDR_3' value='$timesettings{'NTP_ADDR_3'}' /></td>
+ <td width='25%'> </td>
+ <td width='25%'> </td>
</tr>
-<tr>
- <td> </td>
- <td width='25%' align='left'>
- <input type='submit' name='ACTION' value='$Lang::tr{'set time now'}' />
- </td>
- <td width='75%' colspan='3'> </td>
-</tr>
</table>
<br />
<hr />
@@ -312,14 +321,19 @@
print FILE "# Servers\n";
if ( $timesettings{'NTP_ADDR_1'} )
{
- print FILE "server " . $timesettings{'NTP_ADDR_1'} . " iburst\n" ;
+ print FILE "server " . $timesettings{'NTP_ADDR_1'} . "\n" ;
print FILE "restrict " . $timesettings{'NTP_ADDR_1'} . " mask 255.255.255.255 nomodify noquery notrap\n" ;
}
if ( $timesettings{'NTP_ADDR_2'} )
{
- print FILE "server " . $timesettings{'NTP_ADDR_2'} . " iburst\n" ;
+ print FILE "server " . $timesettings{'NTP_ADDR_2'} . "\n" ;
print FILE "restrict " . $timesettings{'NTP_ADDR_2'} . " mask 255.255.255.255 nomodify noquery notrap\n" ;
}
+ if ( $timesettings{'NTP_ADDR_3'} )
+ {
+ print FILE "server " . $timesettings{'NTP_ADDR_3'} . "\n" ;
+ print FILE "restrict " . $timesettings{'NTP_ADDR_3'} . " mask 255.255.255.255 nomodify noquery notrap\n" ;
+ }
print FILE "# Local clock\n";
print FILE "server 127.127.1.0\n";
Modified: ipcop/trunk/src/misc-progs/restartntpd.c
===================================================================
--- ipcop/trunk/src/misc-progs/restartntpd.c 2008-01-14 13:42:38 UTC (rev 1005)
+++ ipcop/trunk/src/misc-progs/restartntpd.c 2008-01-14 18:55:38 UTC (rev 1006)
@@ -128,6 +128,7 @@
/* Forced sync */
/* do not test for red active, NTP server could be anywhere, let ppp dialup block connection */
+#if USE_FORCE_SYNC
if ( syncnow || (boot && enable) )
{
snprintf(buffer, STRING_SIZE, "/usr/bin/ntpdate -U ntp -su %s %s", server_1, server_2);
@@ -141,7 +142,8 @@
safe_system("/usr/bin/logger -t ipcop \"ntpdate error\"");
}
}
-
+#endif
+
/* Start ntpd if enabled */
if ( enable )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|