mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
Don't swap when running on a LXC
This commit is contained in:
parent
f67bb64966
commit
3adaec1210
1 changed files with 7 additions and 0 deletions
|
@ -19,6 +19,13 @@ ynh_add_swap () {
|
|||
|
||||
SD_CARD_CAN_SWAP=${SD_CARD_CAN_SWAP:-0}
|
||||
|
||||
# Can't swap inside an LXD
|
||||
if [ "$(systemd-detect-virt)" == "lxc" ]
|
||||
then
|
||||
ynh_print_warn --message="You are inside a LXC container, swap will not be added, but that can cause troubles for the app $app. Please make sure you have more than $size M available RAM."
|
||||
return
|
||||
fi
|
||||
|
||||
# Swap on SD card only if it's is specified
|
||||
if ynh_is_main_device_a_sd_card && [ "$SD_CARD_CAN_SWAP" == "0" ]
|
||||
then
|
||||
|
|
Loading…
Add table
Reference in a new issue