[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

upsd



I installed upsd and made up a cable as per the README.gz file.  (I
have an APC Back-UPS 400VA).  I commented out the required line in
/etc/init.d/ups and added the line '/dev/ttyS1' where my ups is
plugged in.

After rebooting the computer I decided to test it.  (Only had the
monitor plugged into the  ups at this point).  So I yanked the plug. 
In about 30 seconds got the messaged "INIT: cannot execute
init.d/powerfail.

Sure enough inittab contained three lines calling a non-existant
powerfail script.  This was not mentioned in the documentation.  Guess
it's a bug against upsd.

Anyway I created a powerfail script somthing like this:

case "$1" in
start)
      echo "self destruct ordered by Captain Kirk"
      ;;
stop)
      echo "self destruct cancelled by Mr. Spock"
      ;;
*)
      ;;
esac

Now when I yank the plug I get the first message.  When I replace the
plug I get the second message.  I can repeat this an always get the
same results.  Goooood!

Now add the line
 shutdown -h +2
to the start case and the line
 shutdown -c 
to the stop case.

I try it again.  This time when I yank the plug I get the first
message, and a message from shutdown.  I then replace the plug and
wait.  I never got the second message and the system halts.  Hmmmm it
seems that executing the shutdown command stopped the upsd dameon from
detecting that power came back.

So I try it again but I type the command 
shutdown -c myself before the system does halt.
I get the second message from the powerfail script and the shutdown -c
command is executed by the script! My shutdown -c command errors out
because there is no shutdown command running to cancel at this point!

Any ideas what is going on here?

PS.  Running debian 2.0 on a Gateway 486-66 if this matters.  Thanks
in advance!

PPS.  Tried issuing the upsd -k command with the ups plug yanked.  In
about 30 seconds the monitor died from lack of juice and the ups was
yailling.  Well the kill power bit worked.  But this command was NEVER
issued when the system went down after yanking the plug.




_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


Reply to: