Name: Frequently Asked Questions
File: FAQ
Date: 11 August 1999

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

 Q: My UPS-specific support program (smartups, backups, etc) says 
    "Unable to open /dev/ttyxx".  I'm starting it as root and root owns
    the device, so why doesn't it work?

 A: The programs give up root _before_ they open the serial port.  So, you
    should change the permissions on the port around so that their   
    running userid can open it.  Typically this corresponds to the user
    "nobody".  If you use the --with-uid option to configure, it may be
    something else.

    Having a "ups" user that owns the serial port might not be such a bad
    idea...

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

 Q: upsc, multimon, and the other programs give me "access denied".  The
    serial port permissions are fine, so what gives?

 A: Those programs only talk over the network.  That denied message is
    coming over it from upsd.  It's denying them since they don't have
    permission to talk to it according to the access controls.

    The fix is to edit the upsd.conf to allow those hosts to do what they
    need.  Simple things like upsstats and upsc only need "monitor" level
    security while upsmon needs "login" to be functional.

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

 Q: I have a Smart-UPS connected with the grey APC cable and it won't
    work.  The Back-UPS driver works, but then I don't get to use all the
    nifty features in there.  Why doesn't the right driver work?

 A: The problem lies in your choice of cable.  APC's grey cables only do
    "dumb" signalling - very basic yes/no info about the battery and line
    status.  While that is sufficient to detect a low battery condition
    while on battery, you miss out on all the goodies that you paid for.

    The solution is to dump that cable and find one that supports APC's
    "smart" signalling.  Typically these come with the UPS and are black.
    If your smart cable has wandered off, they can be built rather easily
    with some connectors and cable - no fancy wiring or resistors.
    See this URL for a handy diagram:

    http://www.exploits.org/~rkroll/ups-0024.jpg

    That should give you a workable clone of APC's 940-0024C cable.
    There are simpler solutions involving 3 wires that work just fine
    too, but Powerchute won't find the loopback DTR-DCD and RTS-CTS and
    will be annoyed.  If you don't ever plan to use Powerchute, 3 wires
    (RxD, TxD, GND) are sufficient.

    It should also be noted that the backups driver has no way to detect
    the UPS, so it will fire up quite happily if it can open the serial
    port.  Merely having it start up is not necessarily an indication
    of success.  You should start it and then check the status with upsc
    or similar to be sure that it's reading the hardware properly.

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

 Q: configure tells me to go get gd, but I have it installed!  Why isn't it
    finding the one I installed?

 A: Chances are, you have installed gd 1.6 (or higher) which includes PNG
    support and totally eliminates GIF.  But, you don't have the PNG libs
    on your system, so gd didn't compile them in.  So, you need to go get
    libpng, install that, recompile gd, THEN rerun configure.

    Start here: http://www.cdrom.com/pub/png/pngcode.html

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

 Q: gd can't find zlib.h, so what do I do now?

 A: Go get zlib, install it, then try building gd again.

    Find zlib here: http://www.cdrom.com/pub/infozip/zlib/

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

 Q: Now gd can't find png.h, so what do I need this time?

 A: libpng.  Get it, install it, and then start the gd make again...

    libpng is here: http://www.cdrom.com/pub/png/pngcode.html

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

 Q: libpng doesn't seem to have a Makefile, so how do I build it on my
    Linux box?

 A: Besides "RTFM", perhaps you should copy scripts/makefile.lnx to
    Makefile (in the libpng directory) and then try it again.

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

 Q: OK, I built libpng and gd, so why is configure saying "no (cached)"
    for the gdImagePng detection line?

 A: configure is being a bit too clever for its own good.  rm config.cache
    and rerun it and then it will figure out how things are setup now.

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

 Q: My web browser used to be able to show the graphs, but then I installed
    0.41.3 and it stopped.  Why?

 A: Some older browsers can't handle PNGs, and 0.41.3 now uses those 
    whenever possible.  You can either upgrade to a version that handles
    the PNG format or find an older version of gd that still has the GIF
    code in it.

    You really should find a newer browser, as GIF support is one of those
    things that may be going away in the near future.  It all depends on
    how nasty the Unisys landsharks are.

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

 Q: What about Y2K compliance and this software?

 A: Three programs in this package use dates as of this writing (21 July 1999)
    ... they are:

     - multimon
     - upsstats
     - upsmon

     These all derive a date string for display/logging purposes with
     strftime().  The year is generated by using %Y, which includes the
     century, rather than something bogus like "19%y".  If your system's
     strftime implementation is sane, then this will be too.

     upsd does refer to the system clock, but only for relative timing
     information by subtracting one returned value from a previous stored
     value.  This data is not turned into a date representation.  Some 
     problems may arise in January of 2038 if your system has not been 
     fixed to deal with the signed 32 bit number of seconds problem.

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

  Q: My upsstats pages now have broken images where the bars used to be,
     and running upsimage.cgi by hand gives me something about libgd.so.0
     not being found.  How do I fix this?

  A: I bet you just installed gd 1.6.2 or higher, which uses shared 
     libraries on some systems.  You need to run ldconfig to update your
     library information before it'll run.
