Subject: rc.shutdown isn't enough.
To: None <tech-userlevel@netbsd.org>
From: Michael Graff <explorer@flame.org>
List: tech-userlevel
Date: 04/25/1999 10:31:37
At first I thought run levels sucked, but /etc/rc.shutdown isn't any
better, really.

The problem is, I want to be able to do these two things:

	(1) General system cleanup (kill processes, etc)

	(2) Unmount all file systems, unconfigure all raid and ccd
            devices, etc.  This is important to avoid that raid parity
            check.

	(3) Tell the UPS it is ok to power me down, or with apm just
            power myself off.

The problem is, rc.shutdown says:

	#       $NetBSD: rc.shutdown,v 1.1 1998/10/29 20:24:57 bad Exp $

	# System shutdown script run by shutdown before halting/rebooting
	# or going single-user.

But when going to single user I want the disks to remain around, but
when halting/rebooting I don't.

I'm not certain that run levels would help, but:

level SINGLE -> MULTI
	do normal startup stuff

level MULTI -> SINGLE
	kill normal processes

level SINGLE -> HALTED
	unconfigure configured disks, unmount fs, mount / as read
	only.

Each of these should have an rc.* type of file at the least, or init
should tell rc.shutdown exactly what it is planning to do.

--Michael