mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Better handling of config when launching a new LXC
This commit is contained in:
parent
f4f95d224c
commit
0bb042552f
1 changed files with 9 additions and 7 deletions
16
lib/lxc.sh
16
lib/lxc.sh
|
@ -5,13 +5,15 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
LXC_CREATE () {
|
LXC_CREATE () {
|
||||||
lxc launch yunohost:$LXC_BASE $LXC_NAME | grep -v -E "^\s*Remapping container filesystem\s*$"
|
lxc launch yunohost:$LXC_BASE $LXC_NAME \
|
||||||
local returncode=${PIPESTATUS[0]}
|
-c security.nesting=true \
|
||||||
[[ $returncode -eq 0 ]] || clean_exit 1
|
-c security.privileged=true \
|
||||||
lxc config set "$LXC_NAME" security.nesting true
|
-c limits.memory=80% \
|
||||||
lxc config set "$LXC_NAME" security.privileged true
|
-c limits.cpu.allowance=80% \
|
||||||
lxc config set "$LXC_NAME" limits.memory 80%
|
| grep -v -E "^\s*Remapping container filesystem\s*$"
|
||||||
lxc config set "$LXC_NAME" limits.cpu.allowance 80%
|
|
||||||
|
[[ "${PIPESTATUS[0]}" -eq 0 ]] || clean_exit 1
|
||||||
|
|
||||||
_LXC_START_AND_WAIT $LXC_NAME
|
_LXC_START_AND_WAIT $LXC_NAME
|
||||||
set_witness_files
|
set_witness_files
|
||||||
lxc snapshot $LXC_NAME snap0
|
lxc snapshot $LXC_NAME snap0
|
||||||
|
|
Loading…
Add table
Reference in a new issue