.TH UPSD 1 "15 January 1999" .SH NAME upsd \- shutdown in event of power failure .br .\" .\" we don't need a .br/.ne 5 here since there .\" isn't any chance really, that we're already .\" anywhere near the end of the first page. .\" .\" Version information .\" $Header: /home/ahuxley/dev/supported/upsd/man/RCS/upsd.8.shpp,v 1.3 1999/01/15 13:15:07 alexis Exp $ .\" .SH SYNOPSIS .B "upsd \-V" .br .B "upsd" [ .B \-d .I level | -v ] [ .B \-ic ] [ .B \-iw ] [ .B \-is ] [ .B \-pc .I program ] [ .B \-pw .I program ] [ .B \-ps .I program ] .I port .br .\" .\" we don't need a .br/.ne 5 here since there .\" isn't any chance really, that we're already .\" anywhere near the end of the first page. .\" .SH DESCRIPTION This man page documents .I upsd version MARKER_PATCHLEVEL. .PP .I Upsd is intended to be run in the manner of a daemon. It monitors the signal lines provided on an external UPS and shuts down the machine in the event of a mains power failure. .PP In the event of a mains power failure, .I upsd first calls .I wall\fR(1) to regularly inform users of the situation and of how much of the shutdown interval time remains. Once this time has elapsed, .I upsd calls .I shutdown\fR(8) with appropriate options to immediately shut down the machine. In the event that mains power is restored before the shutdown interval has elapsed, then .I upsd calls .I wall\fR(1) again to inform users of the change in situation. .PP Once .I upsd has processed all options and is about to settle down to its monitoring cycle, then all notable events are recorded via .I syslog\fR(8). .br .ne 5 .SH OPTIONS .\" This indents everything after the next line by 25 somethings. .TP 25 .B \-V Print the version number and exit. .TP .B \-v Sets the verbosity level to 3. .TP .B \-d \fIlevel Sets the verbosity level to .I level\fR. .TP .B \-ic \fIsecs Sets the interval between mains power checks to \fIsecs\fR seconds. The default is 1 second. .TP .B \-iw \fIsecs Sets the intervals between warning messages sent to users in the event of a mains power failure to \fIsecs\fR seconds. The default is 30 seconds. .TP .B \-is \fIsecs Sets the interval between mains power failure and system shutdown to \fIsecs\fR seconds. The default is 240 seconds. .TP .B \-pw \fIprogram Specifies that \fIprogram\fR should be run when otherwise a message would be sent to all users warning of an impending shutdown. \fIprogram\fR is called without command line parameters but with status information set in the environment. See ENVIRONMENT below for more details. .TP .B \-pc \fIprogram Specifies that \fIprogram\fR should be run when otherwise a message would be sent to all users informing them that the impending shutdown has been cancelled. \fIprogram\fR is called without command line parameters but with status information set in the environment. See ENVIRONMENT below for more details. .TP .B \-ps \fIprogram Specifies that \fIprogram\fR should be run when otherwise the system would be shut down. \fIprogram\fR is called without command line parameters but with status information set in the environment. See ENVIRONMENT below for more details. .PD .br .ne 5 .SH EXAMPLES It is envisaged that .I upsd will be started from .B /etc/rc.local (See .I rc\fR(8)) with a command such as: .IP .nf MARKER_LCLBINDIR/upsd -is 300 /dev/tty00 > /dev/null 2>&1 & .fi .PP or perhaps in a country where English is not the spoken language: .IP .nf MARKER_LCLBINDIR/upsd -is 300 -pw /usr/local/bin/upsd.warn -pc \\ /usr/local/bin/upsd.canc /dev/tty00 > /dev/null 2>&1 & .fi .PP where the shutdown interval is appropriate to the length of time that the UPS can deliver battery power after a mains power failure. .br .ne 5 .PD .SH FILES .PD 0 .TP 25 .B MARKER_LOCK_DIR/upsd.pid Lock file created by .I upsd\fR. Note that the precise name of the file depends on compile-time options. .PD .br .ne 5 .SH ENVIRONMENT VARIABLES .I Upsd does not make use of any enviroment variables itself, but does add the following to the enviroment before calling any of the programs specified with the \fI-pw\fR, \fI-pc\fR or \fI-ps\fR options: .PD 0 .TP 25 .B UPSD_STATE Set to \fBimpending\fR, \fBcancelled\fR or \fBimmediate\fR in correspondance with the shutdown scheduled as a result of mains power failure. .TP 25 .B UPSD_INTERVAL If .B UPSD_STATE is set to .B impending then this environment variable is set to the interval after which the shut down will activated. The interval is measured in seconds. .PD .br .ne 5 .SH DIAGNOSTICS No diagnostic messages are so cryptic that they need to be explained here. .br .ne 5 .SH CAVEATS .I Upsd does not understand that after mains power has been restored before the shutdown interval has elapsed, that the UPS might not yet be capable of delivering battery power for the same interval as before should the mains power fail a second time before the UPS has been fully recharged. .PP .I Upsd is currently unable to securely shutdown remote machines. .PP .I Upsd does not change /etc/nologin. .br .ne 5 .SH SEE ALSO shutdown(8), passwd(5), uucico(8), wall(1), write(1) .br .ne 5 .SH AUTHOR Alexis Huxley .br .ne 5 .SH BUGS .I Upsd does not fork to the background in the manner of a normal daemon. If that is what you want, then explicitly specify it. See EXAMPLES above. .PP Bug reports and queries should be reported to .B upsd-support@danae.demon.co.uk\fR. .PP For the latest release of .I upsd\fR, visit .B http://www.danae.demon.co.uk/software/upsd/\fR. .br .ne 5 .SH COPYRIGHT & DISTRIBUTION POLICY Copyright (C) 1995-1998 Alexis Huxley .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.