[Nut-upsuser] newhidups fails only at boot

Jim Osborn jimo at eskimo.com
Mon Apr 16 06:02:11 UTC 2007


I can start the driver successfully manually, after the machine is up
and running, but at boot time, it can't find my UPS. My init script
makes sure that the usbfs is up (by checking for the existence of
/proc/bus/usb/devices), and I can't think of what else could be
different with the boot-time failure versus the manual startup after
logging in.  I'll include my configuration at the end of this note.
Here's the log of the boot failure:

Sun Apr 15 21:49:48 PDT 2007 /etc/init.d/rc3.d/S09ups: Starting ups driver (-DDDDD)
Sun Apr 15 21:49:48 PDT 2007 /etc/init.d/rc3.d/S09ups: USB filesystem is mounted
Starting UPS: ups
exec: //bin/newhidups -a ups
Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.0.5)

No matching HID UPS found
Driver failed to start (exit status=1)
Network UPS Tools - UPS driver controller 2.0.5

Here are my config files:

/etc/ups/ups.conf:
[ups]
	driver = newhidups
	port = auto
	desc = "My Little APC Back-UPS ES 750"

/etc/hotplug/usb/libhidups:
if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
  chown root:nut "$DEVICE"
  chmod 0664 "$DEVICE"
fi

Here's my init script, which runs in runlevel 3:

case "$1" in
  start)
	echo "`date` ${0}: Starting ups driver (-DDDDD)" >>$log
	if [ -f /proc/bus/usb/devices ]; then
		echo "`date` ${0}: USB filesystem is mounted" >>$log
	else
		echo "`date` ${0}: Mounting the USB filesystem" >>$log
		modprobe usbcore
		mount -t usbfs usbfs /proc/bus/usb
		[ -f /proc/bus/usb/devices ] ||
			echo "`date` ${0}: cannot mount the USB filesystem" >>$log
	fi

	/bin/upsdrvctl -DDDDD start ups >>$log 2>&1
	...


The only runlevel 3 init script that runs after ups is nfs.

System details:
Linux kernel 2.4.32
UPS: APC Back-UPS ES 750

Fwiw, here's a log of a manual driver startup:

Starting UPS: ups
exec: //bin/newhidups -a ups
Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30 (2.0.5)

Detected a UPS: APC/Back-UPS ES 750 FW:819.z3.D USB FW:z3
Using subdriver: APC/CyberPower HID 0.9
Network UPS Tools - UPS driver controller 2.0.5

Any ideas?  Any suggestions what to do to get more debugging info?

TIA,

Jim



More information about the Nut-upsuser mailing list