Anyone using sysutils/nut ?

Garance A Drosihn drosih at rpi.edu
Wed May 24 22:15:13 PDT 2006


At 10:54 AM -0400 5/22/06, Scott "Tuc" Ellentuch at T-B-O-H wrote:
>Hi,
>
>	I'd like to find out where to put the
>"upsdrvctl shutdown" in the shutdown process. Putting
>it in rc.shutdown causes me to have dirty filesystems
>constantly that sometimes don't allow the system to
>come up.

I seem to recall someone saying that the best way to do
this was to create some flag-file, and then reboot instead
of shutdown.  Then very early in the system-startup you
look for that flag-file, and run 'upsdrvctl shutdown'.

Since you just successfully went through the complete
shutdown, all the disks should be in a safe state.
So, the UPS will yank the power out from under the
computer, but it won't matter.

The trick, of course, is to add some logic there so you
can boot up after the power has returned!  Either check
the last-change date of the flag-file, or maybe do
something to re-mount '/' as writable, delete the one
file, and re-mount it back as read-only.  I have never
done any of this with my own UPS, so I'm not sure of
the details...   :-)

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-questions mailing list