Настройка ups Powercom Imperial IMD-625AP + NUT
Дистр Gentoo 2008.0.
Ядро 2.6.25-gentoo-r7.
Nut 2.0.5-r2.
Настраивал так:
1. USE="usb hal" emerge sys-power/nut
2. В ядре включил:
Device Drivers ---HID Devices ------[*] USB Human Interface Device (full HID) support ------[*] /dev/hiddev raw HID device support Device Drivers ---USB support ------[*] USB Serial Converter support ---> ---------[*] USB Cypress M8 USB Serial Driver
3. Скопировал бинарник драйвера powercom в /lib/nut, заменив оригинальный.
4. Поправил конфиги вот так:
/etc/nut/ups.conf
[powercom] driver = powercom port = /dev/ttyUSB0 type = IMPERIAL desk = "IMD-525AP"
/etc/nut/upsd.conf
ACL all 0.0.0.0/0 ACL localhost 127.0.0.1 ACCEPT localhost REJECT all
/etc/nut/upsd.users
[root] password = рутовый_пароль allowfrom = localhost actions = SET instcmds = ALL upsmon master
/etc/nut/upsmon.conf
MONITOR powercom@localhost 1 root рутовый_пароль master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h now" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 NOTIFYMSG ONBATT SYSLOG+WALL+EXEC RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5
5. usermod -G usb nut && rc-update add upsd default && rc-update add upsmon default
После ребута наблюдаю следущее:
* Starting UPS driver ...
Network UPS Tools - UPS driver controller 2.0.5
Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.6 $ (2.0.5)
Unable to open /dev/ttyUSB0: Premission denied
Current user id: nut (84)
Serial port owner: root (0)
Serial port group: uucp (14)
Mode of port: 0660
Things to try:
- Use another port (with the right premissions)
- Fix the port owner/group or premissions on this port
- Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf).
See upsdrvctl(8) and ups.conf(5).
Fatal error: unusable configuration
Driver failed to start (exit status=1)
* Failed to start UPS drivers!
* ERROR: cannot start upsd as upsdrv could not start
Понятно, что ему не хватает прав для доступа к устройству, но как такое может быть если юзер - рут? Как исправить?
Если сделать chmod 777 /dev/ttyUSB0 и вручную запустить /etc/init.d/upsd start && /etc/init.d/upsmon start то все запускается гладко, но почему то при upsc
отвечает ошибкой: Error: Server disconnected. Если
Как заставить работать дравер?
ps запуск /lib/nut/powercom -a ups -u root -DD -x type=IMPERIAL -x port=/dev/ttyUSB0 проходит на ура и показывает правильную информацию о упсе.
- Для комментирования войдите или зарегистрируйтесь

Попробуй
Попробуй включить в /etc/nut/ups.conf строку user=root
Может кому понадобится.
Может кому понадобится. Боролся с той же проблемой. В итоге - причина оказалась в /etc/udev/rules.d/70-nut-usbups.rules
Там есть строчка:
SUBSYSTEM!="usb_device", GOTO="nut-usbups_rules_end"
Но для cypress_m8 (как для других девайсов - ХЗ) - SUBSYSTEM отнюдь не usb_device, а tty. Проверить конкретный девайс можно коммандой udevinfo -a -p $(udevinfo -q path -n /dev/ttyUSB0)
Итого после правки строки на
SUBSYSTEM!="tty", GOTO="nut-usbups_rules_end"
имеем:
crw-rw-r-- 1 root nut 188, 0 2009-05-03 22:00 /dev/ttyUSB0