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

Re: Finding some UPS which works with OpenBSD



On Mon, 14 Oct 2002, David Rio wrote:

> Hi all:
>
> I want to buy a UPS system to protect my server machines against power
> faults. My servers run openbsd so I would like to find some UPS system
> which work with openbsd. Looking the mailling list archives I have found
> some info about this topic but no one point me to some good UPS system. My
> question is: is there anyone who is using some UPS system with his openbsd
> machine? I know that exist some package (basically nut) which was created
> to do this kind of things but I would like to know your experiences with
> this topic.
>
>


I just bought a Belkin Universal UPS.  800va, AVR, both USB and serial
ports, both types of cables included, for $120 at Office Depot.  The
software is called Bulldog Plus.  On the CD are binaries for Windows, the
MacOS, linux, FreeBSD (2 versions), SCO and some other stuff.

I started trying to get the freebsd3_4 version working.  Since I've never
tried running anything under freebsd emulation I got stuck.  The software
comes with its own install program and its own uninstall program--both
simple shell scripts.

The install went fine, but the daemon couldn't communicate with the UPS
because it couldn't, if memory serves, open the serial port.

Thinking I'd uninstall it and try again with a different serial port
identifier, I quickly scanned the uninstall program, didn't see anything
amiss, and ran it.  As root, as required.

Bad choice.  I should have read the program more carefully.  The script
isn't long, so here it is.

[jross@rand.openvistas.net] $ cat uninstall
#!/bin/sh
# Copyright 2001, Belkin Components.
# Script Name: uninstall
# Date: Dec/06/2001
# Description: Uninstallation program for Bulldog Plus
# Platform: FreeBSD

path

DeleteALine()
{
ed - /etc/rc.local <<!
g/S99bulldog/d
w
q
!
}

set `/usr/bin/whoami`
if [ $1 != "root" ]
then
        echo "You must login under root to execute this program."
        echo "Bye !"
        exit
fi
echo
echo -n "Do you really want to remove the Belkin Bulldog Plus?[y|n] "
read answer
if [ $answer = "y" ]
then
        pid=`/bin/cat $path/UPSD.PID 2> /dev/null`
#       pid=`/bin/ps -e | grep upsd | cut -d" " -c1-5`
        if [ "${pid}" != "" ]
        then
                kill -9 $pid
        fi
        rm -rf $path/*
        rm -f $path/*
        rm -f /usr/lib/libupshttp.so
        rm -f /etc/upsd.path
        DeleteALine
        echo
        echo "Uninstallation complete."
        echo
else
        echo "Bye !"

That simple path statement all by itself is supposed to
actually be where the path variable is set. When it isn't set, $path is
then a null variable.

rm -rf $path/* takes on a whole new meaning when $path is null.

So, now we all know how I came to have the Oct 3 snapshot on my web
server, and came to find out that qmail can't work with a /var
partition that is nosuid.

All of that aside, this seems to be a great UPS.  And yes, I'll still try
to get the daemon running.

Right now I'm trying to figure out a better backup strategy using CD-R
instead of tape ;-)

Jeff

-- 
Jeff Ross
Open Vistas Networking, Inc.
http://www.openvistas.net