summaryrefslogtreecommitdiffstats
path: root/main/openrc/swap-umount-tmpfs.patch
blob: d68165c77ab6f34168ff26a43603456185c8c0f4 (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 fef8ab3..c540bc2 100644
--- a/init.d/swap.in
+++ b/init.d/swap.in
@@ -24,8 +24,10 @@ stop()
 
 	# Try to unmount all tmpfs filesystems not in use, else a deadlock may
 	# occure. 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;;