Skip to content

Commit

Permalink
Fix a bug when swapfile doesn't exist (#6068)
Browse files Browse the repository at this point in the history
I made a mistake in #6066 and
should have checked if the file exists first.
  • Loading branch information
huydhn authored Dec 16, 2024
1 parent dc41aa1 commit 7d2feba
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ fi

${post_install}

# Cleanup any existing swapfile just to be sure
sudo swapoff /swapfile
sudo rm /swapfile
if [[ -f /swapfile ]]; then
# Cleanup any existing swapfile just to be sure
sudo swapoff /swapfile
sudo rm /swapfile
fi
# before allocating a new one
sudo fallocate -l 3G /swapfile
sudo chmod 600 /swapfile
Expand Down

0 comments on commit 7d2feba

Please sign in to comment.