RIP PCVT userland.
[dragonfly/netmp.git] / etc / rc.d / swap2
blobc48a18e4008835982877b4e64c79102a40717cfe
1 #!/bin/sh
3 # $NetBSD: swap2,v 1.6 2002/03/22 04:34:00 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/swap2,v 1.2 2002/06/13 22:14:36 gordon Exp $
5 # $DragonFly: src/etc/rc.d/Attic/swap2,v 1.1 2003/07/24 06:35:37 dillon Exp $
8 # PROVIDE: nonlocalswap
9 # REQUIRE: mountcritremote
10 # BEFORE: DAEMON
12 . /etc/rc.subr
14 name="swap2"
15 start_cmd="swap2_start"
17 swap2_start()
19 # "Critical" file systems are now mounted. Go ahead and swap
20 # to files now, since they will be residing in the critical file
21 # systems (or, at least, they should be...).
22 # Check for no swap, and warn about it unless that is desired.
24 swapctl -A -t noblk;
25 if ! checkyesno no_swap; then
26 if swapctl -s | grep "no swap devices configured" > /dev/null;
27 then
28 warn "No swap space configured!"
33 # Remove all non-block-type swap devices
35 stop_cmd="swapctl -U -t noblk"
37 load_rc_config swap
38 run_rc_command "$1"