[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#674081: apcupsd: serial UPS connection fails on kfreebsd-*



Package: apcupsd
Version: 3.14.10-1
Severity: grave
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
X-Debbugs-Cc: debian-bsd@lists.debian.org
Tags: patch
Justification: fails to build from source (but built successfully in the
past)

Hi,

On GNU/kFreeBSD, apcupsd fails to connect to a serial smart UPS, e.g.
/dev/cuau0, with "Communications with UPS lost" logged about a minute
after startup.

Debugging with apctest showed a successful initial connection, but
becoming unresponsive after a few bytes had been exchanged with the UPS.
 Hours later, I stumbled upon the cause of this;  the autoconf script
did not define HAVE_FREEBSD_OS.  This resulted in two lines of code
being skipped, where values for c_ispeed and c_ospeed should have been
set in the termio structure.  This either meant that tcsetattr() would
de-assert modem control, or possibly it was failing silently without
setting some other necessary parameter on the serial line.

Please see my attached patch which has got my serial smart UPS
functioning, and apcupsd working as a NIS master.

I don't know how to properly regenerate ./configure in this package so I
altered it directly in my patch.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
Index: apcupsd-3.14.10/autoconf/configure.in
===================================================================
--- apcupsd-3.14.10.orig/autoconf/configure.in	2012-05-22 23:02:44.000000000 +0100
+++ apcupsd-3.14.10/autoconf/configure.in	2012-05-22 23:02:58.465449378 +0100
@@ -349,6 +349,7 @@
    *-*-hpux*)    AC_DEFINE(HAVE_HPUX_OS)    ;;
    *-*-linux*)   AC_DEFINE(HAVE_LINUX_OS)   ;;
    *-*-freebsd*) AC_DEFINE(HAVE_FREEBSD_OS) ;;
+   *-*-kfreebsd*)AC_DEFINE(HAVE_FREEBSD_OS) ;;
    *-*-netbsd*)  AC_DEFINE(HAVE_NETBSD_OS)  ;;
    *-*-openbsd*) AC_DEFINE(HAVE_OPENBSD_OS) ;;
    *-*-bsdi*)    AC_DEFINE(HAVE_BSDI_OS)    ;;
Index: apcupsd-3.14.10/configure
===================================================================
--- apcupsd-3.14.10.orig/configure	2012-05-22 23:04:47.645447000 +0100
+++ apcupsd-3.14.10/configure	2012-05-22 23:05:25.409449524 +0100
@@ -9509,6 +9509,10 @@
 #define HAVE_FREEBSD_OS 1
 _ACEOF
  ;;
+   *-*-kfreebsd*) cat >>confdefs.h <<\_ACEOF
+#define HAVE_FREEBSD_OS 1
+_ACEOF
+ ;;
    *-*-netbsd*)  cat >>confdefs.h <<\_ACEOF
 #define HAVE_NETBSD_OS 1
 _ACEOF

Reply to: