Subject: UPS shutdown - shutdownhook_establish
To: None <tech-kern@NetBSD.ORG>
From: Dan J Fraser <dfraser@beorn.mentasm.com>
List: tech-kern
Date: 04/16/1997 22:09:54
I'm working on some software for my Back-UPS 400.  

Bascially, I need to raise the DTR line on one of my com ports at the end of
system shutdown to turn off the power to the computer.  It's been suggested
that I use a shutdown hook for this, but the manpage has me worried:

-snip-
  happen immediately before the kernel exits.  Because of the environment
  in which they are run, shutdown hooks cannot rely on many system services
  (including file systems, and timeouts and other interrupt-driven services),
  or even basic system integrity (because the system could be re-
  booting after a crash).
-snip-

Is there a "safe" way to handle my situation?  If so, is there some example
source code I should look at to get started?

--
Dan J. Fraser -- dfraser@mother.com 
http://www.mother.com/~dfraser/
IRC Nick: Optic   Finger me for PGP public key 
Anytime things appear to be going better, you've overlooked something.