Настройка APC UPS

Устанавливаем

$ aptitude install apcupsd

В /etc/apcupsd/apcupsd.conf правим соответствующие строчки:

UPSCABLE usb
UPSTYPE usb

Запускаем демон:

/etc/init.d/apcupsd start

apcaccess для вывода информации по UPS.

Ещё команда для теста UPS, для изменения даты смены батареи и т.п. apctest.

Работает после остановки демона apcupsd.

Проблемы:

Остановил apcupsd и дал команду apctest, а в ответ:

# apctest
 2009-12-14 12:28:11 apctest 3.14.4 (18 May 2008) debian
 Checking configuration ...
 Attached to driver: usb
 sharenet.type = DISABLE
 cable.type = USB_CABLE
You are using a USB cable type, so I'm entering USB test mode
mode.type = USB_UPS
Setting up the port ...
apctest FATAL ERROR in device.c at line 70
Unable to create UPS lock file.
If apcupsd or apctest is already running,
please stop it and run this program again.
apctest error termination completed

Запустил apcuspd и дал команду apcaccess, в ответ:

# apcaccess
Error reading status from apcupsd @ localhost:3551: Connection timed out

Остановил apcupsd и проверил:

# ps aux | grep apc
 root 2509 0.0 0.0 193356 1148 ? Ssl Dec13 0:03 /sbin/apcupsd
 root 6739 0.0 0.0 7236 848 pts/1 S+ 12:55 0:00 grep apc

Убил процесс /sbin/apcupsd:

root@deb5:/var/run# kill 2509

И всё заработало.