mirror of
https://github.com/searx/searx
synced 2024-12-12 08:46:26 +01:00
[fix] creation of /.lxcenv in containers
In utils/lib.sh there are two functions with the same name, but different tasks. Rename one of them from lxc_init_container() into lxc_init_container_env(). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
c748047e92
commit
c2caf9569c
10
utils/lib.sh
10
utils/lib.sh
@ -1073,7 +1073,7 @@ in_container() {
|
|||||||
# to be safe, take a look at the environment of process 1 (/sbin/init)
|
# to be safe, take a look at the environment of process 1 (/sbin/init)
|
||||||
# grep -qa 'container=lxc' /proc/1/environ
|
# grep -qa 'container=lxc' /proc/1/environ
|
||||||
|
|
||||||
# see lxc_init_container
|
# see lxc_init_container_env
|
||||||
[[ -f /.lxcenv ]]
|
[[ -f /.lxcenv ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1083,12 +1083,12 @@ if in_container; then
|
|||||||
LXC_ENV_FOLDER="lxc/$(hostname)/"
|
LXC_ENV_FOLDER="lxc/$(hostname)/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lxc_init_container() {
|
lxc_init_container_env() {
|
||||||
|
|
||||||
# Create a /.lxcenv file in the root folder. Call this once after container
|
# usage: lxc_init_container_env <name>
|
||||||
# is inital started.
|
|
||||||
|
|
||||||
# usage: lxc_create_root_dot_lxcenv <name>
|
# Create a /.lxcenv file in the root folder. Call this once after the
|
||||||
|
# container is inital started and before installing any boilerplate stuff.
|
||||||
|
|
||||||
info_msg "create /.lxcenv in container $1"
|
info_msg "create /.lxcenv in container $1"
|
||||||
cat <<EOF | lxc exec "${1}" -- bash | prefix_stdout "[${_BBlue}${1}${_creset}] "
|
cat <<EOF | lxc exec "${1}" -- bash | prefix_stdout "[${_BBlue}${1}${_creset}] "
|
||||||
|
@ -538,6 +538,7 @@ lxc_install_boilerplate() {
|
|||||||
if lxc start -q "${container_name}" &>/dev/null; then
|
if lxc start -q "${container_name}" &>/dev/null; then
|
||||||
sleep 5 # guest needs some time to come up and get an IP
|
sleep 5 # guest needs some time to come up and get an IP
|
||||||
fi
|
fi
|
||||||
|
lxc_init_container_env "${container_name}"
|
||||||
info_msg "[${_BBlue}${container_name}${_creset}] install /.lxcenv.mk .."
|
info_msg "[${_BBlue}${container_name}${_creset}] install /.lxcenv.mk .."
|
||||||
cat <<EOF | lxc exec "${container_name}" -- bash | prefix_stdout "[${_BBlue}${container_name}${_creset}] "
|
cat <<EOF | lxc exec "${container_name}" -- bash | prefix_stdout "[${_BBlue}${container_name}${_creset}] "
|
||||||
rm -f "/.lxcenv.mk"
|
rm -f "/.lxcenv.mk"
|
||||||
|
Loading…
Reference in New Issue
Block a user