Hi:
I just emerged apcupsd 3.10.9, and am facing the dreaded FATAL ERROR problem. I'm sure there's something I'm missing, but I'm stuck.
Two things to note first: This is an APC SmartUPS 750VXL that has both USB and serial ports; I am using the serial port with cable 94-0024C. Second, the machine has *two* ethernet adapters; eth0 has ip 192.168.0.2 and is set up with a crossover cable to another machine connected to the same UPS, which will be the slave.
Okay, first, here is my apcupsd.conf:
> UPSCABLE smart
> UPSTYPE smartups
> DEVICE /dev/ttyS0
> LOCKFILE /var/lock
> ONBATTERYDELAY 6
> BATTERYLEVEL 5
> MINUTES 3
> TIMEOUT 0
> ANNOY 300
> ANNOYDELAY 60
> NOLOGON disable
> KILLDELAY 0
> NETSERVER on
> NISIP 192.168.0.2
> NISPORT 3551
> EVENTSFILE /var/log/apcupsd.events
> EVENTSFILEMAX 10
> UPSCLASS netmaster
> UPSMODE net
> NETTIME 100
> NETPORT 6666
> SLAVE 192.168.0.1
> STATTIME 0
> STATFILE /var/log/apcupsd.status
> LOGSTATS off
> DATATIME 0
Starting apcupsd seems to work fine:
> root@wopr:/etc/apcupsd# /etc/init.d/apcupsd start
> * Starting APC UPS daemon... [ ok ]
> root@wopr:/etc/apcupsd#
The process is running:
> root@wopr:/etc/apcupsd# ps fax | grep apc
> 2765 ? S 0:00 /usr/sbin/apcupsd
> 2770 ? S 0:00 \_ /usr/sbin/apcupsd
> 2771 ? S 0:00 \_ /usr/sbin/apcupsd
> 2772 ? S 0:00 \_ /usr/sbin/apcupsd
> root@wopr:/etc/apcupsd#
Here's what's in /var/log/messages:
> Jan 26 18:12:22 wopr apcupsd[2820]: Slave connection failed Connection refused! Down slave 0
> Jan 26 18:13:04 wopr apcupsd[2829]: NIS server startup succeeded
> Jan 26 18:13:04 wopr apcupsd[2820]: apcupsd 3.10.9 (31 December 2003) gentoo startup succeeded
I'm not concerned about the slave error because I don't yet have the slave running (the problem happens even in standalone mode).
And, it also appears to be listening:
> root@wopr:/etc/apcupsd# netstat -a
> Active Internet connections (servers and established)
> Proto Recv-Q Send-Q Local Address Foreign Address State
> tcp 0 0 *:ssh *:* LISTEN
> tcp 0 0 192.168.0.2:3551 *:* LISTEN
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> tcp 0 0 wopr.vodacomm.ca:ssh 192.168.1.10:47916 ESTABLISHED
> udp 0 0 wopr.vodacomm.ca:ntp *:*
> udp 0 0 192.168.0.2:ntp *:*
> udp 0 0 localhost:ntp *:*
> udp 0 0 *:ntp *:*
> Active UNIX domain sockets (servers and established)
> Proto RefCnt Flags Type State I-Node Path
> unix 2 [ ACC ] STREAM LISTENING 12150 /dev/log
> unix 3 [ ] STREAM CONNECTED 206869 /dev/log
> unix 3 [ ] STREAM CONNECTED 206868
> unix 3 [ ] STREAM CONNECTED 12230 /dev/log
> unix 3 [ ] STREAM CONNECTED 12228
> unix 3 [ ] STREAM CONNECTED 2399
> unix 3 [ ] STREAM CONNECTED 2398
> unix 2 [ ] STREAM CONNECTED 2216
> root@wopr:/etc/apcupsd#
Just for further reference, here are my routes and the corresponding network connection:
> root@wopr:/etc/apcupsd# ifconfig eth0
> eth0 Link encap:Ethernet HWaddr 00:07:E9:39:24:30
> inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:24 errors:0 dropped:0 overruns:0 frame:0
> TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:1536 (1.5 Kb) TX bytes:1676 (1.6 Kb)
> Interrupt:17 Base address:0xb400 Memory:e3800000-e3820000
>
> root@wopr:/etc/apcupsd# route
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
> 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
> loopback localhost 255.0.0.0 UG 0 0 0 lo
> default 192.168.1.1 0.0.0.0 UG 1 0 0 eth1
> root@wopr:/etc/apcupsd#
Everything looks kosher, so *why*, when I try to access the daemon, this happens?
> root@wopr:/etc/apcupsd# apcaccess status
> FATAL ERROR in apcaccess.c at line 278
> tcp_open: cannot connect to server localhost on port 3551.
> ERR=Connection refused
> root@wopr:/etc/apcupsd#
HALP

