aboutsummaryrefslogtreecommitdiff
path: root/init.d/swap.in
diff options
context:
space:
mode:
Diffstat (limited to 'init.d/swap.in')
-rw-r--r--init.d/swap.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.d/swap.in b/init.d/swap.in
index 6b2f7057..bad2b13b 100644
--- a/init.d/swap.in
+++ b/init.d/swap.in
@@ -21,6 +21,12 @@ start()
stop()
{
ebegin "Deactivating swap devices"
+
+ # 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
+
case "${RC_UNAME}" in
NetBSD|OpenBSD) swapctl -U -t noblk >/dev/null;;
*) swapoff -a >/dev/null;;