1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $NetBSD: mountcritlocal,v 1.3 2000/07/26 00:11:49 lukem Exp $
| 3# $NetBSD: mountcritlocal,v 1.7 2002/04/29 12:29:53 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/mountcritlocal 98184 2002-06-13 22:14:37Z gordon $
|
4# 5 6# PROVIDE: mountcritlocal 7# REQUIRE: root
| 5# 6 7# PROVIDE: mountcritlocal 8# REQUIRE: root
|
| 9# KEYWORD: FreeBSD NetBSD
|
8 9. /etc/rc.subr 10 11name="mountcritlocal" 12start_cmd="mountcritlocal_start" 13stop_cmd=":" 14 15mountcritlocal_start() 16{
| 10 11. /etc/rc.subr 12 13name="mountcritlocal" 14start_cmd="mountcritlocal_start" 15stop_cmd=":" 16 17mountcritlocal_start() 18{
|
17 # mount critical local filesystems 18 # (as specified in $critical_filesystems_beforenet) 19 # 20 mount_critical_filesystems local
| 19 case `${CMD_OSTYPE}` in 20 FreeBSD) 21 # Set up the list of network filesystem types for which mounting 22 # should be delayed until after network initialization. 23 networkfs_types='nfs:NFS smbfs:SMB portalfs:PORTAL' 24 case ${extra_netfs_types} in 25 [Nn][Oo]) 26 ;; 27 *) 28 networkfs_types="${networkfs_types} ${extra_netfs_types}" 29 ;; 30 esac
|
21
| 31
|
22 # clean up left-over files. 23 # this could include the cleanup of lock files and /var/run, etc. 24 # 25 rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/* 26 (cd /var/run && rm -rf -- *)
| 32 # Mount everything except nfs filesystems. 33 mount_excludes='no' 34 for i in ${networkfs_types}; do 35 fstype=${i%:*} 36 mount_excludes="${mount_excludes}${fstype}," 37 done 38 mount_excludes=${mount_excludes%,} 39 mount -a -t ${mount_excludes} 40 41 case $? in 42 0) 43 ;; 44 *) 45 echo 'Mounting /etc/fstab filesystems failed,' \ 46 ' startup aborted' 47 exit 1 48 ;; 49 esac 50 ;; 51 NetBSD) 52 # Mount critical filesystems that are `local' 53 # (as specified in $critical_filesystems_local) 54 # This usually includes /var. 55 # 56 mount_critical_filesystems local 57 58 # clean up left-over files. 59 # this could include the cleanup of lock files and /var/run, etc. 60 # 61 rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/* 62 (cd /var/run && rm -rf -- *) 63 ;; 64 esac
|
27} 28 29load_rc_config $name 30run_rc_command "$1"
| 65} 66 67load_rc_config $name 68run_rc_command "$1"
|