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