[BACK]Return to swap1 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

Annotation of src/etc/rc.d/swap1, Revision 1.11

1.1       lukem       1: #!/bin/sh
                      2: #
1.11    ! apb         3: # $NetBSD: swap1,v 1.10 2009/04/21 16:08:57 joerg Exp $
1.1       lukem       4: #
                      5:
                      6: # PROVIDE: localswap
1.10      joerg       7: # REQUIRE: DISKS root
1.7       lukem       8: # KEYWORD: shutdown
1.1       lukem       9:
1.9       mycroft    10: $_rc_subr_loaded . /etc/rc.subr
1.1       lukem      11:
                     12: name="swap1"
1.6       msaitoh    13: start_cmd="swap1_start"
1.7       lukem      14: stop_cmd="swap1_stop"
1.1       lukem      15:
                     16: #              Add all block-type swap devices; these might be necessary
                     17: #              during disk checks.
                     18: #
1.6       msaitoh    19: swap1_start()
                     20: {
1.11    ! apb        21:        # Treat exit status 2 from swapctl(8) as successful; it means
        !            22:        # "no error, but no suitable swap devices were configured".
        !            23:        #
1.6       msaitoh    24:        if ! checkyesno no_swap; then
1.11    ! apb        25:                swapctl -A -t blk || [ $? = 2 ]
1.6       msaitoh    26:        fi
                     27: }
1.1       lukem      28:
                     29: #              Remove all block-type swap devices
                     30: #
1.7       lukem      31: swap1_stop()
                     32: {
1.8       lukem      33:        if checkyesno swapoff || [ -n "$rc_force" ]; then
1.7       lukem      34:                echo "Removing block-type swap devices"
1.11    ! apb        35:                swapctl -U -t blk || [ $? = 2 ]
1.7       lukem      36:        fi
                     37: }
1.1       lukem      38:
1.5       lukem      39: load_rc_config swap
1.1       lukem      40: run_rc_command "$1"

CVSweb <webmaster@jp.NetBSD.org>