From 3c358a21725266b0163afbed7286945b00961063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 23 Aug 2022 15:02:09 +0200 Subject: [PATCH] Fix swap management --- scripts/_common.sh | 2 +- scripts/experimental_helper.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index dd45e7c..0f8e7e7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -33,7 +33,7 @@ install_dependance() { expect ffmpeg \ memcached libmemcached-dev \ python3-scipy python3-matplotlib \ - libjpeg62-turbo-dev zlib1g-dev # For building pillow + libjpeg62-turbo-dev zlib1g-dev libffi-dev # For building pillow ynh_add_swap --size=2000 # We need to do that because we can have some issue about the permission access to the pip cache without this chown -R $seafile_user:$seafile_user $final_path diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index ae0188e..f0e79ae 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -52,7 +52,7 @@ ynh_add_swap () { truncate -s 0 /swap_$app # set the No_COW attribute on the swapfile with chattr - chattr +C /swap_$app + chattr +C /swap_$app || true # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case if ! fallocate -l ${swap_size}K /swap_$app @@ -76,7 +76,7 @@ ynh_del_swap () { # Clean the fstab sed -i "/#Swap added by $app/d" /etc/fstab # Desactive the swap file - swapoff /swap_$app + swapoff /swap_$app || true # And remove it rm /swap_$app fi