aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/swap-umount-tmpfs.patch
blob: 1982d4ea7321a095d9f73370ef7c2eead5875163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/init.d/swap.in b/init.d/swap.in
index fa08b4d..e358266 100644
--- a/init.d/swap.in
+++ b/init.d/swap.in
@@ -25,8 +25,10 @@ stop()
 
 	# Try to unmount all tmpfs filesystems not in use, else a deadlock may
 	# occur. As $RC_SVCDIR may also be tmpfs we cd to it to lock it
-	cd "$RC_SVCDIR"
-	umount -a -t tmpfs 2>/dev/null
+	if [ "$RC_RUNLEVEL" = "shutdown" ]; then
+		cd "$RC_SVCDIR"
+		umount -a -t tmpfs 2>/dev/null
+	fi
 
 	case "$RC_UNAME" in
 		NetBSD|OpenBSD)	swapctl -U -t noblk >/dev/null;;