[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] 3 commits: Fix loss of dynamically allocated v4 IP address. (Closes: #933580)

WolfgangSchweer gitlab at salsa.debian.org
Wed Jul 31 19:36:59 BST 2019



WolfgangSchweer pushed to branch master at Debian Edu / debian-edu-config


Commits:
0f7b2dfb by Wolfgang Schweer at 2019-07-31T18:26:29Z
Fix loss of dynamically allocated v4 IP address. (Closes: #933580)

Drop etc/network/if-up.d/hostname. This script doesn't work anymore due
to changed behaviour of the ifupdown/dhclient/systemd combination and now
also causes the loss of a dynamically allocated ipv4 IP address after 20
to 30 minutes after booting.

Add code to d/debian-edu-config.postinstall to implement the intended
hostname update just after rebooting the system after a change.

Adjust Makefile.

Signed-off-by: Wolfgang Schweer <wschweer at arcor.de>

- - - - -
868efefb by Wolfgang Schweer at 2019-07-31T18:33:15Z
Add changelog entry for last commit.

Signed-off-by: Wolfgang Schweer <wschweer at arcor.de>

- - - - -
123fff92 by Wolfgang Schweer at 2019-07-31T18:34:47Z
Fix bug number in d/changelog

Signed-off-by: Wolfgang Schweer <wschweer at arcor.de>

- - - - -


4 changed files:

- Makefile
- debian/changelog
- debian/debian-edu-config.postinst
- − etc/network/if-up.d/hostname


Changes:

=====================================
Makefile
=====================================
@@ -102,7 +102,6 @@ SYSCONFFILES = \
 	ldap/rootDSE-debian-edu.ldif \
 	ldap/slapd-debian-edu.conf \
 	ltsp/ltsp-build-client.conf \
-	network/if-up.d/hostname \
 	network/if-up.d/wpad-proxy-update \
 	samba/netlogon/1stlogon/1stlogon.bat \
 	samba/netlogon/config/get_time.bat \


=====================================
debian/changelog
=====================================
@@ -36,6 +36,14 @@ debian-edu-config (2.10.66) UNRELEASED; urgency=medium
     - Adjust cf3/cf.finalize to care for the rootCA file as well.
     - Adjust cf3/cf.workarounds to copy the rootCA file to the web server
       directory upon main server upgrade.
+  * Fix loss of dynamically allocated v4 IP address. (Closes: #933580)
+    - Drop etc/network/if-up.d/hostname. This script doesn't work anymore due
+      to changed behaviour of the ifupdown/dhclient/systemd combination and now
+      also causes the loss of a dynamically allocated ipv4 IP address after 20
+      to 30 minutes after booting.
+    - Add code to d/debian-edu-config.postinstall to implement the intended
+      hostname update just after rebooting the system after a change.
+    - Adjust Makefile.
 
   [ Mike Gabriel ]
   * debian/debian-edu-config.fetch-ldap-cert: Make the script (and with it


=====================================
debian/debian-edu-config.postinst
=====================================
@@ -225,15 +225,23 @@ configure)
     chown root:root /etc/sssd/sssd-debian-edu.conf
 
     # The scripts in /etc/network/if-up.d need to be executable.
-    chmod +x /etc/network/if-up.d/hostname
     # Drop wpad-proxy-update for the main server, it makes no sense to run the
-    # script at this time.
-    if egrep -q "(Main-Server)" /etc/debian-edu/config ; then
+    # script at this time. Also drop it for the gateway, it doesn't make sense.
+    if egrep -q "(Main-Server)" /etc/debian-edu/config || grep -q gateway /etc/hostname; then
         rm -f /etc/network/if-up.d/wpad-proxy-update
     else
 	chmod +x /etc/network/if-up.d/wpad-proxy-update
     fi
 
+    # Add post-up stanza to interfaces file to let hostname changes take effect
+    # immediately after reboot (would take up to 15 min. otherwise). Exclude the
+    # gateway; the script doesn't make sense and would taint network setup.
+        if [ -f /etc/network/interfaces ] && ! grep -q gateway /etc/hostname && \
+	    ! grep -q post-up /etc/network/interfaces ; then
+		sed -i '/iface eth0 inet dhcp/a \    post-up \/usr\/sbin\/update-hostname-from-ip' \
+		/etc/network/interfaces
+        fi
+
     # silence dovecot's message: if you have trouble with authentication failures,
     # enable auth_debug setting. See http://wiki.dovecot.org/WhyDoesItNotWork
     # This message goes away after the first successful login.


=====================================
etc/network/if-up.d/hostname deleted
=====================================
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# Purpose: Used by dhclient-script to set the hostname of the system
-# to match the DNS information for the host as provided by DHCP.
-#
-# This script is based on code found on the web:
-# http://www.debian-administration.org/articles/447 and
-# http://nxhelp.com/blog/2013/01/24/automatically-set-hostname-from-dhcp/
-#
-
-PATH=/sbin:$PATH
-export PATH
-
-# Should not update hostname on Main-Server, Roaming-Workstation and
-# Standalone.  Those get their fixed hostname set during installation
-# (or manually after installation) and should not change dynamically
-# if moved between networks.
-if [ -r /etc/debian-edu/config ] ; then
-	. /etc/debian-edu/config
-fi
-
-if echo "$PROFILE" | egrep -q 'Main-Server|Roaming-Workstation|Standalone' ; then
-	exit 0
-	else
-	    if echo "$PROFILE" | egrep -q 'Workstation|LTSP-Server|Thin-Client-Server|Minimal' ; then
-	        :
-	    fi
-fi
-
-log() {
-    logger -t network/if-up.d/hostname "$1"
-}
-
-sethostname() {
-    hostname="$1"
-    namesource="$2"
-    echo $hostname > /etc/hostname
-    hostname $hostname
-    log "changing hostname to $hostname based on $namesource"
-}
-
-namesource="DHCP IP address $new_ip_address"
-/usr/sbin/update-hostname-from-ip



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/compare/a186aba3d092c063d3417bbbf680ab3b01feacbb...123fff92b23f1e69a5dfeadfc87d356b3feafa18

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/compare/a186aba3d092c063d3417bbbf680ab3b01feacbb...123fff92b23f1e69a5dfeadfc87d356b3feafa18
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20190731/713c8651/attachment-0001.html>


More information about the debian-edu-commits mailing list