]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/swap2
Stop method for swap1 script was introduced, because gmirror needed it.
[FreeBSD/FreeBSD.git] / etc / rc.d / swap2
1 #!/bin/sh
2 #
3 # $NetBSD: swap2,v 1.6 2002/03/22 04:34:00 thorpej Exp $
4 # $FreeBSD$
5 #
6
7 # PROVIDE: nonlocalswap
8 # REQUIRE: mountcritremote
9 # BEFORE:  DAEMON
10
11 . /etc/rc.subr
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 load_rc_config swap
37 run_rc_command "$1"