Re: [Nut-upsuser] Nut-upsuser Digest, Vol 72, Issue 21

2011-06-24 Thread Raphaël

Le 23/06/2011 14:00, nut-upsuser-requ...@lists.alioth.debian.org a écrit :

Send Nut-upsuser mailing list submissions to
nut-upsuser@lists.alioth.debian.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
or, via email, send a message with subject or body 'help' to
nut-upsuser-requ...@lists.alioth.debian.org

You can reach the person managing the list at
nut-upsuser-ow...@lists.alioth.debian.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Nut-upsuser digest..."


Today's Topics:

1. Re: Restarting NUT twice in the same time creates 2 instances
   of usbhid-ups driver (Arjen de Korte)


--

Message: 1
Date: Thu, 23 Jun 2011 11:53:46 +0200
From: Arjen de Korte
To: nut-upsuser@lists.alioth.debian.org
Subject: Re: [Nut-upsuser] Restarting NUT twice in the same time
creates 2 instances of usbhid-ups driver
Message-ID:
<20110623115346.horde.iprfxuisjlfoaw0q00qn...@mail.de-korte.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; DelSp=Yes

Citeren Rapha?l:


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/nut

The easiest fix is to add a delay between

 stop nut
 sleep 2
 start nut

Best regards, Arjen
Testing PID before launching a new instance of driver is a good solution 
but need to be implemented in /etc/init.d/nut


The sleep solution is incorrect because if i do in parallel twice 
(stop,sleep,start). The two starts will be done at the same time ( i 
mean stop will be already done) and there will be 2 instance of driver.

Or i dont understand.

Testing PID before and launching new instance of driver if pid does not 
exist) sould be the right solution but only if  2 UPS needs 1 driver 
else this solution fails


Regards.


--
Raphaël


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Restarting NUT twice in the same time creates 2 instances of usbhid-ups driver

2011-06-23 Thread Raphaël

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ël


Excuse me, maybe im on the wrong list. I will try to post on dev list.


--
Raphaël

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

[Nut-upsuser] Restarting NUT twice in the same time creates 2 instances of usbhid-ups driver

2011-06-23 Thread Raphaël

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

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser