ntp: new enabled at default
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 2 Dec 2010 15:30:11 +0000 (16:30 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 2 Dec 2010 15:30:11 +0000 (16:30 +0100)
Fix ipfire ntp server defaults.
Fix symlink problem if ntp was disabled.

config/rootfiles/common/ntp
config/rootfiles/core/43/filelists/files
config/time/counter.conf [new file with mode: 0644]
config/time/enable [new file with mode: 0644]
config/time/settime.conf [new file with mode: 0644]
config/time/settings [new file with mode: 0644]
html/cgi-bin/time.cgi
lfs/ntp
src/misc-progs/timectrl.c

index 82892c767fbb6e0729ae77d3fd68f09f5a0e62e5..5f21e830f4ad9a4d59c9b44c776b7feae4c5a500 100644 (file)
@@ -16,3 +16,10 @@ usr/sbin/ntpq
 usr/sbin/ntptime
 usr/sbin/ntptrace
 usr/sbin/tickadj
+etc/rc.d/rc0.d/K46ntpd
+etc/rc.d/rc6.d/K46ntpd
+etc/rc.d/rc3.d/S26ntpd
+var/ipfire/time/counter.conf
+var/ipfire/time/enable
+var/ipfire/time/settime.conf
+var/ipfire/time/settings
index 5bc212763f0c388c580666720a80765bf19adddf..c492f47dfae602f7b1bcfc127632fc407769274e 100644 (file)
@@ -11,6 +11,7 @@ srv/web/ipfire/cgi-bin/vpnmain.cgi
 srv/web/ipfire/html/images/urlfilter/copy.gif
 var/ipfire/general-functions.pl
 var/ipfire/extrahd/bin/extrahd.pl
+usr/local/bin/timectrl
 usr/local/bin/rebuild-initrd
 usr/local/bin/scanhd
 usr/local/sbin/setup
diff --git a/config/time/counter.conf b/config/time/counter.conf
new file mode 100644 (file)
index 0000000..c77754a
--- /dev/null
@@ -0,0 +1 @@
+1435
diff --git a/config/time/enable b/config/time/enable
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/config/time/settime.conf b/config/time/settime.conf
new file mode 100644 (file)
index 0000000..9effa58
--- /dev/null
@@ -0,0 +1 @@
+0.ipfire.pool.ntp.org 1.ipfire.pool.ntp.org
diff --git a/config/time/settings b/config/time/settings
new file mode 100644 (file)
index 0000000..f60ff45
--- /dev/null
@@ -0,0 +1,9 @@
+UPDATE_VALUE=1
+ENABLENTP=on
+VALID=yes
+ENABLECLNTP=off
+ENABLESETONBOOT=on
+NTP_ADDR_2=1.ipfire.pool.ntp.org
+NTP_ADDR_1=0.ipfire.pool.ntp.org
+UPDATE_PERIOD=daily
+UPDATE_METHOD=periodically
index c68eb999fdef389170db1d10bde7927a575ec636..caa17181ba90f188c38caf68a2afd344a6562f24 100644 (file)
@@ -174,8 +174,8 @@ if ($timesettings{'VALID'} eq '')
        $timesettings{'UPDATE_METHOD'} = 'manually';
        $timesettings{'UPDATE_VALUE'} = '1';
        $timesettings{'UPDATE_PERIOD'} = 'daily';
-       $timesettings{'NTP_ADDR_1'} = 'de.pool.ntp.org';
-       $timesettings{'NTP_ADDR_2'} = 'pool.ntp.org';
+       $timesettings{'NTP_ADDR_1'} = '0.ipfire.pool.ntp.org';
+       $timesettings{'NTP_ADDR_2'} = '1.ipfire.pool.ntp.org';
        $timesettings{'ENABLESETONBOOT'} = 'off';
 }
 
diff --git a/lfs/ntp b/lfs/ntp
index 9bfe9d017543dbad62ea91935b237c4ad6da82f0..1859212f5263b47d8dc71015cfd2452fba6abf4a 100644 (file)
--- a/lfs/ntp
+++ b/lfs/ntp
@@ -81,5 +81,14 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        echo "server  127.127.1.0"                      >> /etc/ntp.conf
        echo "fudge   127.127.1.0 stratum 10"   >> /etc/ntp.conf
        echo "driftfile /etc/ntp/drift"         >> /etc/ntp.conf
+
+       #Enable it by default...
+       cp -vf $(DIR_SRC)/config/time/* /var/ipfire/time/
+       chmod 644 /var/ipfire/time/*
+       chown nobody:nobody /var/ipfire/time/*
+       ln -s ../init.d/ntp /etc/rc.d/rc0.d/K46ntpd
+       ln -s ../init.d/ntp /etc/rc.d/rc6.d/K46ntpd
+       ln -s ../init.d/ntp /etc/rc.d/rc3.d/S26ntpd
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index f09e641b30f0615b57e0b1c66da4fbe5a7c5efaf..48b0978d78a927e0a6b9e1a434e3e6d42667d7c2 100644 (file)
@@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {
                safe_system("/etc/rc.d/init.d/ntp start");
        } else if (strcmp(argv[1], "disable") == 0) {
                safe_system("/etc/rc.d/init.d/ntpd stop");
-               safe_system("rm -f /etc/rc.d/rc*.d/*ntp >/dev/null 2>&1");
+               safe_system("rm -f /etc/rc.d/rc*.d/*ntpd >/dev/null 2>&1");
        } else {
                fprintf(stderr, "\nBad argument given.\n\ntimectrl (start|stop|restart)\n\n");
                exit(1);