1APCUPSD(8) BSD System Manager's Manual APCUPSD(8)
2
4 apcupsd — a daemon for controlling most APC UPSes
5
7 apcupsd [-b] [-d level | --debug level] [-f file | --config-file file]
8 [-P file | --pid-file file]
9 [-p | --kill-on-powerfail | -t | --term-on-powerfail] [-R]
10
11 apcupsd [-k | --killpower | --hibernate | -o | --power-off]
12
13 apcupsd [-h | --help]
14
15 apcupsd [-V | --version]
16
18 The apcupsd daemon controls the operation of most American Power Conver‐
19 sion Corp (APC) UPSes. During a power failure, apcupsd informs users
20 about the loss of utility power and that a shutdown may occur. If util‐
21 ity power is not restored, a system shutdown will follow when the battery
22 is exhausted, a specified timeout expires, a specified battery charge
23 percentage is reached, or a specified battery runtime (based on internal
24 UPS calculations and determined by power consumption rates) expires. If
25 the utility power is restored before one of the these shutdown conditions
26 is met, apcupsd will inform users of this and the shutdown will generally
27 be cancelled. Refer to the Implementation Notes section below for situa‐
28 tions in which the shutdown may not be cancelled.
29
30 The meaning of the command line options is as follows:
31
32 -b Run in the foreground, do not detach and become a daemon.
33
34 -d level --debug level
35 Set debugging output level where level is a number greater
36 than zero.
37
38 -f file --config-file file
39 Load the specified configuration file. The default configu‐
40 ration file is /etc/apcupsd/apcupsd.conf. It must be changed
41 when running more than one copy of apcupsd on the same com‐
42 puter to control multiple UPSes.
43
44 -k | --killpower | --hibernate
45 Power down the UPS in hibernate mode after a 10 second delay.
46 This option is normally only used by apcupsd itself to power
47 down the UPS after a system shutdown has almost completed.
48 In hibernate mode, the UPS will again supply power to the
49 system when the utility power returns.
50
51 -o | --power-off
52 Power down UPS completely. The UPS will not supply power to
53 the system when the utility power returns.
54
55 -P file --pid-file file
56 Create the specified process ID file. The default is
57 /var/run/apcupsd.pid. It must be changed when running more
58 than one copy of apcupsd on the same computer to control mul‐
59 tiple UPSes.
60
61 -p --kill-on-powerfail
62 apcupsd commands the UPS to power down in hibernate mode just
63 before apcupsd starts the system shutdown. This relies on the
64 grace shutdown delay of a Smart-UPS being long enough to
65 allow the system to shutdown completely before the UPS shuts
66 off the power to the system and goes into hibernate mode.
67 This shutdown grace delay is a programmable value stored in a
68 Smart-UPS EEPROM which can be changed using apctest(8). In
69 hibernate mode, the UPS will again supply power to the system
70 when the utility power returns. Refer to apcupsd.conf(5) for
71 an alternative method using the KILLDELAY configuration
72 directive and the only method available when using a Back-UPS
73 or other UPS operating in simple signalling mode.
74
75 -t --term-on-powerfail
76 apcupsd exits immediately when it issues the system shutdown
77 command. This behaviour is useful for those systems where it
78 is not possible to insert apcupsd commands in a halt script
79 to issue the killpower command. Without this option, apcupsd
80 will wait for the SIGTERM signal from the system shutdown
81 process before exiting.
82
83 -R Put a UPS which runs in smart signalling mode by default (eg
84 a Smart-UPS) into simple signalling mode.
85
86 -v --version
87 Prints the apcupsd version number and the program help.
88
89 -h --help Prints the program help.
90
91 The apcupsd daemon supports a networking mode called Network Information
92 Server (NIS) -- not related to Sun's NIS/YP -- in which the daemon
93 serves status and event information to clients over a network. See the
94 "Running The Network Information Server" section of the apcupsd manual
95 for more information and configuration details on this mode.
96
97 The apcupsd daemon also supports a Smart-UPS in SNMP mode provided an APC
98 Web/SNMP or APC PowerNet SNMP card is installed in the UPS's SmartSlot.
99 For more information and configuration details on this mode, refer to the
100 "Support for SNMP UPSes" section of the apcupsd manual.
101
103 The shutdown is made by calls to the script /etc/apcupsd/apccontrol by
104 the apcupsd daemon. Consequently, no changes to /etc/inittab are neces‐
105 sary on Linux as there is no communication between the daemon and the
106 init(1) process. Installation of the daemon modifies the halt script so
107 that at the end of the shutdown process, the daemon will be re-executed
108 to power off the UPS in hibernate mode.
109
110 On some operating systems (eg FreeBSD) there is no halt script so apccon‐
111 trol must be modified to cause the daemon to power off the UPS after a
112 delay. Alternatives are to use the --kill-on-powerfail command on the
113 apcupsd command line or refer to apcupsd.conf(5) for details of the
114 KILLDELAY configuration directive.
115
117 It will almost certainly be necessary to customise the configuration
118 information in the /etc/apcupsd/apcupsd.conf configuration file to suit
119 your configuration and desired UPS behaviour.
120
121 For information on the configuration directives and the format of the
122 configuration file, refer to apcupsd.conf(5).
123
125 apcupsd generates events when certain conditions occur. These events are
126 sent to the system log and, optionally, to the temporary events file
127 (/var/log/apcupsd.events). They also generate a call to the
128 /etc/apcupsd/apccontrol script which in turn will call any custom scripts
129 placed in the /etc/apcupsd directory which may override apccontrol's
130 default behaviour. For details of the events and customising apccontrol's
131 behaviour, refer to apccontrol(8).
132
134 If the DATATIME configuration directive is set to non-zero, apcupsd will
135 log a data record at the interval defined by the DATATIME directive. This
136 data record is in a format similar to the APC PowerChute software data
137 file format.
138
140 The status report output format is simple ASCII. Generally there is a
141 single piece of information on each line of output. The content varies
142 based on the model of UPS being used and, in some cases, the firmware
143 version. This status report is also optionally written the the
144 /etc/apcupsd/apcupsd.status file. Refer to apcaccess(8) for full details
145 of the status report output.
146
148 /etc/apcupsd/apcupsd.conf default configuration file
149
150 /var/run/apcupsd.pid default process ID file
151
152 /var/log/apcupsd.status optional status file
153
154 /var/log/apcupsd.events default events file
155
157 apcupsd.conf(5), apcaccess(8), apccontrol(8), apctest(8).
158
159 The HTML apcupsd manual installed on your system or available online at
160 http://www.apcupsd.org/
161
163 This page
164 Trevor Roydhouse (current)
165 Andre M. Hedrick
166 Christopher J. Reimer
167
168 Software
169 Adam Kropelin (current Project Manager and Code Maintainer)
170 Kern Sibbald (former Project Manager and Code Maintainer)
171 Riccardo Facchetti (former Project Manager and Code Maintainer)
172 Andre M. Hedrick (Project Founder and former Code Maintainer)
173
174 Contributors
175 An enormous number of users who have devoted their time and energy to
176 this project -- thanks.
177
178apcupsd v3.14.6 January 10, 2009 apcupsd v3.14.6