From 37bac48c8a12ac63798984aea3abbf808d653753 Mon Sep 17 00:00:00 2001 From: Kayou Date: Fri, 29 Jan 2021 22:06:54 +0100 Subject: [PATCH] Fix swapoff before reset --- lib/lxc.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/lxc.sh b/lib/lxc.sh index 8c5f536..a143d77 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -101,7 +101,7 @@ LXC_STOP () { LXC_RESET () { timeout 30 lxc stop --timeout 15 $LXC_NAME --force 2>/dev/null - swapoff $(cat /proc/swaps | grep "ynh-appci-buster-amd64-stable-test/rootfs/swap_") 2>/dev/null + swapoff /var/snap/lxd/common/lxd/containers/$LXC_NAME/rootfs/swap_* 2>/dev/null lxc delete $LXC_NAME --force 2>/dev/null } @@ -178,4 +178,3 @@ RUN_INSIDE_LXC() { lxc exec $LXC_NAME -- $@ } -