1 #!/bin/sh 2 # 3 # $NetBSD: swap2,v 1.1 2000/03/10 11:53:24 lukem Exp $ 4 # 5 6 # PROVIDE: nonlocalswap 7 # BEFORE: daemon 8 # REQUIRE: mountcritremote 9 10 . /etc/rc.subr 11 . /etc/rc.conf 12 13 name="swap2" 14 start_cmd="swap2_start" 15 16 swap2_start() 17 { 18 # "Critical" file systems are now mounted. Go ahead and swap 19 # to files now, since they will be residing in the critical file 20 # systems (or, at least, they should be...). 21 # Check for no swap, and warn about it unless that is desired. 22 # 23 swapctl -A -t noblk; 24 if ! checkyesno no_swap; then 25 if swapctl -s | grep "no swap devices configured" > /dev/null; 26 then 27 warn "No swap space configured!" 28 fi 29 fi 30 } 31 32 # Remove all non-block-type swap devices 33 # 34 stop_cmd="swapctl -U -t noblk" 35 36 run_rc_command "$1" 37