[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#920861: Use same $HOSTNAME for hosts on LAN and WiFi



Hi Wolfgang,

On  Do 31 Jan 2019 13:14:07 CET, Wolfgang Schweer wrote:

On Tue, Jan 29, 2019 at 09:28:02PM +0000, Mike Gabriel wrote:
This could all be avoided if the update-hostname-from-ip could be taught the
above (or a similar) hack.

Is this something, we can provide via Debian Edu directly? Our alternative
here is to override update-hostname-from-ip with dpkg-divert here locally,
which I would like to avoid.

If your only intention is to set the hostname once and stay unchanged
(regardless of any possible side-effects) then the following might be a
solution:

(1) Introduce a new profile, say Dual-IP, using a patch like this one:

diff --git a/etc/dhcp/dhclient-exit-hooks.d/hostname b/etc/dhcp/dhclient-exit-hooks.d/hostname
old mode 100755
new mode 100644
index ae6718d6..f5247407
--- a/etc/dhcp/dhclient-exit-hooks.d/hostname
+++ b/etc/dhcp/dhclient-exit-hooks.d/hostname
@@ -19,7 +19,7 @@ if [ -r /etc/debian-edu/config ] ; then
	. /etc/debian-edu/config
 fi

-if echo "$PROFILE" | egrep -q 'Main-Server|Roaming-Workstation|Standalone' ; then +if echo "$PROFILE" | egrep -q 'Main-Server|Roaming-Workstation|Standalone|Dual-IP' ; then
	exit 0
	else
if echo "$PROFILE" | egrep -q 'Workstation|LTSP-Server|Thin-Client-Server|Minimal' ; then
diff --git a/etc/network/if-up.d/hostname b/etc/network/if-up.d/hostname
index d6b2b34e..34bc5192 100755
--- a/etc/network/if-up.d/hostname
+++ b/etc/network/if-up.d/hostname
@@ -19,7 +19,7 @@ if [ -r /etc/debian-edu/config ] ; then
	. /etc/debian-edu/config
 fi

-if echo "$PROFILE" | egrep -q 'Main-Server|Roaming-Workstation|Standalone' ; then +if echo "$PROFILE" | egrep -q 'Main-Server|Roaming-Workstation|Standalone|Dual-IP' ; then
	exit 0
	else
if echo "$PROFILE" | egrep -q 'Workstation|LTSP-Server|Thin-Client-Server|Minimal' ; then

IMO this patch wouldn't mess up anything else, but please check.


(2) Configure the workstation:

hostname <wanted name>
hostname > /etc/hostname
sed -i 's#Workstation#Workstation, Dual-IP#' /etc/debian-edu/config

Wolfgang

How about "Wireless-Workstation"? Plus, don't we have to introduce that profile name at various other places (NOTE: I am not talking about the installer, this profile name change should happen at post-install by some admin)?

I am willing to work on that, I just want to make sure, others are on board with such a change.

We could also address this like mailservers handle mail account tag delimiters:

  Workstation
  Workstation+Dual-IP
  Workstation+SmartBoard
  Workstation+[<feature1>|<feature2>|...]

Mike

--

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
mobile: +49 (1520) 1976 148
landline: +49 (4354) 8390 139

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

Attachment: pgpBHC07sZQ8n.pgp
Description: Digitale PGP-Signatur


Reply to: