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

Annotation of src/etc/rc.d/mountall, Revision 1.9

1.1       lukem       1: #!/bin/sh
                      2: #
1.9     ! wiz         3: # $NetBSD: mountall,v 1.8 2009/10/18 21:58:37 haad Exp $
1.1       lukem       4: #
                      5:
1.6       tsutsui     6: # REQUIRE: mountcritremote named ypbind
1.1       lukem       7: # PROVIDE: mountall
                      8:
1.4       mycroft     9: $_rc_subr_loaded . /etc/rc.subr
1.1       lukem      10:
                     11: name="mountall"
1.7       haad       12: start_cmd="mountall_start"
                     13: stop_cmd="mountall_stop"
                     14:
                     15: mountall_start()
                     16: {
1.9     ! wiz        17:        echo 'Mounting all file systems...'
1.7       haad       18:        if [ -f /etc/zfs/zpool.cache ]; then
                     19:                # Get ZFS module loaded (and thereby, zvols created).
                     20:                zfs list > /dev/null 2>&1
1.8       haad       21:                # Initialize zvols so they can be mounted
                     22:                zfs volinit
1.7       haad       23:                # Mount file systems noted in fstab.
                     24:                mount -a
                     25:                # Mount ZFS file systems.
                     26:                zfs mount -a
                     27:        else
                     28:                # Mount file systems noted in fstab.
                     29:                mount -a
                     30:        fi
                     31: }
                     32:
                     33: mountall_stop()
                     34: {
1.9     ! wiz        35:        echo 'Unmounting all file systems...'
1.7       haad       36:        if [ -f /etc/zfs/zpool.cache ]; then
                     37:                # Unmount ZFS file systems.
                     38:                zfs unmount -a
                     39:                # Unmount file systems noted in fstab.
                     40:                umount -a
                     41:                # Unload ZFS module, so disk devices are closed.
                     42:                modunload zfs
                     43:        else
                     44:                # Otherwise, just deal with fstab.
                     45:                umount -a
                     46:        fi
                     47: }
1.1       lukem      48:
1.3       lukem      49: load_rc_config $name
1.1       lukem      50: run_rc_command "$1"

CVSweb <webmaster@jp.NetBSD.org>