Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1062938

Bug#990278: [PATCH] init_buildsystem: Move hostname ip entry to the end of /etc/hosts

From Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Newsgroups linux.debian.bugs.dist
Subject Bug#990278: [PATCH] init_buildsystem: Move hostname ip entry to the end of /etc/hosts
Date 2021-06-24 15:20 +0200
Message-ID <Ctxhf-3p8-3@gated-at.bofh.it> (permalink)
References <Ctx7z-36D-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


spymemcached package is FTBFS because a test expects a reverse lookup of
127.0.0.1 to return localhost, but current /etc/hosts configuration
returns the hostname instead.

Let's move this `hostname/ip` entry to the end of /etc/hosts so the
reverse lookup of 127.0.0.1 returns localhost, which makes sense to be
the default case usually.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
---
 init_buildsystem | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/init_buildsystem b/init_buildsystem
index 23e1c40..62b7966 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -1077,11 +1077,7 @@ fi
 test -e $BUILD_ROOT/.build/init_buildsystem.data || HOST=`hostname`
 test -e $BUILD_ROOT/etc/hosts || echo "127.0.0.1 localhost" > $BUILD_ROOT/etc/hosts
 if ! grep -F "127.0.0.1 $HOST" $BUILD_ROOT/etc/hosts > /dev/null ; then
-    # this makes a reverse lookup on 127.0.0.1 return the host name,
-    # which is bad, but 127.0.0.2 does not work on all unix systems
-    echo "127.0.0.1 $HOST" > $BUILD_ROOT/etc/hosts.new
-    test -f $BUILD_ROOT/etc/hosts && cat $BUILD_ROOT/etc/hosts >> $BUILD_ROOT/etc/hosts.new
-    mv $BUILD_ROOT/etc/hosts.new $BUILD_ROOT/etc/hosts
+    echo "127.0.0.1 $HOST" >> $BUILD_ROOT/etc/hosts
 fi
 
 # XXX: still needed?
-- 
2.30.2

Back to linux.debian.bugs.dist | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Bug#990278: /etc/hosts: Reverse lookup on 127.0.0.1 returns hostname instead of localhost Ariel D'Alessandro <ariel.dalessandro@collabora.com> - 2021-06-24 15:00 +0200
  Bug#990278: [PATCH] init_buildsystem: Move hostname ip entry to the end of /etc/hosts Ariel D'Alessandro <ariel.dalessandro@collabora.com> - 2021-06-24 15:20 +0200

csiph-web