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