Changeset View
Changeset View
Standalone View
Standalone View
etc/rc.d/mountcritremote
#!/bin/sh | #!/bin/sh | ||||
# | # | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
# PROVIDE: mountcritremote | # PROVIDE: mountcritremote | ||||
# REQUIRE: NETWORKING FILESYSTEMS ipsec netwait | # REQUIRE: NETWORKING FILESYSTEMS ipsec netwait | ||||
# KEYWORD: nojail | # KEYWORD: nojail | ||||
. /etc/rc.subr | . /etc/rc.subr | ||||
name="mountcritremote" | name="mountcritremote" | ||||
desc="Mount critical remote filesystems" | |||||
stop_cmd=":" | stop_cmd=":" | ||||
start_cmd="mountcritremote_start" | start_cmd="mountcritremote_start" | ||||
start_precmd="mountcritremote_precmd" | start_precmd="mountcritremote_precmd" | ||||
# Mount NFS filesystems if present in /etc/fstab | # Mount NFS filesystems if present in /etc/fstab | ||||
# | # | ||||
# XXX When the vfsload() issues with nfsclient support and related sysctls | # XXX When the vfsload() issues with nfsclient support and related sysctls | ||||
# have been resolved, this block can be removed, and the condition that | # have been resolved, this block can be removed, and the condition that | ||||
Show All 14 Lines | |||||
mountcritremote_start() | mountcritremote_start() | ||||
{ | { | ||||
# Mount nfs filesystems. | # Mount nfs filesystems. | ||||
# | # | ||||
case "`/sbin/mount -d -a -t nfs`" in | case "`/sbin/mount -d -a -t nfs`" in | ||||
'') | '') | ||||
;; | ;; | ||||
*) | *) | ||||
echo -n 'Mounting NFS file systems:' | echo -n 'Mounting NFS filesystems:' | ||||
mount -a -t nfs | mount -a -t nfs | ||||
echo '.' | echo '.' | ||||
;; | ;; | ||||
esac | esac | ||||
# Mount other network filesystems if present in /etc/fstab. | # Mount other network filesystems if present in /etc/fstab. | ||||
case ${extra_netfs_types} in | case ${extra_netfs_types} in | ||||
[Nn][Oo]) | [Nn][Oo]) | ||||
;; | ;; | ||||
*) | *) | ||||
netfs_types="${netfs_types} ${extra_netfs_types}" | netfs_types="${netfs_types} ${extra_netfs_types}" | ||||
;; | ;; | ||||
esac | esac | ||||
for i in ${netfs_types}; do | for i in ${netfs_types}; do | ||||
fstype=${i%:*} | fstype=${i%:*} | ||||
fsdecr=${i#*:} | fsdecr=${i#*:} | ||||
[ "${fstype}" = "nfs" ] && continue | [ "${fstype}" = "nfs" ] && continue | ||||
case "`mount -d -a -t ${fstype}`" in | case "`mount -d -a -t ${fstype}`" in | ||||
*mount_${fstype}*) | *mount_${fstype}*) | ||||
echo -n "Mounting ${fsdecr} file systems:" | echo -n "Mounting ${fsdecr} filesystems:" | ||||
mount -a -t ${fstype} | mount -a -t ${fstype} | ||||
echo '.' | echo '.' | ||||
;; | ;; | ||||
esac | esac | ||||
done | done | ||||
# Cleanup /var again just in case it's a network mount. | # Cleanup /var again just in case it's a network mount. | ||||
/etc/rc.d/cleanvar quietreload | /etc/rc.d/cleanvar quietreload | ||||
rm -f /var/run/clean_var /var/spool/lock/clean_var | rm -f /var/run/clean_var /var/spool/lock/clean_var | ||||
} | } | ||||
load_rc_config $name | load_rc_config $name | ||||
run_rc_command "$1" | run_rc_command "$1" |