There is a method to make NUT's upsmon app shut down after X minutes on 
battery rather than after the batteries reach "low" status.  The method is 
referenced in the FAQ and described in far more detail than I care to read in 
upsshed.txt, which on a gentoo machine will be installed somewhere 
like /usr/share/doc/nut-2.0.4-r1/upssched.txt.gz


From the FAQ:

 Q: How can I make upsmon shut down my system after some fixed interval?

 A: You probably don't want to do this, since it doesn't maximize your
    runtime on battery.  Assuming you have a good reason for it (see
    the next entry), then look at upssched.txt or the upssched man
    page for some ideas.

-----------------------------------------------------------------------------

 Q: Why doesn't upsmon shut down my system?  I pulled the plug and
    nothing happened.

 A: Wait.  upsmon doesn't consider a UPS to be critical until it's both
    'on battery' and 'low battery' at the same time.  This is by design.
    Nearly every UPS supports the notion of detecting the low battery
    all by itself.  When the voltage drops below a certain point, it
    _will_ let you know about it.

    If your system has a really complicated shutdown procedure, you
    might need to shut down before the UPS raises the low battery flag.
    For most users, however, the default behavior is adequate.

    Ask yourself this: why buy a nice big UPS with the matching battery
    and corresponding runtime and then shutdown early?  If anything, I'd
    rather have a few more minutes running on battery during which the
    power might return.  Once the power's back, it's business as usual
    with no visible interruption in service.

    If you purposely shut down early, you guarantee an interruption in
    service by bringing down the box.

    See upssched.txt for information on how you can shutdown early if
    this is what you really want to do.


As for starting powstatd from gentoo's init system, all I can say is good 
luck, I'm afraid even if I hadn't replaced gentoo's sysvinit system with 
initng over a year ago I still hadn't looked hard enough to know 
how /etc/inittab works in gentoo.  Hopefully someone else will know.


On Monday 08 January 2007 10:41 pm, Dale wrote:
> Thomas Kear wrote:
> > Have you considered other software alternatives?
> >
> > My prefered UPS monitor is NUT (sys-power/nut on gentoo)
> > www.networkupstools.org
> >
> > Highly (and I do mean HIGHLY) configurable, support for many different
> > brands of UPS, shutdown of multiple network-connected PCs on the same
> > UPS, even GUI apps for display of UPS state data (see
> > net-misc/knutclient).
> >
> > Have a look if it does what you need.
> >
> > --Thomas
>
> Actually, that is what I have been using, or trying to.  It just doesn't
> do the same as powstatd.  It waits until the batteries are about dead
> then does it's thing.  Powstatd doesn't.  I can set it to wait a certain
> amount of time after power fails then tell it to shut down.  Generally
> where I live, if the power is off more than about 5 minutes, it will be
> a while.  There is no need for me to run down the batteries and shorten
> their lifespan just because the program is set up that way.  That said,
> the last time I had a power failure, it didn't do anything.  It just ran
> until it died.  It was pissed too.
>
> I'm just hoping I can get powstatd installed and working.  I have tried
> before but it never worked right.  Gentoo has different init stuff.  I
> think that is the biggest problem is the init part.  Mandrake has the
> number system where Gentoo has, boot, default etc.  I just couldn't get
> it installed right manually.
>
> Thanks for the info though.  I wish it did work the same as powstatd.
>
> Dale
>
> :-)  :-)  :-)  :-)
>
> --
> www.myspace.com/dalek1967

Attachment: pgpFbbrWCepbP.pgp
Description: PGP signature

Reply via email to