[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 9766149f249c4487f53c6a93166006e7e8b37048

Andreas B. Mundt andi.mundt at web.de
Wed Feb 15 18:20:17 UTC 2012


The following commit has been merged in the master branch:
commit 9766149f249c4487f53c6a93166006e7e8b37048
Author: Andreas B. Mundt <andi.mundt at web.de>
Date:   Wed Feb 15 19:15:57 2012 +0100

    Improve NTP implementation.
    
    Diskless machines do not receive the NTP server from DHCP.
    Use the local clock as time reference, if no external time servers are
    available.

diff --git a/fai/config/scripts/DISKLESS_CLIENT/40-ntp b/fai/config/scripts/DISKLESS_CLIENT/40-ntp
new file mode 100755
index 0000000..5aa9110
--- /dev/null
+++ b/fai/config/scripts/DISKLESS_CLIENT/40-ntp
@@ -0,0 +1,18 @@
+#!/usr/sbin/cfagent -f
+
+## This modification is needed because diskless clients do not
+## use the ntp-server declaration of the DHCP server.
+
+control:
+   any::
+   actionsequence = ( editfiles )
+   EditFileSize = ( 30000 )
+
+editfiles:
+   any::
+	{ ${target}/etc/ntp.conf
+	  BeginGroupIfNoSuchLine "server ntp iburst"
+	    HashCommentLinesStarting "server "
+	    AppendIfNoSuchLine "server ntp iburst"
+	  EndGroup
+	}
diff --git a/fai/config/scripts/NTP_SERVER/10-ntp.conf b/fai/config/scripts/NTP_SERVER/10-ntp.conf
index 3989ea0..8aa8d60 100755
--- a/fai/config/scripts/NTP_SERVER/10-ntp.conf
+++ b/fai/config/scripts/NTP_SERVER/10-ntp.conf
@@ -9,4 +9,6 @@ editfiles:
    any::
 	{ ${target}/etc/ntp.conf
 	  ReplaceAll "#broadcast 192.168.123.255" With "broadcast 10.255.255.255"
+	  AppendIfNoSuchLine "server 127.127.1.0 # local clock"
+	  AppendIfNoSuchLine "fudge  127.127.1.0 stratum 10"
 	}

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list