mountcritlocal (298514) | mountcritlocal (299349) |
---|---|
1#!/bin/sh 2# | 1#!/bin/sh 2# |
3# $FreeBSD: head/etc/rc.d/mountcritlocal 298514 2016-04-23 16:10:54Z lme $ | 3# $FreeBSD: head/etc/rc.d/mountcritlocal 299349 2016-05-10 08:44:44Z trasz $ |
4# 5 6# PROVIDE: mountcritlocal 7# REQUIRE: root hostid_save mdconfig 8# KEYWORD: nojail shutdown 9 10. /etc/rc.subr 11 --- 20 unchanged lines hidden (view full) --- 32 check_startmsgs && echo -n 'Mounting local filesystems:' 33 mount_excludes='no' 34 for i in ${netfs_types}; do 35 fstype=${i%:*} 36 mount_excludes="${mount_excludes}${fstype}," 37 done 38 mount_excludes=${mount_excludes%,} 39 | 4# 5 6# PROVIDE: mountcritlocal 7# REQUIRE: root hostid_save mdconfig 8# KEYWORD: nojail shutdown 9 10. /etc/rc.subr 11 --- 20 unchanged lines hidden (view full) --- 32 check_startmsgs && echo -n 'Mounting local filesystems:' 33 mount_excludes='no' 34 for i in ${netfs_types}; do 35 fstype=${i%:*} 36 mount_excludes="${mount_excludes}${fstype}," 37 done 38 mount_excludes=${mount_excludes%,} 39 |
40 # Originally, root mount hold had to be released before mounting 41 # the root filesystem. This delayed the boot, so it was changed 42 # to only wait if the root device isn't readily available. This 43 # can result in this script executing before all the devices - such 44 # as graid(8) - are available. Thus, should the mount fail, 45 # we will wait for the root mount hold release and retry. | |
46 mount -a -t ${mount_excludes} 47 err=$? 48 if [ ${err} -ne 0 ]; then | 40 mount -a -t ${mount_excludes} 41 err=$? 42 if [ ${err} -ne 0 ]; then |
49 echo | |
50 echo 'Mounting /etc/fstab filesystems failed,' \ 51 'will retry after root mount hold release' | 43 echo 'Mounting /etc/fstab filesystems failed,' \ 44 'will retry after root mount hold release' |
52 53 waited=0 54 while [ ${waited} -lt ${root_hold_delay} ]; do 55 holders="$(sysctl -n vfs.root_mount_hold)" 56 if [ -z "${holders}" ]; then 57 break; 58 fi 59 if [ ${waited} -eq 0 ]; then 60 echo -n "Waiting ${root_hold_delay}s" \ 61 "for the root mount holders: ${holders}" 62 else 63 echo -n . 64 fi 65 if [ ${waited} -eq ${root_hold_delay} ]; then 66 break 2 67 fi 68 sleep 1 69 waited=$(($waited + 1)) 70 done | 45 root_hold_wait |
71 mount -a -t ${mount_excludes} 72 err=$? 73 fi 74 75 check_startmsgs && echo '.' 76 77 case ${err} in 78 0) 79 ;; 80 *) 81 echo 'Mounting /etc/fstab filesystems failed,' \ 82 'startup aborted' 83 stop_boot true 84 ;; 85 esac 86} 87 88load_rc_config $name 89run_rc_command "$1" | 46 mount -a -t ${mount_excludes} 47 err=$? 48 fi 49 50 check_startmsgs && echo '.' 51 52 case ${err} in 53 0) 54 ;; 55 *) 56 echo 'Mounting /etc/fstab filesystems failed,' \ 57 'startup aborted' 58 stop_boot true 59 ;; 60 esac 61} 62 63load_rc_config $name 64run_rc_command "$1" |