nut takes too long to start

Bug #1568 reported by David Johnson
6
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Fix Released
Low
MOTU

Bug Description

When nut is started using the init script, it takes 45 seconds to start. If I start the various components of nut manually (the ups driver, upsd, upsmon), each starts instantly.

I know that some ups drivers take time to sync with smart UPSes, but I'm using the genericups driver which just monitors the serial port and doesn't talk to the UPS at all.

I'm running Kubuntu Hoary on AMD64.

Related branches

Changed in nut:
assignee: nobody → motu
Revision history for this message
Arnaud Quette (aquette) wrote :

I don't see any reason to this!

IIRC, hoary was on 2.0.1. Have you tried Breezy and 2.0.2? If so, any improvement?

otherwise, backup the init.d script and replace the following line:
start-stop-daemon -S -q -p $upsd_pid -x $upsd >/dev/null 2>&1
by
time start-stop-daemon -S -v -p $upsd_pid -x $upsd

And send back the output

Revision history for this message
David Johnson (dj-david-web) wrote :

Sorry for taking a while to check this - the problem isn't present in Breezy. Thanks for your time though!

Changed in nut:
status: Unconfirmed → Rejected
Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

The problem exists in Hardy and Intrepid.

here are the logs

Nov 18 16:38:17 messaging upsd[5396]: listening on 0.0.0.0 port 3493
Nov 18 16:38:17 messaging upsd[5396]: Can't connect to UPS [blazer] (megatec_usb-blazer): No such file or directory
Nov 18 16:38:17 messaging upsd[5397]: Startup successful
Nov 18 16:38:17 messaging upsmon[5399]: Startup successful
Nov 18 16:38:17 messaging upsd[5397]: Connection from 127.0.0.1
Nov 18 16:38:17 messaging upsd[5397]: Client monuser@127.0.0.1 logged into UPS [blazer]
Nov 18 16:38:17 messaging upsmon[5401]: Poll UPS [blazer@localhost] failed - Driver not connected
Nov 18 16:38:17 messaging upsmon[5401]: Communications with UPS blazer@localhost lost
Nov 18 16:38:22 messaging upsmon[5401]: Poll UPS [blazer@localhost] failed - Driver not connected
Nov 18 16:38:22 messaging upsmon[5401]: UPS blazer@localhost is unavailable
Nov 18 16:38:27 messaging upsmon[5401]: Poll UPS [blazer@localhost] failed - Driver not connected
Nov 18 16:38:31 messaging upsd[5397]: Connected to UPS [blazer]: megatec_usb-blazer
Nov 18 16:38:32 messaging upsmon[5401]: Communications with UPS blazer@localhost established
Nov 18 16:38:34 messaging upsd[5397]: Data for UPS [blazer] is stale - check driver
Nov 18 16:38:37 messaging upsmon[5401]: Poll UPS [blazer@localhost] failed - Data stale
Nov 18 16:38:37 messaging upsmon[5401]: Communications with UPS blazer@localhost lost
Nov 18 16:38:42 messaging upsd[5397]: UPS [blazer] data is no longer stale
Nov 18 16:38:42 messaging upsmon[5401]: Communications with UPS blazer@localhost established

Changed in nut:
status: Invalid → New
Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Bug 1568] Re: nut takes too long to start

it's not NUT by itself (meaning upsd) but the megatec_usb driver.
so upsd waits for it to be available.

this behavior has been fixed in NUT trunk, and this fix will be
available in NUT 2.4.
the loss/restoration of connexion has also been improved...

Arnaud
--
Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/

Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

So, any package available for testing?

Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

Had a look to nut web site. Current version is 2.2. So 2.4 seems far away.
Can't the fix be applied to Ubutnu version of nut?

Revision history for this message
Arnaud Quette (aquette) wrote :

2008/11/18 Laurent Dinclaux <email address hidden>:
> Had a look to nut web site. Current version is 2.2. So 2.4 seems far away.
> Can't the fix be applied to Ubutnu version of nut?
>

2.2.2 is the current stable.
2.4.0 is the next, scheduled for the end of december.

I'll prepare a PPA with 2.3.0-svnXXX debs

Arnaud

Revision history for this message
Jeff Anderson (jander99) wrote :

Has there been a PPA set up for this yet? If so, has it fixed the issue?

Thanks.

Revision history for this message
Daniel T Chen (crimsun) wrote :

lowering severity due to extant workaround

Changed in nut:
importance: Medium → Low
status: New → Triaged
Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

What workaround ?

Revision history for this message
Arnaud Quette (aquette) wrote :

2008/12/15 Laurent Dinclaux:
> What workaround ?

not sure about what Daniel refers to!
but as told prev, this is fixed in the upcoming NUT 2.4.0 (I'll
release the first -pre1 for Christmas ; the final being due for ~ 1
month later). this release will be included in Jaunty...
still no time for backporting though :-(

cheers,
Arnaud

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nut - 2.4.1-2ubuntu1

---------------
nut (2.4.1-2ubuntu1) jaunty; urgency=low

  * Acknowledge closed bugs in upstream and Debian: LP: #1568, LP: #221737,
    LP: #239025, LP: #278495, LP: #332030, LP: #332032
  * Merge from debian unstable, remaining changes:
    + debian/control:
      - Update maintainer field as per spec.
      - Add Breaks on nut-hal-drivers to ensure we have correct udev version.
    + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups
      unconditionally, to handle the upgrade from the hardy release (simply
      uncommented).
    + debian/rules: pre merge the changes for Ubuntu (udev path and version),
      (simply uncommented).

 -- Arnaud Quette <email address hidden> Fri, 27 Feb 2009 12:49:24 +0100

Changed in nut:
status: Triaged → Fix Released
Revision history for this message
Laurent Dinclaux (dreadlox) wrote :

It won't fix under intrepid. is that true?

Revision history for this message
Arnaud Quette (aquette) wrote :

2009/3/4 Laurent Dinclaux <email address hidden>

> It won't fix under intrepid. is that true?
> - Afficher le texte des messages précédents -
>

right, that fix is for jaunty.
and I don't think it will be backported to Intrepid (since it is not an LTS
and not an RC bug, and this fix is part of a big set in nut 2.4...)

Arnaud

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.