Bug #4118
closedNUT fails to start in pfSense 2.2
100%
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.
Updated by Chris Palmer over 10 years ago
Thanks Denny: Confirmed to fix my copy.
[code]#!/bin/sh
- This file was automatically generated
- 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]
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
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
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.
Updated by Renato Botelho over 10 years ago
- Status changed from Feedback to Resolved