mountcritremote (124616) | mountcritremote (124622) |
---|---|
1#!/bin/sh 2# 3# $NetBSD: mountcritremote,v 1.7 2002/04/29 12:29:53 lukem Exp $ | 1#!/bin/sh 2# 3# $NetBSD: mountcritremote,v 1.7 2002/04/29 12:29:53 lukem Exp $ |
4# $FreeBSD: head/etc/rc.d/mountcritremote 124616 2004-01-17 10:16:38Z mtm $ | 4# $FreeBSD: head/etc/rc.d/mountcritremote 124622 2004-01-17 10:59:43Z mtm $ |
5# 6 7# PROVIDE: mountcritremote 8# REQUIRE: NETWORKING root mountcritlocal 9# KEYWORD: FreeBSD 10 11. /etc/rc.subr 12 13name="mountcritremote" 14stop_cmd=":" | 5# 6 7# PROVIDE: mountcritremote 8# REQUIRE: NETWORKING root mountcritlocal 9# KEYWORD: FreeBSD 10 11. /etc/rc.subr 12 13name="mountcritremote" 14stop_cmd=":" |
15start_cmd="mountcritremote_start" 16start_precmd="mountcritremote_precmd" |
|
15 | 17 |
16case ${OSTYPE} in 17 FreeBSD) 18 start_cmd="mountcritremote_start" 19 start_precmd="mountcritremote_precmd" 20 ;; 21NetBSD) 22 start_cmd="mountcritremote_start" 23 ;; 24esac 25 | |
26# Mount NFS filesystems if present in /etc/fstab 27# 28# XXX When the vfsload() issues with nfsclient support and related sysctls 29# have been resolved, this block can be removed, and the condition that 30# skips nfs in the following block (for "other network filesystems") can 31# be removed. 32# 33mountcritremote_precmd() --- 8 unchanged lines hidden (view full) --- 42 fi 43 ;; 44 esac 45 return 0 46} 47 48mountcritremote_start() 49{ | 18# Mount NFS filesystems if present in /etc/fstab 19# 20# XXX When the vfsload() issues with nfsclient support and related sysctls 21# have been resolved, this block can be removed, and the condition that 22# skips nfs in the following block (for "other network filesystems") can 23# be removed. 24# 25mountcritremote_precmd() --- 8 unchanged lines hidden (view full) --- 34 fi 35 ;; 36 esac 37 return 0 38} 39 40mountcritremote_start() 41{ |
50 case ${OSTYPE} in 51 FreeBSD) 52 # Mount nfs filesystems. 53 # 54 echo -n 'Mounting NFS file systems:' 55 mount -a -t nfs 56 echo '.' | 42 # Mount nfs filesystems. 43 # 44 echo -n 'Mounting NFS file systems:' 45 mount -a -t nfs 46 echo '.' |
57 | 47 |
58 # Mount other network filesystems if present in /etc/fstab. 59 case ${extra_netfs_types} in 60 [Nn][Oo]) 61 ;; 62 *) 63 netfs_types="${netfs_types} ${extra_netfs_types}" 64 ;; 65 esac | 48 # Mount other network filesystems if present in /etc/fstab. 49 case ${extra_netfs_types} in 50 [Nn][Oo]) 51 ;; 52 *) 53 netfs_types="${netfs_types} ${extra_netfs_types}" 54 ;; 55 esac |
66 | 56 |
67 for i in ${netfs_types}; do 68 fstype=${i%:*} 69 fsdecr=${i#*:} | 57 for i in ${netfs_types}; do 58 fstype=${i%:*} 59 fsdecr=${i#*:} |
70 | 60 |
71 [ "${fstype}" = "nfs" ] && continue | 61 [ "${fstype}" = "nfs" ] && continue |
72 | 62 |
73 case "`mount -d -a -t ${fstype}`" in 74 *mount_${fstype}*) 75 echo -n "Mounting ${fsdecr} file systems:" 76 mount -a -t ${fstype} 77 echo '.' 78 ;; 79 esac 80 done | 63 case "`mount -d -a -t ${fstype}`" in 64 *mount_${fstype}*) 65 echo -n "Mounting ${fsdecr} file systems:" 66 mount -a -t ${fstype} 67 echo '.' 68 ;; 69 esac 70 done |
81 | 71 |
82 # Cleanup /var again just in case it's a network mount. 83 /etc/rc.d/cleanvar reload 84 rm -f /var/run/clean_var /var/spool/lock/clean_var 85 ;; 86 NetBSD) 87 # Mount critical filesystems that may be `remote'. 88 # (as specified in $critical_filesystems_remote) 89 # This usually includes /usr. 90 # 91 mount_critical_filesystems remote 92 ;; 93 esac | 72 # Cleanup /var again just in case it's a network mount. 73 /etc/rc.d/cleanvar reload 74 rm -f /var/run/clean_var /var/spool/lock/clean_var |
94} 95 96load_rc_config $name 97run_rc_command "$1" | 75} 76 77load_rc_config $name 78run_rc_command "$1" |