Q: Can I interpose a program of my own design in the midst of the power-off sequence?

A: If the Workspace Manager is running, or if loginwindow is running, yes,  you might be able to interpose something.  If neither of these is running, no, there's nothing you can do.

When you press the power key (on NeXT hardware), or select the one of the power-off options on non-NeXT hardware, the Workspace Manager or loginwindow then requests confirmation from the user; if the power-off is confirmed, both exec halt(8), passing it the -e and the -p options (eject disks, and power-off).  You could replace

	/etc/halt

with a program (compiled or shell script) of your own design, which would eventually exec the real halt.  Note that it must pass along its arguments to the real halt.

QA483

Valid for 1.0, 2.0, 3.0, 3.1