[cloud][lxc] Prevent hostname to be set (#22246)
If the host .bashrc holds a var named HOSTNAME, the container where the lxc_container module will attach to will inherit from this var, potentially breaking some applications (like rabbitmqctl) due to an incorrect $HOSTNAME reported in the container.
This commit is contained in:
parent
f53921093f
commit
19b49a9224
1 changed files with 1 additions and 0 deletions
|
@ -541,6 +541,7 @@ ATTACH_TEMPLATE = """#!/usr/bin/env bash
|
|||
pushd "$(getent passwd $(whoami)|cut -f6 -d':')"
|
||||
if [[ -f ".bashrc" ]];then
|
||||
source .bashrc
|
||||
unset HOSTNAME
|
||||
fi
|
||||
popd
|
||||
|
||||
|
|
Loading…
Reference in a new issue