summaryrefslogtreecommitdiff
path: root/init.d/swap.in
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-19 11:15:37 +0000
committerRoy Marples <roy@marples.name>2009-04-19 11:15:37 +0000
commitbbd810425b819318fda48f390fec818c20bbff39 (patch)
tree7d639c7a8ebad9987f3990fa34deec4729478642 /init.d/swap.in
parentbb6614f4e19e77f527e72f4f5c5e130f189adfc0 (diff)
downloadopenrc-bbd810425b819318fda48f390fec818c20bbff39.tar.gz
openrc-bbd810425b819318fda48f390fec818c20bbff39.tar.bz2
openrc-bbd810425b819318fda48f390fec818c20bbff39.tar.xz
Move special umount of tmpfs to the swap init script where it belongs, #149.
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 6b2f705..bad2b13 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;;