From bb82945b417767086e56f4d92183baa9722c880d Mon Sep 17 00:00:00 2001 From: Max Erenberg Date: Sat, 21 Aug 2021 07:13:36 +0000 Subject: [PATCH] remove hostname from /etc/hosts in auth1 --- .drone/auth1-setup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.drone/auth1-setup.sh b/.drone/auth1-setup.sh index 5314f8b..bad9a17 100755 --- a/.drone/auth1-setup.sh +++ b/.drone/auth1-setup.sh @@ -23,6 +23,13 @@ add_fqdn_to_hosts() { # set FQDN in /etc/hosts add_fqdn_to_hosts $(get_ip_addr $(hostname)) auth1 +# I'm not sure why, but we also need to remove the hosts entry for the +# container's real hostname, otherwise slapd only looks for the principal +# ldap/ (this is with the sasl-host option) +sed -E "/\\b$(hostname)\\b/d" /etc/hosts > /tmp/hosts +cat /tmp/hosts > /etc/hosts +rm /tmp/hosts + export DEBIAN_FRONTEND=noninteractive apt update apt install -y psmisc