From 968c35b61b6edf3a80e9cffb2d5e953b0aea7cd3 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 5 Nov 2023 22:49:30 +0100 Subject: [PATCH] create-lx-container.sh: - add output of 'previous comman in case of failure. - add comment for mounting diskspace to lxc config. --- create-lx-container.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/create-lx-container.sh b/create-lx-container.sh index 1669946..c1051d3 100755 --- a/create-lx-container.sh +++ b/create-lx-container.sh @@ -878,6 +878,19 @@ else done fi echo -e "\033[1G [ \033[31m\033[1mfailed\033[m ] ${msg_failed}${blank_signs}" + + echo "" + if [[ "$LXC_DIST" = "ubuntu" ]] ; then + echo -e " Command was: + lxc-create -n $LXC_NAME -t download -P $(dirname \"$LXC_CONTAINER_DIR\")\" -- \\ + --no-validate -d $LXC_DIST --release $LXC_RELEASE --arch amd64" + elif [[ "$LXC_DIST" = "debian" ]]; then + echo -e " Command was: + lxc-create -n ${LXC_NAME} -t ${LXC_DIST} -P $(dirname \"${LXC_CONTAINER_DIR}\")\" -- \\ + --release ${XC_RELEASE}--arch amd64" + fi + echo "" + fatal "$(cat $err_msg)" fi @@ -1185,6 +1198,13 @@ lxc.start.order = 100 # Limt memory to 1GB less than full Memory of the server # - lxc.cgroup.memory.limit_in_bytes = $(( $(free -b | grep -oP '\d+' | head -n 1)-1000000000 )) + + +# Exposing a directory on the host machine to an LXC container +# +# - lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 +# +#lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 EOF if [[ $? -ne 0 ]]; then _failed=true @@ -1259,6 +1279,13 @@ lxc.start.order = 100 # Limt memory to 1GB less than full Memory of the server # - lxc.cgroup.memory.limit_in_bytes = $(( $(free -b | grep -oP '\d+' | head -n 1)-1000000000 )) + + +# Exposing a directory on the host machine to an LXC container +# +# - lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 +# +#lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 EOF if [[ $? -ne 0 ]]; then _failed=true @@ -1350,6 +1377,13 @@ lxc.start.order = 100 # Limt memory to 1GB less than full Memory of the server # - lxc.cgroup.memory.limit_in_bytes = $(( $(free -b | grep -oP '\d+' | head -n 1)-1000000000 )) + + +# Exposing a directory on the host machine to an LXC container +# +# - lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 +# +#lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 EOF if [[ $? -ne 0 ]]; then _failed=true @@ -1426,6 +1460,13 @@ lxc.start.order = 100 # Limt memory to 1GB less than full Memory of the server # - lxc.cgroup.memory.limit_in_bytes = $(( $(free -b | grep -oP '\d+' | head -n 1)-1000000000 )) + + +# Exposing a directory on the host machine to an LXC container +# +# - lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 +# +#lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0 EOF if [[ $? -ne 0 ]]; then _failed=true