Package: apcupsd
Version: 3.14.8-2
Severity: normal

When starting apcupsd via init script the init script fails to report errors.
E.g. if you don't have a UPS connected to the computer apcupsd won't start, but
the init script will report a success condition nonetheless.

The behaviour is similar when starting apcupsd directly; it will immediately
fork and the original process will exit without an error message. The forked
process will try to connect to the UPS in the background; when this fails, it
will die silently after a few seconds. Only if I increase the debug level an
error message appears after a while, but due to the fork apcupsd still returns
with exit code 0 signalling success:

iserv ~ # apcupsd -d 100; echo $?
0.000 apcupsd: apcupsd.c:219 Options parsed.
0.004 apcupsd: apcupsd.c:242 Config file /etc/apcupsd/apcupsd.conf processed.
0.004 apcupsd: newups.c:102 write_lock at drivers.c:208
0.004 apcupsd: drivers.c:210 Looking for driver: usb
0.004 apcupsd: drivers.c:214 Driver dumb is configured.
0.004 apcupsd: drivers.c:214 Driver apcsmart is configured.
0.004 apcupsd: drivers.c:214 Driver net is configured.
0.004 apcupsd: drivers.c:214 Driver usb is configured.
0.004 apcupsd: drivers.c:217 Driver usb found and attached.
0.004 apcupsd: newups.c:108 write_unlock at drivers.c:234
0.004 apcupsd: drivers.c:236 Driver ptr=0x806c890
0.004 apcupsd: apcupsd.c:261 Attached to driver: usb
0.004 apcupsd: newups.c:102 write_lock at linux-usb.c:582
0
iserv ~ #
10.039 apcupsd: newups.c:108 write_unlock at linux-usb.c:601
apcupsd FATAL ERROR in linux-usb.c at line 609
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
10.039 apcupsd: apclog.c:62 apcupsd FATAL ERROR in linux-usb.c at line 609
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.

10.039 apcupsd: newups.c:102 write_lock at linux-usb.c:631
10.039 apcupsd: newups.c:108 write_unlock at linux-usb.c:638
10.039 apcupsd: apclog.c:62 apcupsd error shutdown completed

I realize that apcupsd probably forks so the user doesn't have to wait, but in
this case I would prefer it to block until it has determined it can actually
connect, and only then return with exit code 0, and with a non-zero exit code
otherwise. This would be especially useful for scripting purposes.

-- System Information:
Debian Release: 5.0.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.26-1-xen-amd64 (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apcupsd depends on:
ii  libc6                       2.7-18lenny4 GNU C Library: Shared libraries
ii  libgcc1                     1:4.3.2-1.1  GCC support library
ii  libwrap0                    7.6.q-16     Wietse Venema's TCP wrappers libra

Versions of packages apcupsd recommends:
pn  apcupsd-doc                   <none>     (no description available)

Versions of packages apcupsd suggests:
pn  apcupsd-cgi               <none>         (no description available)
pn  hal                       <none>         (no description available)
ii  udev                      0.125-7+lenny3 /dev/ and hotplug management daemo

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to