home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3163 / README < prev    next >
Encoding:
Text File  |  1991-04-04  |  3.8 KB  |  109 lines

  1.     Tue Apr 02 23:24:20 HST 1991    art@pilikia.pegasus.com        Pg. 1
  2.  
  3.  
  4.     INTRODUCTION
  5.  
  6.     The UPS monitor daemon or "upsd"  watches the serial port
  7.     connected to an UPS and will perform an unattended shutdown
  8.     of the system if the UPS is on battery longer than a specified
  9.     number of minutes.  Upsd needs to watch a tty with modem control
  10.     properties, and expects the UPS to raise DCD when it switches
  11.     to battery backup and drop DCD when it goes back to online.
  12.     Upsd was developed and tested under ISC with the FAS 2.08 driver
  13.     and an American Power Conversion SmartUPS 600, your milage may
  14.     vary on other OSes and UPSes.
  15.  
  16.     The C source was written for system V and hence will require 
  17.     some work to get it working under BSD or other UNIXes, the
  18.     program is built via the Makefile.  A number of configurable
  19.     defaults are in common.h, you may want to hack that file before
  20.     making upsd.  Although the program can be run manually from the
  21.     command line, users will most likely want the program to start
  22.     automatically from their /etc/rc script (SYS5R2) or a script
  23.     in /etc/rc2.d (SYS5R3).  The Makefile by default installs upsd
  24.     in the /etc directory when the install target is made.  
  25.  
  26.  
  27.     Tue Apr 02 23:24:20 HST 1991    art@pilikia.pegasus.com        Pg. 2
  28.  
  29.  
  30.     COMMAND LINE OPTIONS
  31.  
  32.     Upsd runtime behavior can be configured either on the command
  33.     line or via environment variables.  The command line options
  34.     take precedence to the environment variable settings, and are
  35.     as follows:
  36.  
  37.     usage: upsd [-d tty][-c cmd][-l log][-t min]
  38.         -d tty        pathname of UPS device
  39.         -c cmd        pathname of shutdown command
  40.         -l log        pathname of UPS log file
  41.         -t min        delay time in minutes
  42.  
  43.     The -d tty option must specify the full pathname (including the
  44.     /dev/ prefix) to the tty device the UPS is on.
  45.  
  46.     Example:
  47.  
  48.     upsd -d /dev/ttyFM00
  49.  
  50.     The -c cmd option specifies the full pathname of the command
  51.     to be executed to shut down the system.  This command must
  52.     be enclosed in quotes if it consists of 2 or more words.
  53.  
  54.     Example:
  55.  
  56.     upsd -d /dev/ttyFM00 -c "/etc/shutdown -y -g1 -i0"
  57.  
  58.     The -l option specified the logfile upsd will write it's event
  59.     messages to, these messages give the date and time that the UPS
  60.     daemon started, switched to battery, switched back to online,
  61.     executed the shutdown command, or was terminated via SIGTERM.
  62.  
  63.     Example:
  64.  
  65.     upsd -d /dev/ttyFM00 -c "/etc/shutdown -y -g1 -i0" -l /etc/upslog
  66.  
  67.     Finally, the -t option specifies the number of minutes to allow
  68.     the UPS to be on battery backup before executing the shutdown
  69.     sequence.  This number must be between 1 and 30.  Be careful not
  70.     to choose a value greater than the number of minutes of battery
  71.     time your UPS supports with your current load.  A value in the
  72.     5 to 10 minute range is probably sufficient.
  73.  
  74.     Example:
  75.  
  76.     upsd -d /dev/ttyFM00 -c "/etc/shutdown -y -g1 -i0" -l /etc/upslog -t 10
  77.     
  78.     Tue Apr 02 23:24:20 HST 1991    art@pilikia.pegasus.com        Pg. 3
  79.  
  80.  
  81.     ENVIRONMENT VARIABLES
  82.  
  83.     The following environment variables can be set if that interface
  84.     is preferred to the command line options.  Note again that command
  85.     line options override the environment variable settings.
  86.  
  87.  
  88.     Environment    Equivalent        Default
  89.     Variable    Command line option    Value
  90.     UPSPORT            -p        /dev/ttyFM00
  91.     UPSSHUT            -c        "/etc/shutdown -y -g1 -i0"
  92.     UPSLOG            -l        /etc/upslog
  93.     UPSTIME            -t        10
  94.  
  95.     Note that the compiled in default values can be altered in common.h
  96.     and the program can be recompiled.  If no command line options or
  97.     environment variables exist, the defaults will be used.  The table
  98.     above gives the environment variables looked for by the program and
  99.     their command line option counterparts.  All the rules applying to
  100.     the command line options apply to the environment variables as well.
  101.  
  102.     If you have any comments or suggestions regarding my program,
  103.     send email to the following address:
  104.  
  105.     Arthur W. Neilson III
  106.     INET: art@pilikia.pegasus.com
  107.     UUCP: uunet!ucsd!nosc!pilikia!art
  108.  
  109.