OK, can someone tell me what utterly moronic thing I am doing wrong? I have two roughly identical Linux system running NUT, and one works properly. The other almost does. The second system works well once everything is up, but after booting, the system does not have connectivity to the UPS. I have to manually run `upsdrvctl start backup`, `/etc/init.d/nut start`, and `upsd` to get NUT working. Thereafter it works fine, whether anyone is logged in or not. After a boot, however, I have to log in and kick-start it again. What am I missing? The S50nut symlink is in /etc/rc2.d, and both systems are at runlevel 2. I set up the systems the very same way (as far as I can remember or tell), except that one employs driver = tripplite_usb in usb.conf and the other uses driver = usbhid-ups, plus the two have different backup names. Otherwise, I think everything is the same.
On Wed, May 27, 2009 at 1:10 AM, Leslie Rhorer <lrhorer at satx.rr.com> wrote:> OK, can someone tell me what utterly moronic thing I am doing wrong? > > I have two roughly identical Linux system running NUT, and one works > properly. The other almost does. The second system works well once > everything is up, but after booting, the system does not have connectivity > to the UPS.What do the logs say?> I have to manually run `upsdrvctl start backup`, > `/etc/init.d/nut start`, and `upsd` to get NUT working. Thereafter it works > fine, whether anyone is logged in or not. After a boot, however, I have to > log in and kick-start it again.Interesting, most systems are set up such that '/etc/init.d/nut start' will run upsdrvctl and upsd. To restart, does it suffice to only run '/etc/init.d/nut start'?> What am I missing? The S50nut symlink is in /etc/rc2.d, and both > systems are at runlevel 2. I set up the systems the very same way (as far > as I can remember or tell), except that one employs driver = tripplite_usb > in usb.conf and the other uses driver = usbhid-ups, plus the two have > different backup names. Otherwise, I think everything is the same.One thing you can do to catch any subtle differences is to tar up the /etc/nut directory on one machine, then extract it into /tmp on the other machine, and use 'diff -Naur /etc/nut /tmp/nut' or whatnot. -- - Charles Lepple
> -----Original Message----- > From: 'Brother Railgun of Reason' [mailto:alaric at caerllewys.net] > Sent: Friday, May 29, 2009 10:45 AM > To: Leslie Rhorer > Subject: Re: [Nut-upsuser] This guy must be an idiot > > On Fri, May 29, 2009 at 09:13:56AM -0500, Leslie Rhorer wrote: > > > Are you certain your nut startup script is even actually being run? > > > > Not with absolute certainty, no. > > > > > This sounds like for some reason the system's never trying to run the > > > script. > > > > 'Not really, since running the script manually has no effect, either. > > If running the script manually does nothing, the script's probably > wrong.Then why does it work perfectly on system number one?> What does your startup script look like?#! /bin/sh ### BEGIN INIT INFO # Provides: nut # Required-Start: $local_fs $syslog $network # Required-Stop: $local_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Network UPS Tools initscript # Description: This script take care of starting and stopping the # Network UPS Tools components. When needed, it also # handle the UPS hardware shutdown. ### END INIT INFO # Author: Arnaud Quette <aquette at debian.org> PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut DESC="Network UPS Tools" DEFAULT=/etc/default/nut . /lib/lsb/init-functions [ -f $DEFAULT ] || exit 0 . $DEFAULT pid_dir=/var/run/nut upsmon_pid=${pid_dir}/upsmon.pid upsd_pid=${pid_dir}/upsd.pid upsd=/sbin/upsd upsmon=/sbin/upsmon log=">/dev/null 2>/dev/null" # Check if /var/run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ && chmod 770 ${pid_dir} } start_stop_server () { case "$START_UPSD" in y|Y|yes|YES|Yes) case "$1" in start) ! /sbin/upsdrvctl start >/dev/null 2>&1 && \ log_progress_msg "(upsdrvctl failed)" || log_progress_msg "upsdrvctl" start-stop-daemon -S -q -p $upsd_pid -x $upsd \ -- $UPSD_OPTIONS >/dev/null 2>&1 ;; stop) start-stop-daemon -K -o -q -p $upsd_pid -n upsd >/dev/null 2>&1 ! /sbin/upsdrvctl stop >/dev/null 2>&1 && \ log_progress_msg "(upsdrvctl failed)" || log_progress_msg "upsdrvctl" ;; esac ;; n|N|no|NO|No|*) return 1 ;; esac } start_stop_client () { case "$START_UPSMON" in y|Y|yes|YES|Yes) case "$1" in start) start-stop-daemon -S -q -p $upsmon_pid -x $upsmon \ -- $UPSMON_OPTIONS >/dev/null 2>&1 ;; stop) start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 ;; esac ;; n|N|no|NO|No|*) return 1 ;; esac } case "$1" in start) log_daemon_msg "Starting $DESC" check_var_directory start_stop_server start && log_progress_msg "upsd" start_stop_client start && log_progress_msg "upsmon" log_end_msg 0 ;; stop) log_daemon_msg "Stopping $DESC" start_stop_server stop && log_progress_msg "upsd" start_stop_client stop && log_progress_msg "upsmon" log_end_msg 0 ;; reload) $upsd -c reload >/dev/null 2>&1 $upsmon -c reload >/dev/null 2>&1 ;; restart|force-reload) log_daemon_msg "Restarting $DESC" start_stop_client stop start_stop_server stop sleep 5 check_var_directory start_stop_server start && log_progress_msg "upsd" start_stop_client start && log_progress_msg "upsmon" log_end_msg 0 ;; poweroff) flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf` wait_delay=`sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p' /etc/default/nut` if [ -f "$flag" ] ; then if /sbin/upsmon -K >/dev/null 2>&1 ; then log_daemon_msg "Shutting down the UPS ..." sleep 1 if /sbin/upsdrvctl shutdown ; then sleep 5 log_progress_msg "Waiting for UPS to cut the power" log_end_msg 0 else log_progress_msg "Shutdown failed." log_progress_msg "Waiting for UPS batteries to run down" log_end_msg 0 fi if [ "$wait_delay" ] ; then log_daemon_msg " (will reboot after $wait_delay) ..." sleep "$wait_delay" /etc/init.d/reboot stop fi else log_daemon_msg "Power down flag is not set (UPS shutdown not needed)" fi else if [ -z "$flag" ] ; then log_daemon_msg "##########################################################" log_progress_msg "## POWERDOWNFLAG is not defined in /etc/nut/upsmon.conf ##" log_progress_msg "## ##" log_progress_msg "## Please read the Manual page upsmon.conf(5) ##" log_progress_msg "##########################################################" log_end_msg 0 fi fi ;; *) N=/etc/init.d/$NAME log_daemon_msg "Usage" "$N {start|stop|reload|restart|force-reload|poweroff}" >&2 log_end_msg 0 exit 1 ;; esac exit 0
On Wed, May 27, 2009 at 1:10 AM, Leslie Rhorer <lrhorer at satx.rr.com> wrote:> OK, can someone tell me what utterly moronic thing I am doing wrong? > > I have two roughly identical Linux system running NUT, and one works > properly. The other almost does. The second system works well once > everything is up, but after booting, the system does not have connectivity > to the UPS. I have to manually run `upsdrvctl start backup`, > `/etc/init.d/nut start`, and `upsd` to get NUT working. Thereafter it works > fine, whether anyone is logged in or not. After a boot, however, I have to > log in and kick-start it again. > > What am I missing? The S50nut symlink is in /etc/rc2.d, and both > systems are at runlevel 2. I set up the systems the very same way (as far > as I can remember or tell), except that one employs driver = tripplite_usb > in usb.conf and the other uses driver = usbhid-ups, plus the two have > different backup names. Otherwise, I think everything is the same.What do the /etc/default/nut files look like on both systems? -- - Charles Lepple
Reasonably Related Threads
- Shutdown problem with Geek Squad GS1285U
- ctdb event script 50.samba does not start smbd
- Bug#770456: Bug#770456: Please start a qemu process in domain 0.
- Upgrading Samba 3 to Samba 4 - Domain Controller unreachable
- CyberPower USB UPS fails to cut power during shutdown