Project

General

Profile

Actions

Bug #4118

closed

NUT fails to start in pfSense 2.2

Added by Denny Page over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Nut
Target version:
-
Start date:
12/15/2014
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
2.2
Affected Plus Version:
Affected Architecture:

Description

The start up script for NUT, /usr/local/etc/rc.d/nut.sh, needs to change the path used to invoke upsdrvctl.

In FreeBSD 8.3, the path was /usr/local/libexec/nut/upsdrvctl.

In 10.X, the path has changed to /usr/local/sbin/upsdrvctl.

Actions #1

Updated by Chris Palmer over 10 years ago

Thanks Denny: Confirmed to fix my copy.

[code]
#!/bin/sh
  1. This file was automatically generated
  2. by the pfSense service handler.

rc_start() {
if [ `pgrep usbhid-ups | wc -l` != 0 ]; then
if [ `pgrep upsmon | wc -l` != 0 ]; then
echo stopping upsmon
/usr/bin/killall upsmon
while [ `pgrep upsmon | wc -l` != 0 ]; do
sleep 1
done
fi
if [ `pgrep upsd | wc -l` != 0 ]; then
echo stopping upsd
/usr/bin/killall upsd
fi
if [ `pgrep usbhid-ups | wc -l` != 0 ]; then
echo stopping usbhid-ups
/usr/local/sbin/upsdrvctl stop
fi
sleep 1
if [ `pgrep usbhid-ups | wc -l` != 0 ]; then
echo forcing usbhid-ups termination
/usr/bin/killall usbhid-ups
while [ `pgrep usbhid-ups | wc -l` != 0 ]; do
sleep 1
done
fi

fi
echo starting usbhid-ups
if /usr/local/sbin/upsdrvctl start; then
echo starting upsd
/usr/local/sbin/upsd -u root
echo starting upsmon
/usr/local/sbin/upsmon UPS@localhost
else
echo usbhid-ups failed to start
fi
}

rc_stop() {
if [ `pgrep upsmon | wc -l` != 0 ]; then
echo stopping upsmon
/usr/bin/killall upsmon
while [ `pgrep upsmon | wc -l` != 0 ]; do
sleep 1
done
fi
if [ `pgrep upsd | wc -l` != 0 ]; then
echo stopping upsd
/usr/bin/killall upsd
fi
if [ `pgrep usbhid-ups | wc -l` != 0 ]; then
echo stopping usbhid-ups
/usr/local/sbin/upsdrvctl stop
fi
sleep 1
if [ `pgrep usbhid-ups | wc -l` != 0 ]; then
echo forcing usbhid-ups termination
/usr/bin/killall usbhid-ups
while [ `pgrep usbhid-ups | wc -l` != 0 ]; do
sleep 1
done
fi

}

case $1 in
start)
rc_start
;;
stop)
rc_stop
;;
restart)
rc_stop
rc_start
;;
esac

[/code]

Actions #2

Updated by Denny Page over 10 years ago

Here's the diff if anyone wants it:

*** nut.inc.org    Fri Dec 19 03:31:27 2014
--- nut.inc    Fri Dec 19 03:32:37 2014
***************
*** 300,306 ****
      fi
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
          echo stopping {$driver}
!         /usr/local/libexec/nut/upsdrvctl stop
      fi
      sleep 1
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
--- 300,306 ----
      fi
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
          echo stopping {$driver}
!         /usr/local/sbin/upsdrvctl stop
      fi
      sleep 1
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
***************
*** 319,325 ****
      fi
      {$port_set}
      echo starting {$driver}
!     if /usr/local/libexec/nut/upsdrvctl start; then
          echo starting upsd
          /usr/local/sbin/upsd {$ovr_user}
          echo starting upsmon
--- 319,325 ----
      fi
      {$port_set}
      echo starting {$driver}
!     if /usr/local/sbin/upsdrvctl start; then
          echo starting upsd
          /usr/local/sbin/upsd {$ovr_user}
          echo starting upsmon
***************
*** 416,422 ****
      fi
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
          echo stopping {$driver}
!         /usr/local/libexec/nut/upsdrvctl stop
      fi
      sleep 1
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
--- 416,422 ----
      fi
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
          echo stopping {$driver}
!         /usr/local/sbin/upsdrvctl stop
      fi
      sleep 1
      if [ `pgrep {$driver} | wc -l` != 0 ]; then
***************
*** 435,441 ****
      fi
      {$port_set}
      echo starting {$driver}
!     if /usr/local/libexec/nut/upsdrvctl start; then
          echo starting upsd
          /usr/local/sbin/upsd {$ovr_user}
          echo starting upsmon
--- 435,441 ----
      fi
      {$port_set}
      echo starting {$driver}
!     if /usr/local/sbin/upsdrvctl start; then
          echo starting upsd
          /usr/local/sbin/upsd {$ovr_user}
          echo starting upsmon
Actions #3

Updated by Kill Bill over 10 years ago

Diff works. ;)

Actions #4

Updated by Kill Bill over 10 years ago

Keepalive Xmas ping. ;) This is incredibly annoying on snapshot upgrades, causing very slow boot. https://forum.pfsense.org/index.php?topic=85794.0

Actions #5

Updated by Renato Botelho over 10 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Applied in changeset commit:63881e2114fc597d2f940d630d902c4801b6b9e0.

Actions #6

Updated by Kill Bill over 10 years ago

Thanks, works now. Merry Christmas! :-)

Actions #7

Updated by Denny Page over 10 years ago

Fix confirmed. Many thanks!

Actions #8

Updated by Renato Botelho over 10 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF