aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2007-04-15 18:07:14 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2007-04-15 18:07:14 +0000
commit2c9c9b9f7fef515ce1b7d3429dede1fa3352f6a9 (patch)
treef084abd3c64af099f90ea1664669010b4c47adab /etc
parentdb8086c4fa66f69b7deae0766d371810b31a41d6 (diff)
Notes
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/zfs18
1 files changed, 18 insertions, 0 deletions
diff --git a/etc/rc.d/zfs b/etc/rc.d/zfs
index 896fdffac7e7..6bed826ae58f 100644
--- a/etc/rc.d/zfs
+++ b/etc/rc.d/zfs
@@ -23,10 +23,28 @@ zfs_start()
if [ ! -r /etc/zfs/exports ]; then
touch /etc/zfs/exports
fi
+ # Enable swap on ZVOLs with property org.freebsd:swap=on.
+ zfs list -H -o org.freebsd:swap,name -t volume | \
+ while read state name; do
+ case "${state}" in
+ [oO][nN])
+ swapon /dev/zvol/${name}
+ ;;
+ esac
+ done
}
zfs_stop()
{
+ # Disable swap on ZVOLs with property org.freebsd:swap=on.
+ zfs list -H -o org.freebsd:swap,name -t volume | \
+ while read state name; do
+ case "${state}" in
+ [oO][nN])
+ swapoff /dev/zvol/${name}
+ ;;
+ esac
+ done
zfs unshare -a
zfs unmount -a
zfs volfini