Re: [Nut-upsuser] Startup timing issue with CyberPower CP425HG UPS

2011-04-02 Thread Arjen de Korte

Citeren Arun twelvefortyf...@yahoo.com:

Yeap. IMO an even better option (if technically feasible) would be  
for the driver to try and reconnect to the UPS every few seconds. It  
seems to do this well if it loses connectivity after having  
established the initial connection, but not at all at startup.


This is intentional. You don't want the system to retry forever if a  
driver fails to start. NUT really shouldn't be started before the USB  
subsystem has started. What might be wrong, is that the startup  
scripts may already return before the service they are starting has  
really started. I experienced a similar problem on an older system,  
where on startup the system load be so high (due to everything  
starting in parallel) that I had to delay starting some services  
manually.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


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


Re: [Nut-upsuser] Startup timing issue with CyberPower CP425HG UPS

2011-04-01 Thread Arun
--- On Thu, 3/31/11, Charles Lepple clep...@gmail.com wrote:

 From: Charles Lepple clep...@gmail.com
 Subject: Re: [Nut-upsuser] Startup timing issue with CyberPower CP425HG UPS
 To: Arun twelvefortyf...@yahoo.com
 Cc: nut-upsuser@lists.alioth.debian.org
 Date: Thursday, March 31, 2011, 7:25 PM
 On Mar 30, 2011, at 9:46 PM, Arun
 wrote:
 
  I'm not sure how to fix this, other than to perhaps
 start the ups service from the udev rules file if a known
 USB UPS device has been found, but that seems like a rather
 ugly way to go about this. Does anyone have any thoughts?
 
 I have had a sneaking suspicion that in some situations,
 starting a USB driver from hotplug or udev might work
 better, and this is definitely one of those cases.

Yeap. IMO an even better option (if technically feasible) would be for the 
driver to try and reconnect to the UPS every few seconds. It seems to do this 
well if it loses connectivity after having established the initial connection, 
but not at all at startup.

 
 Before you get too far into this, you probably want to make
 sure that when power returns, your UPS will wait until the
 battery is charged to some threshold before powering on its
 outlets. Otherwise, if the power goes off-on-off (with a
 shutdown after the first power failure), the UPS might try
 to start the computer up with a discharged battery, and due
 to the delay in connecting to the UPS, NUT would not get the
 low battery signal in time to shut down properly the second
 time.

Good point. Unfortunately this UPS is not very fancy, and immediately powers on 
its outlets when the power resumes.

 
 The other trick is that the current NUT USB drivers will
 attempt to reattach to a device if it disappears. Especially
 during testing, it is helpful to be able to unplug and
 re-plug the UPS into the USB port. For this to work, the
 udev script could kill the driver which is waiting around
 for the UPS to come back. (That would only do the right
 thing on a single-UPS system.) Alternatively, you could
 check in the udev script to see if any of the USB drivers
 are running (look for the PID files, and run kill -0 to
 see if the process is still around without actually
 terminating it).

I did a couple of tests and it looks like driver recovers well once the UPS is 
reconnected to the system. Unfortunately it doesn't seem to try to reconnect at 
all at startup.

 
 On the other hand, you can also look into whether your
 startup scripts have configurable dependencies, and tell the
 NUT init.d script to start after the USB service has fully
 initialized. Not sure how that works in Fedora.

Me neither. I don't know if there is a USB service per se in Fedora; USB 
devices announce themselves individually as they are connected to the system. 
Most USB devices (the kbd, mouse, another UPS I tested) register with the 
system *before* the init.d script starts, it's just this one UPS that registers 
much later for some reason.

 

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


Re: [Nut-upsuser] Startup timing issue with CyberPower CP425HG UPS

2011-03-31 Thread Charles Lepple

On Mar 30, 2011, at 9:46 PM, Arun wrote:

I'm not sure how to fix this, other than to perhaps start the ups  
service from the udev rules file if a known USB UPS device has been  
found, but that seems like a rather ugly way to go about this. Does  
anyone have any thoughts?


I have had a sneaking suspicion that in some situations, starting a  
USB driver from hotplug or udev might work better, and this is  
definitely one of those cases.


Before you get too far into this, you probably want to make sure that  
when power returns, your UPS will wait until the battery is charged to  
some threshold before powering on its outlets. Otherwise, if the power  
goes off-on-off (with a shutdown after the first power failure), the  
UPS might try to start the computer up with a discharged battery, and  
due to the delay in connecting to the UPS, NUT would not get the low  
battery signal in time to shut down properly the second time.


The other trick is that the current NUT USB drivers will attempt to  
reattach to a device if it disappears. Especially during testing, it  
is helpful to be able to unplug and re-plug the UPS into the USB port.  
For this to work, the udev script could kill the driver which is  
waiting around for the UPS to come back. (That would only do the right  
thing on a single-UPS system.) Alternatively, you could check in the  
udev script to see if any of the USB drivers are running (look for the  
PID files, and run kill -0 to see if the process is still around  
without actually terminating it).


On the other hand, you can also look into whether your startup scripts  
have configurable dependencies, and tell the NUT init.d script to  
start after the USB service has fully initialized. Not sure how that  
works in Fedora.


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


[Nut-upsuser] Startup timing issue with CyberPower CP425HG UPS

2011-03-30 Thread Arun
Hi all -

I'm running into a small problem with the CyberPower CP425HG UPS and NUT 2.4 on 
Fedora 11.

For whatever reason, at system startup this UPS registers as a USB device very 
late in the boot process, *after* all the services have started. So at boot up 
when the ups service in init.d tries to start upsdrvctl, it fails because 
no USB UPS device cannot be found. Hence the auto-shutdown on low battery does 
not work.

This all works great if I start the ups service manually (service ups start) 
after the system has booted up.

I'm not sure how to fix this, other than to perhaps start the ups service 
from the udev rules file if a known USB UPS device has been found, but that 
seems like a rather ugly way to go about this. Does anyone have any thoughts?

System information:
Fedora 11, Kernel 2.6.30, NUT 2.4.3

UPS product page:
http://www.cyberpowersystems.com/products/ups-systems/soho-ups/CP425HG.html

Thanks,
Arun


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