[Nut-upsuser] New problem, new thread (I think)

Gene Heskett gene.heskett at gmail.com
Mon Jan 4 19:10:29 UTC 2010


On Monday 04 January 2010, Arjen de Korte wrote:
>Citeren Gene Heskett <gene.heskett at gmail.com>:
>> Well, /etc/hal/fdi is now empty, and because I'd killed hald, I had to
>> reboot with the reset button, no keyboard or mouse, but the above
>> condition remains, and the nut driver is dead again for the same reason,
>> it cannot take possession of /dev/hiddev0 because according to htop,
>> hald-addon-hid-ups is listening to /dev/hiddev0 and running as root.
>>
>> Ideas about this?  Anybody?
>
>Add --without-hal on the configure command line. Apparently, you used
>--with-all=auto. See 'docs/nut-hal.txt' for more info on the HAL
>enabled drivers.
>
>Best regards, Arjen
>
I couldn't find the ./configure line in the history, and I may have.  I have 
now rebuilt it & installed without that, and have gone through the system 
nuking any *libexec/hald-* files with a date matching when I last installed 
nut.

Several reboots later, I find it is working again, but I had to nuke any 
hald-addon-usbhid-ups regardless of the date on the file, and I've had to 
modify the /etc/init.d/ups script to start the driver directly by its name & 
path.  So that file now looks like this (word-wrapped, dammit):
----------------------------------
#! /bin/bash
#
# ups: Starts the Network UPS Tools
#
# chkconfig: - 26 74
# description: Network UPS Tools is a collection of programs which provide a 
common \
#		interface for monitoring and administering UPS hardware.
# processname: upsd
# config: /etc/ups/
# config: /etc/sysconfig/ups
#
### BEGIN INIT INFO
# Provides: ups
# Required-Start: $syslog $network $named
# Default-Stop: 0 1 6
# Short-Description: Starts the Network UPS tools
# Description: Network UPS Tools is a collection of programs which provide a 
common \
#		interface for monitoring and administering UPS hardware. 
### END INIT INFO

# Source function library.
if [ -f /etc/init.d/functions ]; then
	. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
	. /etc/rc.d/init.d/functions
else
	exit 0
fi

# Get config.
if [ -f /etc/sysconfig/ups ]; then
	. /etc/sysconfig/ups
else
	SERVER="no"
fi

start() {
	if [ "$SERVER" = "yes" ]; then
		echo -n $"Starting UPS driver controller: "
		daemon /usr/local/bin/usbhid-ups -u ups -a myups start > /dev/null 2>&1 && 
success || failure
#		/usr/local/bin/usbhid-ups -u ups -a myups start
	RETVAL=$?
		echo

		prog="upsd"
		echo -n $"Starting $prog: "
		daemon /usr/local/sbin/upsd $UPSD_OPTIONS > /dev/null 2>&1 && success || 
failure
		if [ "$RETVAL" = 0 ]; then
			RETVAL=$?
		fi
		echo

		echo -n $"Starting UPS monitor (master): "
		daemon /usr/local/sbin/upsmon > /dev/null 2>&1 && success || failure
		if [ "$RETVAL" = 0 ]; then
			RETVAL=$?
		fi
		echo
	else
		echo -n $"Starting UPS monitor (slave): "
		daemon /usr/local/sbin/upsmon > /dev/null 2>&1 && success || failure
		echo
	fi

	[ "$RETVAL" = 0 ] && touch /var/lock/subsys/ups
}

stop() {
	echo -n $"Stopping UPS monitor: "
	killproc upsmon
	echo

	if [ "$SERVER" = "yes" ]; then
		prog="upsd"
		echo -n $"Stopping $prog: "
		killproc upsd > /dev/null 2>&1 && success || failure
		RETVAL=$?
		echo

		echo -n $"Shutting down upsdrvctl: "
		/usr/local/bin/usbhid-ups stop > /dev/null 2>&1 && success || failure
		if [ "$RETVAL" = 0 ]; then
			RETVAL=$?
		fi
		echo
	fi
	[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups
}

restart() {
	stop
	start
}

reload() {
	# FIXME: upsd and upsmon always return 0
	# => can't tell if reload was successful
	if [ "$SERVER" = "yes" ]; then
		action "Reloading upsd:" /usr/sbin/upsd -c reload
		RETVAL=$?
	fi
	action "Reloading upsmon:" /usr/sbin/upsmon -c reload
	if [ "$RETVAL" = 0 ]; then
		RETVAL=$?
	fi
}

# See how we are called.
case "$1" in
	start)
		start ;;

	stop)
		stop ;;

	restart)
		restart ;;

	try-restart)
		[ -f /var/lock/subsys/ups ] && restart || :
		;;

	reload)
		reload ;;

	force-reload)
		restart ;;

	status)
		if [ "$SERVER" = "yes" ]; then
			status upsd
		fi
		status upsmon
		;;

	*)
		echo $"Usage: $0 {start|stop|restart|try-restart|reload|force-reload|
status}"
		RETVAL=3
esac

exit $RETVAL
---------------------------------------------
It still reports Fail for the driver start or stop, but it is running now.  
If that could be fixed it would reduce the panic level here...

Thanks Arjen

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)

FACILITY REJECTED 100044200000;



More information about the Nut-upsuser mailing list