Subject: Re: apcupsd
To: Thilo Remmele <remmele@ww.uni-erlangen.de>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 07/21/2000 08:59:40
[ On Friday, July 21, 2000 at 08:30:01 (+0200), Thilo Remmele wrote: ]
> Subject: apcupsd
>
> I can start the apcupsd (pkgsrc) right after using minicom -s
> (to verify that the connection to the ups is fine) and the apcupsd
> works.
> But if apcupsd is started at boot time (rc.local) apcupsd hangs.
> I think the reason is a wrong baud rate for the /dev/tty00,
> because this is the thing I changed in minicom, but I don't
> know how to set this up at boot time, so apcupsd will work.

I suspect that the problem is that apcupsd fails to use O_NONBLOCK when
opening the device, and since the APC cable doesn't assert DCD the
program must hang waiting forever while trying to open the serial port.

I submitted a PR (#10552) about two weeks ago that both fixes this
problem and upgrades to apcupsd-3.6.2.  The PR includes a "shar" file
with the complete new package module so you can just unpack it in a new
directory under pkgsrc and do a "make install".  Unfortunately it seems
I was out-gunned by the apcupsd team and the current release is 3.7.2.
I've been side-tracked in upgrading my pkgsrc to match but will
hopefully get around to that soon (today?).

As a quick work-around though you can put a "local" flag on the line for
the serial port in /etc/ttys (and run "ttyflags -a" to have it take
effect before the next reboot).

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>