Home | History | Annotate | Line # | Download | only in rc.d
      1   1.1     lukem #!/bin/sh
      2   1.1     lukem #
      3  1.15  sborrill # $NetBSD: mountall,v 1.15 2021/03/09 12:42:46 sborrill Exp $
      4   1.1     lukem #
      5   1.1     lukem 
      6   1.6   tsutsui # REQUIRE: mountcritremote named ypbind
      7   1.1     lukem # PROVIDE: mountall
      8   1.1     lukem 
      9   1.4   mycroft $_rc_subr_loaded . /etc/rc.subr
     10   1.1     lukem 
     11   1.1     lukem name="mountall"
     12   1.7      haad start_cmd="mountall_start"
     13   1.7      haad stop_cmd="mountall_stop"
     14   1.7      haad 
     15   1.7      haad mountall_start()
     16   1.7      haad {
     17   1.9       wiz 	echo 'Mounting all file systems...'
     18  1.13       roy 
     19  1.13       roy 	# Mount ZFS filesystems first because fstab
     20  1.13       roy 	# may try and null mount paths on ZFS.
     21  1.12  riastrad 	if checkyesno zfs; then
     22   1.7      haad 		zfs mount -a
     23  1.14   hannken 		zfs share -a
     24   1.7      haad 	fi
     25  1.13       roy 
     26  1.13       roy 	# Mount file systems noted in fstab.
     27  1.13       roy 	mount -a
     28   1.7      haad }
     29   1.7      haad 
     30   1.7      haad mountall_stop()
     31   1.7      haad {
     32   1.9       wiz 	echo 'Unmounting all file systems...'
     33  1.13       roy 	# Unmount file systems noted in fstab.
     34  1.13       roy 	umount -a
     35  1.13       roy 
     36  1.13       roy 	# Unmount ZFS file systems.
     37  1.12  riastrad 	if checkyesno zfs; then
     38  1.14   hannken 		zfs unshare -a
     39   1.7      haad 		zfs unmount -a
     40   1.7      haad 	fi
     41   1.7      haad }
     42   1.1     lukem 
     43   1.3     lukem load_rc_config $name
     44  1.15  sborrill load_rc_config_var zfs zfs
     45   1.1     lukem run_rc_command "$1"
     46