aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-03 19:12:53 +0000
committerRoy Marples <roy@marples.name>2008-03-03 19:12:53 +0000
commit6ca5e8e0dc82391edce42e35a408fb2c1ca54fac (patch)
tree2806504c1ea000c4b234f3738149202614ff075f
parente55cb5dd5b9e222aecc28961f6459e0c370c5796 (diff)
Use swapctl for NetBSD.
-rw-r--r--init.d/swap.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/init.d/swap.in b/init.d/swap.in
index f64ddc59..4e027982 100644
--- a/init.d/swap.in
+++ b/init.d/swap.in
@@ -10,14 +10,22 @@ depend()
start()
{
- ebegin "Activating swap"
- swapon -a >/dev/null
+ ebegin "Activating swap devices"
+ if type swapctl >/dev/null 2>&1; then
+ swapctl -A -t noblk >/dev/null
+ else
+ swapon -a >/dev/null
+ fi
eend 0 # If swapon has nothing todo it errors, so always return 0
}
stop()
{
- ebegin "Deactivating swap"
- swapoff -a >/dev/null
+ ebegin "Deactivating swap devices"
+ if type swapctl >/dev/null 2>&1; then
+ swapctl -U -t noblk >/dev/null
+ else
+ swapoff -a >/dev/null
+ fi
eend 0
}