[debian-edu-commits] r81130 - in branches/wheezy/debian-edu-config: debian share/debian-edu-config/tools

pere at alioth.debian.org pere at alioth.debian.org
Mon Jun 24 07:40:07 UTC 2013


Author: pere
Date: 2013-06-24 07:40:06 +0000 (Mon, 24 Jun 2013)
New Revision: 81130

Modified:
   branches/wheezy/debian-edu-config/debian/changelog
   branches/wheezy/debian-edu-config/share/debian-edu-config/tools/locate-syslog-collector
Log:
Make locate-syslog-collector more robust when finding DNS domain, to
increase the chance of correct syslog setup on clients.

Modified: branches/wheezy/debian-edu-config/debian/changelog
===================================================================
--- branches/wheezy/debian-edu-config/debian/changelog	2013-06-23 23:01:43 UTC (rev 81129)
+++ branches/wheezy/debian-edu-config/debian/changelog	2013-06-24 07:40:06 UTC (rev 81130)
@@ -1,3 +1,11 @@
+debian-edu-config (1.708~svn81129) UNRELEASED; urgency=low
+
+  [ Petter Reinholdtsen ]
+  * Make locate-syslog-collector more robust when finding DNS domain, to
+    increase the chance of correct syslog setup on clients.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Mon, 24 Jun 2013 09:36:17 +0200
+
 debian-edu-config (1.707) unstable; urgency=low
 
   * Uploaded to the Debian Edu archive as debian-edu-config 1.707~svn81085:

Modified: branches/wheezy/debian-edu-config/share/debian-edu-config/tools/locate-syslog-collector
===================================================================
--- branches/wheezy/debian-edu-config/share/debian-edu-config/tools/locate-syslog-collector	2013-06-23 23:01:43 UTC (rev 81129)
+++ branches/wheezy/debian-edu-config/share/debian-edu-config/tools/locate-syslog-collector	2013-06-24 07:40:06 UTC (rev 81130)
@@ -5,8 +5,22 @@
 LC_ALL=C
 export LC_ALL
 
-domain="$(hostname -d)"
+find_dns_domain() {
+    if [ "$1" ] ; then
+	domain=$1
+    else
+	domain="$(hostname -d 2>/dev/null || true)"
+	# If hostname is not FQDN, look in DNS setup instead, to
+	# increase the chance of the automatic setup to work.
+	if [ -z "$domain" ] || [ "(null)" = "$domain" ]; then
+	    domain=$(grep search /etc/resolv.conf |awk '{print $2}')
+	fi
+    fi
+    echo $domain
+}
 
+domain=$(find_dns_domain "$1")
+
 if ping -c2 syslog.$domain > /dev/null 2>&1; then
     echo syslog.$domain
 elif ping -c2 loghost.$domain > /dev/null 2>&1; then




More information about the debian-edu-commits mailing list