APCUPSD(8)
π NAME π
apcupsd β a daemon for controlling most APC UPSes
Ok so real quick, bestie: this is the APCUPSD(8) page from the System Manager's Manual (section 8, we love a system-manager moment π
), and it's about the daemon that keeps your computer from getting absolutely jumpscared by a blackout. Let's get into it. π¦
β¨ SYNOPSIS β¨
apcupsd [-b] [-d level | --debug level] [-f file | --config-file file]
[-P file | --pid-file file]
[-p | --kill-on-powerfail | -t | --term-on-powerfail] [-R]
apcupsd [-k | --killpower | --hibernate | -o | --power-off]
apcupsd [-h | --help]
apcupsd [-V | --version]
π DESCRIPTION π
The apcupsd daemon controls the operation of most American Power Conversion Corp (APC) UPSes. π
So here's the plot: during a power failure, apcupsd informs users about the loss of utility power and that a shutdown may occur. Not to be dramatic, but it's giving emergency. If utility power is not restored, a system shutdown will follow when:
- the battery is exhausted,
- a specified timeout expires,
- a specified battery charge percentage is reached, or
- a specified battery runtime (based on internal UPS calculations and determined by power consumption rates) expires.
If the utility power is restored before one of these shutdown conditions is met, apcupsd will inform users of this and the shutdown will generally be cancelled. π«Ά Generally. Refer to the Implementation Notes section below for situations in which the shutdown may not be cancelled β yes, there are edge cases, there are always edge cases. π
The meaning of the command line options is as follows:
πΈ OPTIONS πΈ
-bβ Run in the foreground, do not detach and become a daemon. Main character energy, refuses to leave the room. π-dlevel,--debuglevel β Set debugging output level where level is a number greater than zero.-ffile,--config-filefile β Load the specified configuration file. The default configuration file is/etc/apcupsd/apcupsd.conf. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes. (Two UPSes, two configs, no sharing, periodt. β)-k|--killpower|--hibernateβ Power down the UPS in hibernate mode after a 10 second delay. This option is normally only used byapcupsditself to power down the UPS after a system shutdown has almost completed. In hibernate mode, the UPS will again supply power to the system when the utility power returns. π-o|--power-offβ Power down UPS completely. The UPS will not supply power to the system when the utility power returns. This one is the final boss, no comeback arc. π-Pfile,--pid-filefile β Create the specified process ID file. The default is/var/run/apcupsd.pid. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.-p,--kill-on-powerfailβapcupsdcommands the UPS to power down in hibernate mode just beforeapcupsdstarts the system shutdown. This relies on the grace shutdown delay of a Smart-UPS being long enough to allow the system to shutdown completely before the UPS shuts off the power to the system and goes into hibernate mode. This shutdown grace delay is a programmable value stored in a Smart-UPS EEPROM which can be changed usingapctest(8). In hibernate mode, the UPS will again supply power to the system when the utility power returns. Refer toapcupsd.conf(5)for an alternative method using theKILLDELAYconfiguration directive and the only method available when using a Back-UPS or other UPS operating in simple signalling mode. π-t,--term-on-powerfailβapcupsdexits immediately when it issues the system shutdown command. This behaviour is useful for those systems where it is not possible to insertapcupsdcommands in a halt script to issue the killpower command. Without this option,apcupsdwill wait for theSIGTERMsignal from the system shutdown process before exiting. π¦-Rβ Put a UPS which runs in smart signalling mode by default (eg a Smart-UPS) into simple signalling mode.-v,--versionβ Prints theapcupsdversion number and the program help.-h,--helpβ Prints the program help.
The apcupsd daemon supports a networking mode called Network Information Server (NIS) β not related to Sun's NIS/YP, iykyk, different NIS entirely π β in which the daemon serves status and event information to clients over a network. See the "Running The Network Information Server" section of the apcupsd manual for more information and configuration details on this mode. β¨
The apcupsd daemon also supports a Smart-UPS in SNMP mode provided an APC Web/SNMP or APC PowerNet SNMP card is installed in the UPS's SmartSlot. For more information and configuration details on this mode, refer to the "Support for SNMP UPSes" section of the apcupsd manual. π
π οΈ IMPLEMENTATION NOTES π οΈ
The shutdown is made by calls to the script /etc/apcupsd/apccontrol by the apcupsd daemon. Consequently, no changes to /etc/inittab are necessary on Linux as there is no communication between the daemon and the init(1) process. π
Installation of the daemon modifies the halt script so that at the end of the shutdown process, the daemon will be re-executed to power off the UPS in hibernate mode.
On some operating systems (eg FreeBSD) there is no halt script so apccontrol must be modified to cause the daemon to power off the UPS after a delay. Alternatives are to use the --kill-on-powerfail command on the apcupsd command line or refer to apcupsd.conf(5) for details of the KILLDELAY configuration directive. π¦
π CONFIGURATION π
It will almost certainly be necessary to customise the configuration information in the /etc/apcupsd/apcupsd.conf configuration file to suit your configuration and desired UPS behaviour. Like, default config is a starting point, not a personality. π
For information on the configuration directives and the format of the configuration file, refer to apcupsd.conf(5). π
π₯ EVENTS π₯
apcupsd generates events when certain conditions occur. These events are sent to the system log and, optionally, to the temporary events file (/var/log/apcupsd.events). π
They also generate a call to the /etc/apcupsd/apccontrol script which in turn will call any custom scripts placed in the /etc/apcupsd directory which may override apccontrol's default behaviour.
For details of the events and customising apccontrol's behaviour, refer to apccontrol(8). πΈ
πΎ DATA FILE FORMAT πΎ
If the DATATIME configuration directive is set to non-zero, apcupsd will log a data record at the interval defined by the DATATIME directive. This data record is in a format similar to the APC PowerChute software data file format. π
π STATUS REPORT FORMAT π
The status report output format is simple ASCII. Generally there is a single piece of information on each line of output. The content varies based on the model of UPS being used and, in some cases, the firmware version.
This status report is also optionally written the the /etc/apcupsd/apcupsd.status file. (Yes bestie, "the the" β I'm quoting the lore exactly, don't @ me π)
Refer to apcaccess(8) for full details of the status report output. π«Ά
ποΈ FILES ποΈ
/etc/apcupsd/apcupsd.confβ default configuration file/var/run/apcupsd.pidβ default process ID file/var/log/apcupsd.statusβ optional status file/var/log/apcupsd.eventsβ default events file
π«Ά SEE ALSO π«Ά
apcupsd.conf(5), apcaccess(8), apccontrol(8), apctest(8).
The HTML apcupsd manual installed on your system or available online at http://www.apcupsd.org/ π
π AUTHORS π
π This page
- Trevor Roydhouse (current)
- Andre M. Hedrick
- Christopher J. Reimer
π§ Software
- Adam Kropelin (current Project Manager and Code Maintainer)
- Kern Sibbald (former Project Manager and Code Maintainer)
- Riccardo Facchetti (former Project Manager and Code Maintainer)
- Andre M. Hedrick (Project Founder and former Code Maintainer)
π Contributors
An enormous number of users who have devoted their time and energy to this project β thanks. ππ
And that's the whole page, bestie. This was apcupsd v3.14.6, dated January 10, 2009 β yeah, it's vintage, it's an icon, it's still running somewhere right now keeping somebody's rack alive. Slay. πβ¨π
π¦ where this page comes from
- alpine 3.22: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- alpine 3.23: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- alpine 3.24: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- arch rolling: apcupsd 3.14.14-9 Β· GPL
- debian bookworm: apcupsd 3.14.14-3.1+b1 Β· GPL-2.0-or-later
- debian trixie: apcupsd 3.14.14-5 Β· GPL-2.0-or-later
- epel 10: apcupsd 3.14.14-36.el10_1 Β· GPL-2.0-only
- epel 9: apcupsd 3.14.14-35.el9 Β· GPL-2.0-only
- fedora 43: apcupsd 3.14.14-39.fc43 Β· GPL-2.0-only
- fedora 44: apcupsd 3.14.14-41.fc44 Β· GPL-2.0-only
- nixos 26.05: apcupsd 3.14.14
- nixpkgs unstable: apcupsd 3.14.14
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- ubuntu jammy: apcupsd 3.14.14-3.1build1 Β· GPL-2.0-or-later
- ubuntu noble: apcupsd 3.14.14-3.1build2 Β· GPL-2.0-or-later
- ubuntu questing: apcupsd 3.14.14-5
- ubuntu resolute: apcupsd 3.14.14-7 Β· GPL-2.0-or-later
- ubuntu stonking: apcupsd 3.14.14-7build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms