2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: mountcritlocal,v 1.7 2002/04/29 12:29:53 lukem Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: mountcritlocal
|
2003-12-14 13:36:36 +00:00
|
|
|
# REQUIRE: root
|
2004-01-17 10:16:38 +00:00
|
|
|
# KEYWORD: FreeBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="mountcritlocal"
|
|
|
|
start_cmd="mountcritlocal_start"
|
|
|
|
stop_cmd=":"
|
|
|
|
|
|
|
|
mountcritlocal_start()
|
|
|
|
{
|
2002-09-06 16:18:05 +00:00
|
|
|
case ${OSTYPE} in
|
2002-06-13 22:14:37 +00:00
|
|
|
FreeBSD)
|
|
|
|
# Set up the list of network filesystem types for which mounting
|
|
|
|
# should be delayed until after network initialization.
|
|
|
|
case ${extra_netfs_types} in
|
|
|
|
[Nn][Oo])
|
|
|
|
;;
|
|
|
|
*)
|
2003-06-01 01:43:37 +00:00
|
|
|
netfs_types="${netfs_types} ${extra_netfs_types}"
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Mount everything except nfs filesystems.
|
|
|
|
mount_excludes='no'
|
2003-06-01 01:43:37 +00:00
|
|
|
for i in ${netfs_types}; do
|
2002-06-13 22:14:37 +00:00
|
|
|
fstype=${i%:*}
|
|
|
|
mount_excludes="${mount_excludes}${fstype},"
|
|
|
|
done
|
|
|
|
mount_excludes=${mount_excludes%,}
|
|
|
|
mount -a -t ${mount_excludes}
|
|
|
|
|
|
|
|
case $? in
|
|
|
|
0)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo 'Mounting /etc/fstab filesystems failed,' \
|
|
|
|
' startup aborted'
|
2003-12-09 08:17:33 +00:00
|
|
|
kill -QUIT $$
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
NetBSD)
|
|
|
|
# Mount critical filesystems that are `local'
|
|
|
|
# (as specified in $critical_filesystems_local)
|
|
|
|
# This usually includes /var.
|
|
|
|
#
|
|
|
|
mount_critical_filesystems local
|
|
|
|
|
|
|
|
# clean up left-over files.
|
|
|
|
# this could include the cleanup of lock files and /var/run, etc.
|
|
|
|
#
|
|
|
|
rm -f /etc/nologin /var/spool/lock/LCK.* /var/spool/uucp/STST/*
|
|
|
|
(cd /var/run && rm -rf -- *)
|
|
|
|
;;
|
|
|
|
esac
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|