ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Ivan Adzhubey <iadzhubey@rics.bwh.harvard.edu>
To: ab@altlinux.org,
	ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] Обновление libusb и nut
Date: Sat, 20 Sep 2008 23:40:05 -0400
Message-ID: <200809202340.05860.iadzhubey@rics.bwh.harvard.edu> (raw)
In-Reply-To: <6062a6e60809202020i22b54bbfg40ee0879c3027c29@mail.gmail.com>

Добрый день, Александр!

On Saturday 20 September 2008 11:20:42 pm Alexander Bokovoy wrote:
> 2008/9/21 Ivan Adzhubey <iadzhubey@rics.bwh.harvard.edu>:
> > Приветствую!
> >
> > После сегодняшнего обновления libusb перестал работать драйвер newhidups
> > из пакета nu. Соответственно, и все остальные демоны управления UPS тоже.
> > Наверное, надо пересобрать nut с новой libusb?
>
> Рекомендую проверить права на соответствующие устройства.

Какие устройства? И как их проверять, если их все равно нет и не может быть в 
чруте? Или вы имеете в виду, что в режиме чрута оно вообще работать не может? 
А как раньше работало?

> По умолчанию 
> upsdrv запускает драйвер в чруте, где нет на самом деле нужных
> устройств, но в чрут он переходит после их определения.
> А дальше 
> начинается регулярное ресканирование шины:
<...skipped>
> Естественно, все это "отваливается", потому что в чруте ничего нет.

Еще раз, и как же это все раньше работало?

> Если не запускать его в чруте и дать права пользователю upsdrv на
> работу с нужным USB устройством,

Я настраивал средствами alterator-nut, не очень понимаю, зачем вообще тащить 
nut а чрут -- это что, настолько опасное устройство? Попробую чрут убрать...

> то /var/log/messages должно быть 
> что-то вроде вот этого:
> Sep 21 07:05:13 boii upsdrvctl: Network UPS Tools: 0.28 USB
> communication driver 0.28 - core 0.30 (2.0.5)
> Sep 21 07:05:13 boii upsdrvctl: Detected a UPS: American Power
> Conversion/Back-UPS ES 525 FW:851.t3.I USB FW:t3
> Sep 21 07:05:13 boii upsdrvctl: Using subdriver: APC/CyberPower HID 0.9
> Sep 21 07:05:15 boii upsdrvctl: libusb couldn't open USB device
> /dev/bus/usb/001/001: Permission denied.
> Sep 21 07:05:15 boii upsdrvctl: libusb requires write access to USB
> device nodes.
> Sep 21 07:05:15 boii upsdrvctl: libusb couldn't open USB device
> Sep 21 07:05:23 boii newhidups[27946]: Startup successful
> Sep 21 07:05:23 boii upsdrvctl: Network UPS Tools - UPS driver controller
> 2.0.5 Sep 21 07:05:23 boii upsdrv: Starting UPS drivers: succeeded
> Sep 21 07:05:35 boii upsd[27980]: Connected to UPS [ups]: ups
> Sep 21 07:05:35 boii upsd: Connected to UPS [ups]: ups
> Sep 21 07:05:35 boii upsd[27981]: Startup successful
> Sep 21 07:05:35 boii upsd: upsd startup succeeded
> Sep 21 07:05:44 boii upsmon[28000]: Startup successful
> Sep 21 07:05:44 boii upsmon: UPS: ups@localhost (master) (power value 1)
> Sep 21 07:05:44 boii upsmon: Using power down flag file /etc/killpower
> Sep 21 07:05:44 boii upsmon: upsmon startup succeeded
> Sep 21 07:05:44 boii upsd[27981]: Connection from 127.0.0.1
> Sep 21 07:05:44 boii upsd[27981]: Client monuser@127.0.0.1 logged into UPS
> [ups] Sep 21 07:05:52 boii upsd[27981]: Connection from 127.0.0.1
> Sep 21 07:05:52 boii upsd[27981]: Client on 127.0.0.1 logged out
>
> Сообщения от libusb -- нормальная реакция на невозможность открыть
> несвязанные с нашей работой устройства на запись.

Странно, но до апдейта никаких сообщений о permission denied от libusb я не 
наблюдал. А как выставлять права на устройство, оно же создается динамически 
udev'ом? Это надо в скрипты настройки udevd лезть? Кошмар...

> После чего все работает, но регулярное сканирование шины реализовано в
> newhidups некорректно, из-за этого там утекает память:
> Out of memory: kill process 27946 (newhidups) score 652587 or a child
> Killed process 27946 (newhidups)
>
> Я сейчас разбираюсь с кодом drivers/libusb.c в NUT.

Утечек памяти у меня тоже не наблюдалось, по крайней мере таких, чтобы оно 
отваливалось по недостатку памяти. Платформа x86_64 если это имеет значение.

--Иван


  reply	other threads:[~2008-09-21  3:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-20 22:01 Ivan Adzhubey
2008-09-21  3:20 ` Alexander Bokovoy
2008-09-21  3:40   ` Ivan Adzhubey [this message]
2008-09-21  4:33     ` Alexander Bokovoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200809202340.05860.iadzhubey@rics.bwh.harvard.edu \
    --to=iadzhubey@rics.bwh.harvard.edu \
    --cc=ab@altlinux.org \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git