[Nut-upsuser] making upsd available to chkconfig

strong.s at crwash.org strong.s at crwash.org
Thu Feb 23 20:05:46 UTC 2006


OK, so I made this file:
------------------------------------------
#!/bin/sh<\n>

#chkconfig: 2345 60 99
#description: NUT ups daemon

if [ ! -f /usr/local/ups/bin/upsd ]
then
  echo "NUT startup: cannot start"
  exit
fi

case "$1" in
	"start")
		chmod 0600 /proc/bus/usb/005/002
		chown nut:nut /proc/bus/usb/005/002
		/usr/local/ups/bin/upsdrvctl
		/usr/local/ups/sbin/upsd
		/usr/local/ups/sbin/upsmon
		;;
	"stop")
		echo -n "Shutting down UPS monitoring:"
		/usr/local/ups/sbin/upsmon -c stop
		/usr/local/ups/sbin/upsd -c stop
		/usr/local/ups/bin/upsdrvctl stop
		;;
	"restart")
		$0 stop
		sleep 15
		$0 start
	"status")
		/usr/local/ups/bin/upsc gretchen at stretch
	*)
       echo "Usage: $0 {start|stop|restart|status}"
       exit 1
esac
-----------------------------------------
and saved it as:
/etc/init.d/upsd

and made it executable:
chmod 755 /etc/init.d/upsd -- but left the owner and group as root

and then added it to the chkconfig system:
chkconfig --add upsd

and made sure it will be run at statup:
chkconfig --levels 2345 upsd on

I checked to make sure the commands in the file worked correctly when run from
the command line logged in as root and I checked to make sure that the levels
got set right.

BUT... it doesn't run correctly on start up and when I execute any of these
lines from the command line:

service upsd start
service upsd retart
service upsd stop
service upsd status

I get the same error:

env: /etc/init.d/upsd file not found

any ideas???

Thanks and an appology to Pete Selinger, who suffered through me replying to him
instead of to the list!!!
steve




More information about the Nut-upsuser mailing list