[debian-edu-commits] debian-edu/ 01/01: Move code updating resolv.conf in the LTSP chroots from the resolvconf update.d fragment to our tools directory, and call it on first boot too, to get a working resolv.conf in the LTSP chroots also on the combined server.

Petter Reinholdtsen pere at moszumanska.debian.org
Fri Sep 26 12:31:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository debian-edu-config.

commit ef7f76bb513678554a467532ba3bfd6e92d5fa45
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Fri Sep 26 14:30:28 2014 +0200

    Move code updating resolv.conf in the LTSP chroots from the resolvconf update.d fragment to our tools directory, and call it on first boot too, to get a working resolv.conf in the LTSP chroots also on the combined server.
---
 Makefile                                           |  1 +
 debian/changelog                                   |  4 +++
 etc/resolvconf/update.d/ltsp-chroots               | 38 ++--------------------
 .../debian-edu-config/tools/ltsp-update-resolvconf |  0
 share/debian-edu-config/tools/run-at-firstboot     |  6 ++++
 5 files changed, 13 insertions(+), 36 deletions(-)

diff --git a/Makefile b/Makefile
index 6b9fe1e..02b1c3b 100644
--- a/Makefile
+++ b/Makefile
@@ -365,6 +365,7 @@ install: install-testsuite
 		share/debian-edu-config/tools/locate-syslog-collector \
 		share/debian-edu-config/tools/logoutkill.sh \
 		share/debian-edu-config/tools/ltsp-addfirmware \
+		share/debian-edu-config/tools/ltsp-update-resolvconf \
 		share/debian-edu-config/tools/missing-desktop-file \
 		share/debian-edu-config/tools/movehome \
 		share/debian-edu-config/tools/nbdquery \
diff --git a/debian/changelog b/debian/changelog
index dcc0d6d..721b8f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,10 @@ debian-edu-config (1.806) UNRELEASED; urgency=low
     task was activated.
   * Correct cfengine rule for apache, disable default site using new
     name 000-default.conf, instead of old and now obsolete name default.
+  * Move code updating resolv.conf in the LTSP chroots from the
+    resolvconf update.d fragment to our tools directory, and call it on
+    first boot too, to get a working resolv.conf in the LTSP chroots
+    also on the combined server.
 
  -- Wolfgang Schweer <wschweer at arcor.de>  Thu, 25 Sep 2014 23:56:27 +0200
 
diff --git a/etc/resolvconf/update.d/ltsp-chroots b/etc/resolvconf/update.d/ltsp-chroots
index 8e75bf4..71d924a 100755
--- a/etc/resolvconf/update.d/ltsp-chroots
+++ b/etc/resolvconf/update.d/ltsp-chroots
@@ -1,38 +1,4 @@
 #!/bin/sh
-#
-# Update resolv.conf in LTSP chroots when the host resolv.conf is
-# changed, to make sure apt keep working in the chroot.
-
-# Make sure the logger binary is used if available
-PATH="/bin:/usr/bin:/sbin:/usr/sbin"
-export PATH
-
-sourcefile=/etc/resolv.conf
-
-if [ ! -s $sourcefile ] ; then
-    # No use copying an empty file
-    exit 0
+if [ -x /usr/share/debian-edu-config/tools/ltsp-update-resolvconf ] ; then
+    /usr/share/debian-edu-config/tools/ltsp-update-resolvconf
 fi
-
-for f in /opt/ltsp/*/etc/resolv.conf ; do
-    if [ -f "$f" ] && ! cmp -s $f $sourcefile ; then
-	arch=$(echo $f | cut -d/ -f4)
-	msg="Updating LTSP DNS config for $arch (cp $sourcefile $f)"
-	# Ignore errors in case /usr/bin with logger is not yet
-	# mounted
-	logger -t debian-edu-config "$msg" 2>/dev/null || true
-	echo "$msg"
-	cp $sourcefile $f
-	chmod 644 $f
-
-        # Fix proxy settings too, as they depend on DNS resolution.
-	msg="Updating LTSP proxy setup for $arch"
-	logger -t debian-edu-config "$msg" 2>/dev/null || true
-	echo "$msg"
-	for f in /etc/environment /etc/apt/apt.conf ; do
-	    newf=/opt/ltsp/$arch$f
-	    cp $f $newf
-	    chmod 644 $newf
-	done
-    fi
-done
diff --git a/etc/resolvconf/update.d/ltsp-chroots b/share/debian-edu-config/tools/ltsp-update-resolvconf
similarity index 100%
copy from etc/resolvconf/update.d/ltsp-chroots
copy to share/debian-edu-config/tools/ltsp-update-resolvconf
diff --git a/share/debian-edu-config/tools/run-at-firstboot b/share/debian-edu-config/tools/run-at-firstboot
index e7641b1..9e850fd 100755
--- a/share/debian-edu-config/tools/run-at-firstboot
+++ b/share/debian-edu-config/tools/run-at-firstboot
@@ -30,6 +30,12 @@ if [ -x /usr/sbin/ltsp-update-kernels ]; then
     ltsp-update-kernels
 fi
 
+# Make sure resolv.conf in LTSP chroot are updated also on the main
+# server where the DNS resolver do not change that often.
+if [ -x /usr/share/debian-edu-config/tools/ltsp-update-resolvconf ] ; then
+    /usr/share/debian-edu-config/tools/ltsp-update-resolvconf
+fi
+
 # Enable all relevant munin plugins now the machine is completely
 # configured.  Some of the plugins are not enabled when munin-node is
 # installed, because their service is installed after munin-node.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list