1 |
There is a method to make NUT's upsmon app shut down after X minutes on |
2 |
battery rather than after the batteries reach "low" status. The method is |
3 |
referenced in the FAQ and described in far more detail than I care to read in |
4 |
upsshed.txt, which on a gentoo machine will be installed somewhere |
5 |
like /usr/share/doc/nut-2.0.4-r1/upssched.txt.gz |
6 |
|
7 |
|
8 |
From the FAQ: |
9 |
|
10 |
Q: How can I make upsmon shut down my system after some fixed interval? |
11 |
|
12 |
A: You probably don't want to do this, since it doesn't maximize your |
13 |
runtime on battery. Assuming you have a good reason for it (see |
14 |
the next entry), then look at upssched.txt or the upssched man |
15 |
page for some ideas. |
16 |
|
17 |
----------------------------------------------------------------------------- |
18 |
|
19 |
Q: Why doesn't upsmon shut down my system? I pulled the plug and |
20 |
nothing happened. |
21 |
|
22 |
A: Wait. upsmon doesn't consider a UPS to be critical until it's both |
23 |
'on battery' and 'low battery' at the same time. This is by design. |
24 |
Nearly every UPS supports the notion of detecting the low battery |
25 |
all by itself. When the voltage drops below a certain point, it |
26 |
_will_ let you know about it. |
27 |
|
28 |
If your system has a really complicated shutdown procedure, you |
29 |
might need to shut down before the UPS raises the low battery flag. |
30 |
For most users, however, the default behavior is adequate. |
31 |
|
32 |
Ask yourself this: why buy a nice big UPS with the matching battery |
33 |
and corresponding runtime and then shutdown early? If anything, I'd |
34 |
rather have a few more minutes running on battery during which the |
35 |
power might return. Once the power's back, it's business as usual |
36 |
with no visible interruption in service. |
37 |
|
38 |
If you purposely shut down early, you guarantee an interruption in |
39 |
service by bringing down the box. |
40 |
|
41 |
See upssched.txt for information on how you can shutdown early if |
42 |
this is what you really want to do. |
43 |
|
44 |
|
45 |
As for starting powstatd from gentoo's init system, all I can say is good |
46 |
luck, I'm afraid even if I hadn't replaced gentoo's sysvinit system with |
47 |
initng over a year ago I still hadn't looked hard enough to know |
48 |
how /etc/inittab works in gentoo. Hopefully someone else will know. |
49 |
|
50 |
|
51 |
On Monday 08 January 2007 10:41 pm, Dale wrote: |
52 |
> Thomas Kear wrote: |
53 |
> > Have you considered other software alternatives? |
54 |
> > |
55 |
> > My prefered UPS monitor is NUT (sys-power/nut on gentoo) |
56 |
> > www.networkupstools.org |
57 |
> > |
58 |
> > Highly (and I do mean HIGHLY) configurable, support for many different |
59 |
> > brands of UPS, shutdown of multiple network-connected PCs on the same |
60 |
> > UPS, even GUI apps for display of UPS state data (see |
61 |
> > net-misc/knutclient). |
62 |
> > |
63 |
> > Have a look if it does what you need. |
64 |
> > |
65 |
> > --Thomas |
66 |
> |
67 |
> Actually, that is what I have been using, or trying to. It just doesn't |
68 |
> do the same as powstatd. It waits until the batteries are about dead |
69 |
> then does it's thing. Powstatd doesn't. I can set it to wait a certain |
70 |
> amount of time after power fails then tell it to shut down. Generally |
71 |
> where I live, if the power is off more than about 5 minutes, it will be |
72 |
> a while. There is no need for me to run down the batteries and shorten |
73 |
> their lifespan just because the program is set up that way. That said, |
74 |
> the last time I had a power failure, it didn't do anything. It just ran |
75 |
> until it died. It was pissed too. |
76 |
> |
77 |
> I'm just hoping I can get powstatd installed and working. I have tried |
78 |
> before but it never worked right. Gentoo has different init stuff. I |
79 |
> think that is the biggest problem is the init part. Mandrake has the |
80 |
> number system where Gentoo has, boot, default etc. I just couldn't get |
81 |
> it installed right manually. |
82 |
> |
83 |
> Thanks for the info though. I wish it did work the same as powstatd. |
84 |
> |
85 |
> Dale |
86 |
> |
87 |
> :-) :-) :-) :-) |
88 |
> |
89 |
> -- |
90 |
> www.myspace.com/dalek1967 |