[Nut-upsuser] Spurious messages on start

Peter Selinger selinger at mathstat.dal.ca
Mon Nov 13 22:07:36 CET 2006


I don't know what their "start-stop-daemon" command does, but assuming
that it starts upsd as a background process, this could be the source
of the problem. upsd is intended to be started in the foreground; it
will put itself in the background once it has connected to the drivers
and is ready for communication. In other words, it is intended to be
started as:

 upsd

and not

 upsd &

If upsd is started in the latter way, then upsmon could be started too
soon. -- Peter

=?ISO-8859-1?Q?Pedro_C=F4rte-Real?= wrote:
> 
> On 11/13/06, Peter Selinger <selinger at mathstat.dal.ca> wrote:
> > To answer that question, we would have to see the script.  This is not
> > the Ubuntu/Debian mailing list, so what's standard to them may not be
> > standard to us.
> 
> I think the person that packages nut for debian is on the list and I
> assumed this was maintained along with mainstream nut. Here's the
> relevant parts anyway. When starting three commands are ran:
> 
> ! /sbin/upsdrvctl start >/dev/null 2>&1  && echo -n " (upsdrvctl failed)"
> start-stop-daemon -S -q -p $upsd_pid -x $upsd >/dev/null 2>&1
> start-stop-daemon -S -q -p $upsmon_pid -x $upsmon >/dev/null 2>&1
> 
> upsdrvctl seems to be working as I've tried redirecting its output to
> a temp file instead of /dev/null and it said:
> 
> """
> Network UPS Tools: New USB/HID UPS driver 0.28 (2.0.4)
> 
> Detected a UPS: MGE UPS SYSTEMS/ellipse
> Using subdriver: MGE HID 0.9
> Network UPS Tools - UPS driver controller 2.0.4
> """
> 
> Adding a 20 second sleep between starting upsd and starting upsmon
> seems to solve the problem so I guess this happens because upsmon is
> started right away when upsd hasn't started communicating with the UPS
> but is already accepting connections.
> 
> I added a 30 second sleep to my init file just to be on the safe side.
> Seems to work fine now but it seems like a bug in the way upsd and
> upsmon interact on startup.
> 
> Pedro.
> 




More information about the Nut-upsuser mailing list