1 #!/bin/sh 2 # 3 # $NetBSD: mountall,v 1.8 2009/10/18 21:58:37 haad Exp $ 4 # 5 6 # REQUIRE: mountcritremote named ypbind 7 # PROVIDE: mountall 8 9 $_rc_subr_loaded . /etc/rc.subr 10 11 name="mountall" 12 start_cmd="mountall_start" 13 stop_cmd="mountall_stop" 14 15 mountall_start() 16 { 17 echo 'Mounting all filesystems...' 18 if [ -f /etc/zfs/zpool.cache ]; then 19 # Get ZFS module loaded (and thereby, zvols created). 20 zfs list > /dev/null 2>&1 21 # Initialize zvols so they can be mounted 22 zfs volinit 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 { 35 echo 'Unmounting all filesystems...' 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 } 48 49 load_rc_config $name 50 run_rc_command "$1" 51