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