pwrmon(7) —
NAME
pwrmon − UPS shutdown support driver
DESCRIPTION
The pwrmon driver is a psuedo-driver which shuts down the computer in the event of a power failure. The computer must have a UPS (Uninterruptible Power Supply) which hooks up to the computer’s serial port. The UPS must indicate a power outage by sending a signal through either the RI (Ring Indicator) or DCD (Data Carrier Detect) line of the serial cable. If the UPS can switch itself off though RTS (Request to Send) or DTR (Data Term Ready), the pwrmon driver will switch off the UPS to conserve its battery.
Note that since pwrmon is a pseudo-driver, the asy(7) driver must be configured for the serial port to which the UPS is connected. Defining which signal indicates a power failure and which signal switches off the UPS is done in /etc/conf/pack.d/pwrmon/space.c.
The following flags are used in the space.c file:
UPSfrom_RI
If this flag is set, the pwrmon driver will expect the UPS to invert the RI (Ring Indicator) signal to notify the driver that a power outage has ocurred. If this flag is not set, the pwrmon driver will expect the DCD (Data Carrier Detect) signal to be inverted when a power outage occurs.
UPSpwrfailhi
If this flag is set, the pwrmon driver will expect a high signal from the UPS in the case of a power outage. If this flag is not set, the pwrmon driver will expect a low signal in the event of a power outage.
UPSoff_RTS
If this flag is set, the pwrmon driver will raise the RTS signal (Request to Send) line to switch off the UPS after the computer has been brought down. If this flag is not set, the pwrmon driver will set the DTR (Data Term Ready) signal to switch off the UPS.
For example, from /etc/conf/pack.d/pwrmon/space.c:
short pwr_flag_dflt = UPSoff_RTS | UPSpwrfailhi
This pwr_flag_dflt variable initializes the pwrmon driver to expect the following:
1. In the event of a power outage, the DCD line will be inverted (as UPSfrom_RI has not been specified).
2. The UPS will send a high signal to the computer when a power outage has ocurred. (In this case, the pwrmon driver will expect the UPS to set the DCD high in the event of a power failure.)
3. The computer will switch off the UPS by sending a signal on the RTS line when the system is completely down.
The pwrmon driver requires a daemon to shut down the system in the event of a power failure. This daemon will shut down the computer if the power has been out for more than 60 seconds. The daemon can be passed flags to alter the time interval before the computer is shut down. See /etc/rc2.d/*pwrmon for details.
SEE ALSO
ADDED VALUE
This entry, supplied by SunSoft, Inc., is an extension of UNIX System V.
\*U — Version 1.0