1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
|
'\" t
.\" Title: upssched.conf
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 12/29/2015
.\" Manual: NUT Manual
.\" Source: Network UPS Tools 2.7.3.1
.\" Language: English
.\"
.TH "UPSSCHED\&.CONF" "5" "12/29/2015" "Network UPS Tools 2\&.7\&.3\&." "NUT Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
upssched.conf \- Configuration for upssched timer program
.SH "DESCRIPTION"
.sp
This file controls the operations of \fBupssched\fR(8), the timer\-based helper program for \fBupsmon\fR(8)\&.
.SH "CONFIGURATION DIRECTIVES"
.PP
\fBCMDSCRIPT\fR \fIscriptname\fR
.RS 4
Required\&. This must be above any AT lines\&. This script is used to invoke commands when your timers are triggered\&. It receives a single argument which is the name of the timer that caused it to trigger\&.
.RE
.PP
\fBPIPEFN\fR \fIfilename\fR
.RS 4
Required\&. This sets the file name of the socket which will be used for interprocess communications\&. This should be in a directory where normal users can\(cqt create the file, due to the possibility of symlinking and other evil\&.
.RE
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBCaution\fR
.ps -1
.br
.sp
if you are running Solaris or similar, the permissions that upssched sets on this file \fBare not enough\fR to keep you safe\&. If your OS ignores the permissions on a FIFO, then you MUST put this in a protected directory!
.sp .5v
.RE
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
by default, \fBupsmon\fR(8) will run upssched as whatever user you have defined with RUN_AS_USER in \fBupsmon.conf\fR(8)\&. Make sure that user can create files and write to files in the path you use for PIPEFN and LOCKFN\&.
.sp .5v
.RE
.sp
My recommendation: create a special directory for upssched, make it owned by your upsmon user, then use it for both\&.
.sp
The stock version of the upssched\&.conf ships with PIPEFN disabled to make you visit this portion of the documentation and think about how your system works before potentially opening a security hole\&.
.PP
\fBLOCKFN\fR \fIfilename\fR
.RS 4
Required\&. upssched attempts to create this file in order to avoid a race condition when two events are dispatched from upsmon at nearly the same time\&. This file will only exist briefly\&. It must not be created by any other process\&.
.sp
You should put this in the same directory as PIPEFN\&.
.RE
.PP
\fBAT\fR \fInotifytype\fR \fIupsname\fR \fIcommand\fR
.RS 4
Define a handler for a specific event
\fInotifytype\fR
on UPS
\fIupsname\fR\&.
\fIupsname\fR
can be the special value * to apply this handler to every UPS\&.
.sp
This will perform the command
\fIcommand\fR
when the
\fInotifytype\fR
and
\fIupsname\fR
match the current activity\&. Possible values for
\fIcommand\fR
are:
.PP
\fBSTART\-TIMER\fR \fItimername\fR \fIinterval\fR
.RS 4
Start a timer of
\fIinterval\fR
seconds\&. When it triggers, it will pass the argument
\fItimername\fR
as an argument to your CMDSCRIPT\&.
.sp
Example:
.sp
Start a timer that\(cqll execute when any UPS (*) has been gone for 10 seconds
.sp
.if n \{\
.RS 4
.\}
.nf
AT COMMBAD * START\-TIMER upsgone 10
.fi
.if n \{\
.RE
.\}
.RE
.PP
\fBCANCEL\-TIMER\fR \fItimername\fR [\fIcmd\fR]
.RS 4
Cancel a running timer called
\fItimername\fR, if possible\&. If the timer has passed then pass the optional argument
\fIcmd\fR
to CMDSCRIPT\&.
.sp
Example:
.sp
If a specific UPS (myups@localhost) comes back online, then stop the timer before it triggers
.sp
.if n \{\
.RS 4
.\}
.nf
AT COMMOK myups@localhost CANCEL\-TIMER upsgone
.fi
.if n \{\
.RE
.\}
.RE
.PP
\fBEXECUTE\fR \fIcommand\fR
.RS 4
Immediately pass
\fIcommand\fR
as an argument to CMDSCRIPT\&.
.sp
Example:
.sp
If any UPS (*) reverts to utility power, then execute
ups\-back\-on\-line
via CMDSCRIPT\&.
.sp
.if n \{\
.RS 4
.\}
.nf
AT ONLINE * EXECUTE ups\-back\-on\-line
.fi
.if n \{\
.RE
.\}
.RE
.RE
.sp
Note that any AT that matches both the \fInotifytype\fR and the \fIupsname\fR for the current event will be used\&.
.sp
For a complete list of \fInotifytype\fR possible values, refer to the section NOTIFY EVENTS in \fBupsmon\fR(8)\&.
.SH "SEE ALSO"
.sp
\fBupssched\fR(8), \fBupsmon\fR(8)
.SS "Internet resources:"
.sp
The NUT (Network UPS Tools) home page: http://www\&.networkupstools\&.org/
|