Version 0.3 I write this program just because I bought Pulsar ES5+ UPS for protect my Internet server. Software what I get form MGE's WWW server imho not apply to Linux ideology. My program like many others UPS daemons check only for three state of UPS: OK, power fail, low battery and send this information to init in usual way - write state of UPS to file /etc/powerstatus & send SIGPWR to init. If program started with option -pwroff or -q the UPS turn power off. Unlike many others UPS "Pulsar" turn off even if main supply restored during shutdown procedure when monitoring daemon already killed & shutdown can not be canceled. In this case power will be turned on after several (as for me just about 5) seconds. To install mgeupsd on your system type make install it will install mgeupsd and its manpages. To run mgeupsd just insert to any startup script (depend on your distribution, f.e. rc.M in slackware, in RH you may create your own SXXrunups - see example in rc.d.sample) line mgeupsd [options] ttyline where ttyline is the name of tty port where UPS connected to your machine. ttyline may be defined as ttyXnn or /dev/ttyXnn. The possible options are: -pwroff -q - turn ups off -t trace_file - turn on trace of UPS<->computer communication protocol. Use only for debugging - this produce a huge output. Since trace_file stay opened all time to its remove you must kill mgeupsd before. -l - Use syslog for reporting. off by default, but very useful option. -i N - set UPS checking interval to N seconds. Default 10 -li N - set to N interval for reporting battery low status. Usually if battery low status reported init must start immediate shutdown. When shutdown started it must kill mgeupsd. If mgeupsd not killed during N seconds the low battery status will be reported again. Default 30 -s on|off - turn power saving mode on or off (see UPS manual for more information about power saving mode) -p on|off - turn total discharge protection on or off (see UPS manual for more information about total discharge protection) Since version 0.3 you may use your UPS not only for protecting the computer, powered from UPS. You may connect to computer UPS which protect any other equipment (f.e. rack-mount modems). For this case there are some additional options: -pwrfile filename - Change power status filename from default (/etc/powerstatus) to something else. -process pid - Change pid of process to send SIGPWR from default (1 - init) to pid. mgeupsd check is this process running. -run /path/cmd - Don't send SIGPWR at all, but run specified program & give power status file as a first argument. Note that program must be specified with full path. -swpwr W,B - Switch (turn off/on) power. Argument W set the time in minutes to wait before turning power back to on. Argument B set the time in seconds to wait before turning power off. You may set only one time (f.e. -swpwr W or -swpwr ,B or even -swpwr ,) - in this case unspecified time will be set to 0. Note that the time before power off must be in seconds, but the time before power on - in minutes. If waiting time for turn UPS back to on set to 0, power will be turned off just about 5 seconds. Several examples: Start monitoring with sending SIGPWR to process 1111 mgeupsd -l -pwrfile /tmp/pwf -process 1111 ttyS3 Start monitoring with running /sbin/mdmpwfail when UPS status changes. Look in rc.d.sample/mdmpwfail.skeleton for example. mgeupsd -l -pwrfile /tmp/pwf -run /sbin/mdmpwfail ttyS3 Switch power for 5 seconds. mgeupsd -swpwr , ttyS3 Wait 20 seconds & turn off power for a 5 minutes. mgeupsd -swpwr 5,20 ttyS3 Turn power off for 1 minute immediately mgeupsd -swpwr 1 ttyS3 After announcing version 0.1 I receive a lot of e-mail with questions about cable. UPS must be connected to machine by usual RS-232 9pin to 9pin cable. Pins on connectors must be connected one-to-one, i.e. 1-1,2-2,..9-9. Those cable was included to my UPS from factory. If you have not such cable you can buy it in nearest computer shop or make it by yourself. If port on your machine has 25pin connector to connect included cable you can use usual 25_to_9 adaptor. To make this cable by yourself use this table: Machine UPS 25pin 9pin female male 2 - 3 * 3 - 2 * 4 - 7 5 - 8 6 - 6 7 - 5 * 8 - 1 * 20 - 4 22 - 9 The wires marked by (*) is mandatory. That all. If you have any suggestion or question about this program don't hesitate write to me. My E-mail: stas@esc.kharkov.com