Raphaël
2011-Jun-23 09:44 UTC
[Nut-upsuser] Restarting NUT twice in the same time creates 2 instances of usbhid-ups driver
Hello I'm new on this list, nice to meet you My configuration : OS : Ubuntu server 10.04.1 LTS NUT : nut 2.4.3-1ubuntu3.1 from Ubuntu package UPS : APC Back-UPS ES 530 My problem : When restarting twice nut in the same time. I can see 2 instance of /lib/nut/usbhid-ups driver when using : ps aux | grep usbhid-ups I know that's not normal to restart nut twice at the same moment but it can occurs on my system. When reading /etc/init.d/nut, i see that when restarting nut, script stop nut and start it again. When starting again the driver is one more time started without any verification that its already launched. I think there is a problem in code there. have you a solution to bypass this problem without rewriting /etc/init.d/nut Thanks -- Rapha?l -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? enlev?e... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110623/cfc4eb3e/attachment.html>
Raphaël
2011-Jun-23 09:47 UTC
[Nut-upsuser] Restarting NUT twice in the same time creates 2 instances of usbhid-ups driver
Le 23/06/2011 11:44, Rapha?l a ?crit :> Hello I'm new on this list, nice to meet you > > My configuration : > > OS : Ubuntu server 10.04.1 LTS > NUT : nut 2.4.3-1ubuntu3.1 from Ubuntu package > UPS : APC Back-UPS ES 530 > > My problem : > When restarting twice nut in the same time. I can see 2 instance of > /lib/nut/usbhid-ups driver when using : ps aux | grep usbhid-ups > > I know that's not normal to restart nut twice at the same moment but > it can occurs on my system. > > When reading /etc/init.d/nut, i see that when restarting nut, script > stop nut and start it again. > When starting again the driver is one more time started without any > verification that its already launched. > > I think there is a problem in code there. have you a solution to > bypass this problem without rewriting /etc/init.d/nut > > Thanks > -- > Rapha?lExcuse me, maybe im on the wrong list. I will try to post on dev list. -- Rapha?l -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? enlev?e... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110623/7481e3c1/attachment-0001.html>
Arjen de Korte
2011-Jun-23 09:53 UTC
[Nut-upsuser] Restarting NUT twice in the same time creates 2 instances of usbhid-ups driver
Citeren Rapha?l <raphael.broutin at ve-hotech.com>:> When reading /etc/init.d/nut, i see that when restarting nut, script > stop nut and start it again. > When starting again the driver is one more time started without any > verification that its already launched.Stopping a driver is an asynchronous process. So you either have to check if the PID file is removed before assuming the driver has actually stopped or you need to wait a couple of seconds before (re)starting the drivers.> I think there is a problem in code there.This is an inherent effect of the method that is used to signal drivers to stop. On systems with multiple driver instances, you don't want to hang around waiting for a driver to actually stop before going to the next one.> have you a solution to bypass this problem without rewriting /etc/init.d/nutThe easiest fix is to add a delay between stop nut sleep 2 start nut Best regards, Arjen -- Please keep list traffic on the list (off-list replies will be rejected)