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