create-lx-container.sh:

- add output of 'previous comman in case of failure.
   - add comment for mounting diskspace to lxc config.
This commit is contained in:
Christoph 2023-11-05 22:49:30 +01:00
parent 4cc80508e6
commit 968c35b61b

View File

@ -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