mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Fix swap management
This commit is contained in:
parent
00498fdac6
commit
3c358a2172
2 changed files with 3 additions and 3 deletions
|
@ -33,7 +33,7 @@ install_dependance() {
|
||||||
expect ffmpeg \
|
expect ffmpeg \
|
||||||
memcached libmemcached-dev \
|
memcached libmemcached-dev \
|
||||||
python3-scipy python3-matplotlib \
|
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
|
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
|
# 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
|
chown -R $seafile_user:$seafile_user $final_path
|
||||||
|
|
|
@ -52,7 +52,7 @@ ynh_add_swap () {
|
||||||
truncate -s 0 /swap_$app
|
truncate -s 0 /swap_$app
|
||||||
|
|
||||||
# set the No_COW attribute on the swapfile with chattr
|
# 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
|
# 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
|
if ! fallocate -l ${swap_size}K /swap_$app
|
||||||
|
@ -76,7 +76,7 @@ ynh_del_swap () {
|
||||||
# Clean the fstab
|
# Clean the fstab
|
||||||
sed -i "/#Swap added by $app/d" /etc/fstab
|
sed -i "/#Swap added by $app/d" /etc/fstab
|
||||||
# Desactive the swap file
|
# Desactive the swap file
|
||||||
swapoff /swap_$app
|
swapoff /swap_$app || true
|
||||||
# And remove it
|
# And remove it
|
||||||
rm /swap_$app
|
rm /swap_$app
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue