1
0
Fork 0
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:
Tagada 2023-09-25 14:13:16 +02:00 committed by Tagadda
parent f67bb64966
commit 3adaec1210

View file

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