[BACK]Return to rc.shutdown CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc

File: [cvs.NetBSD.org] / src / etc / rc.shutdown (download)

Revision 1.3.4.1, Wed Aug 9 18:39:38 2000 UTC (19 years ago) by lukem
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Changes since 1.3: +2 -2 lines

pull up revs 1.4
approved by: thorpej

	1.4:
	run rcorder with `-k shutdown', so that only the scripts with a
	`shutdown' keyword get run at shutdown time.

#!/bin/sh
#
# $NetBSD: rc.shutdown,v 1.3.4.1 2000/08/09 18:39:38 lukem Exp $
#
# rc.shutdown.sh --
#	Run the scripts in /etc/rc.d with reverse rcorder.

export HOME=/
export PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /etc/rc.subr
. /etc/rc.conf

if ! checkyesno do_rcshutdown; then
	echo "Skipping shutdown hooks."
	exit 0
fi

stty status '^T'

#	Set shell to ignore SIGINT (2), but not children;
#	shell catches SIGQUIT (3) and returns to single user.
#
trap : 2
trap "echo 'Shutdown interrupted.'; exit 1" 3

files=`rcorder -k shutdown /etc/rc.d/*`
for i in $files; do			# reverse order of files
	nfiles="$i $nfiles"
done
files=$nfiles

for i in $files; do
	run_rc_script $i stop
done

date
exit 0