mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
Fix fallocate can't be used
This commit is contained in:
parent
0e1bc68586
commit
951a1bbf9c
1 changed files with 5 additions and 2 deletions
|
@ -76,8 +76,11 @@ ynh_add_swap () {
|
||||||
# If there's enough space for a swap, and no existing swap here
|
# If there's enough space for a swap, and no existing swap here
|
||||||
if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ]
|
if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ]
|
||||||
then
|
then
|
||||||
# Preallocate space for the swap file
|
# Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case
|
||||||
fallocate -l ${swap_size}K /swap_$app
|
if ! fallocate -l ${swap_size}K /swap_$app
|
||||||
|
then
|
||||||
|
dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size}
|
||||||
|
fi
|
||||||
chmod 0600 /swap_$app
|
chmod 0600 /swap_$app
|
||||||
# Create the swap
|
# Create the swap
|
||||||
mkswap /swap_$app
|
mkswap /swap_$app
|
||||||
|
|
Loading…
Add table
Reference in a new issue