aboutsummaryrefslogtreecommitdiff
path: root/scripts/ynh_add_swap
diff options
context:
space:
mode:
authorSalamandar <6552989+Salamandar@users.noreply.github.com>2024-05-27 14:56:29 +0200
committerGitHub <noreply@github.com>2024-05-27 14:56:29 +0200
commit8003baea29c5a5679c7475078ef16263e911b116 (patch)
treecf5d2bb10ddb7e32b53ba0de888007b6f8341782 /scripts/ynh_add_swap
parenta75e6726bca8d3b8a076da4164cd7a18ed29d06e (diff)
parent7727e250c3c616bc59c311f20ec6d3e7f773d5da (diff)
downloadmastodon_ynh-8003baea29c5a5679c7475078ef16263e911b116.tar.gz
mastodon_ynh-8003baea29c5a5679c7475078ef16263e911b116.tar.bz2
mastodon_ynh-8003baea29c5a5679c7475078ef16263e911b116.zip
Merge pull request #449 from YunoHost-Apps/testing
Testing Packaging v2
Diffstat (limited to 'scripts/ynh_add_swap')
-rw-r--r--scripts/ynh_add_swap7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/ynh_add_swap b/scripts/ynh_add_swap
index d7ec44b..aa82c51 100644
--- a/scripts/ynh_add_swap
+++ b/scripts/ynh_add_swap
@@ -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 2.5G 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