Test
apcaccess status
To fully test your setup:
- Change
TIMEOUT
from0
to1
in the/etc/apcupsd/apcupsd.conf
file. - Remove wall power from the UPS.
- Observe that your Linux box powers down, in short order.
- Plug the UPS back into the wall.
- Power on your Linux box.
- Change
TIMEOUT
from1
back to0
in the/etc/apcupsd/apcupsd.conf
file.
When everything is ok, all that is left to do is enable the apcupsd
service.
root@rpi5-killer:/etc/apcupsd# mcedit apcupsd.conf
root@rpi5-killer:/etc/apcupsd# systemctl restart apcupsd.service
root@rpi5-killer:/etc/apcupsd# systemctl status apcupsd.service
● apcupsd.service - UPS power management daemon
Loaded: loaded (/lib/systemd/system/apcupsd.service; enabled; preset: enabled)
Active: active (running) since Sun 2025-03-02 11:02:05 CET; 6s ago
Docs: man:apcupsd(8)
Process: 1398 ExecStartPre=/lib/apcupsd/prestart (code=exited, status=0/SUCCESS)
Process: 1403 ExecStart=/sbin/apcupsd (code=exited, status=0/SUCCESS)
Main PID: 1404 (apcupsd)
Tasks: 3 (limit: 9003)
Memory: 592.0K
CPU: 72ms
CGroup: /system.slice/apcupsd.service
└─1404 /sbin/apcupsd
Mar 02 11:02:05 rpi5-killer systemd[1]: Starting apcupsd.service - UPS power management daemon...
Mar 02 11:02:05 rpi5-killer systemd[1]: apcupsd.service: Can't open PID file /run/apcupsd.pid (yet?) after start: No such file or directory
Mar 02 11:02:05 rpi5-killer apcupsd[1404]: apcupsd 3.14.14 (31 May 2016) debian startup succeeded
Mar 02 11:02:05 rpi5-killer apcupsd[1404]: NIS server startup succeeded
Mar 02 11:02:05 rpi5-killer systemd[1]: Started apcupsd.service - UPS power management daemon.
root@rpi5-killer:/etc/apcupsd# apcaccess status
APC : 001,036,0878
DATE : 2025-03-02 11:02:07 +0100
HOSTNAME : rpi5-killer
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : APC BE500G2-GR
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2025-03-02 11:02:05 +0100
MODEL : Back-UPS BE500G2
STATUS : ONLINE
LINEV : 237.0 Volts
LOADPCT : 6.0 Percent
BCHARGE : 95.0 Percent
TIMELEFT : 70.5 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 1 Seconds
SENSE : Medium
LOTRANS : 180.0 Volts
HITRANS : 266.0 Volts
ALARMDEL : 30 Seconds
BATTV : 13.8 Volts
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : OK
STATFLAG : 0x05000008
SERIALNO : 9B2437A02779
BATTDATE : 2001-01-01
NOMINV : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 300 Watts
FIRMWARE : 497200G -497300G
END APC : 2025-03-02 11:02:23 +0100
és most jön a teszt. :)
root@rpi5-killer:/var/log# tail -n13 apcupsd.events
2025-03-02 10:28:38 +0100 apcupsd 3.14.14 (31 May 2016) debian startup succeeded
2025-03-02 11:02:05 +0100 apcupsd exiting, signal 15
2025-03-02 11:02:05 +0100 apcupsd shutdown succeeded
2025-03-02 11:02:05 +0100 apcupsd 3.14.14 (31 May 2016) debian startup succeeded
2025-03-02 11:06:27 +0100 Power failure.
2025-03-02 11:06:29 +0100 Reached run time limit on batteries.
2025-03-02 11:06:29 +0100 Initiating system shutdown!
2025-03-02 11:06:29 +0100 apcupsd exiting, signal 15
2025-03-02 11:06:29 +0100 apcupsd shutdown succeeded
2025-03-02 11:09:13 +0100 apcupsd 3.14.14 (31 May 2016) debian startup succeeded
2025-03-02 11:12:42 +0100 apcupsd exiting, signal 15
2025-03-02 11:12:42 +0100 apcupsd shutdown succeeded
2025-03-02 11:12:42 +0100 apcupsd 3.14.14 (31 May 2016) debian startup succeeded
root@rpi5-killer:/var/log# apcaccess status
APC : 001,036,0878
DATE : 2025-03-02 11:16:24 +0100
HOSTNAME : rpi5-killer
VERSION : 3.14.14 (31 May 2016) debian
UPSNAME : APC BE500G2-GR
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2025-03-02 11:12:42 +0100
MODEL : Back-UPS BE500G2
STATUS : ONLINE
LINEV : 237.0 Volts
LOADPCT : 8.0 Percent
BCHARGE : 95.0 Percent
TIMELEFT : 70.5 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 180.0 Volts
HITRANS : 266.0 Volts
ALARMDEL : 30 Seconds
BATTV : 13.7 Volts
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : OK
STATFLAG : 0x05000008
SERIALNO : 9B2437A02779
BATTDATE : 2001-01-01
NOMINV : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 300 Watts
FIRMWARE : 497200G -497300G
END APC : 2025-03-02 11:16:25 +0100
Tökéletesen leállt az rpi-killer és a szekrényben levő összes eszköz.