Article 6DBJW genpowerd is not that well supported; nut appears to be more active.

genpowerd is not that well supported; nut appears to be more active.

by
Richard Cranium
from LinuxQuestions.org on (#6DBJW)
Hi, it's me, I'm back.

genpowerd versus nut

genpowerd was last updated in 2014; nut was updated last month. (The slackbuild.org version of nut has not quite kept up.)

I'd be happy to have a number of backup power supply hooks that were called by rc.0, rc.6, and rc.M that would DTRT.

For example, on a Slackware64 14.2 system, I have modified a bit of both /etc/rc.d/rc.0 AND /etc/rc.d/rc.6 to be...

Code:# This is to ensure all processes have completed on SMP machines:
wait

if [ -x /sbin/genpowerd ]; then
# See if this is a powerfail situation:
if /bin/egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then
# Signal UPS to shut off the inverter:
/sbin/genpowerd -k
if [ ! $? = 0 ]; then
echo
echo "There was an error signaling the UPS."
echo "Perhaps you need to edit /etc/genpowerd.conf to configure"
echo "the serial line and UPS type."
# Wasting 15 seconds of precious power:
/bin/sleep 15
fi
fi
fi

if [ -e /etc/killpower ]; then
/etc/rc.d/rc.ups shutdown
sleep 120
echo "Well, that didn't work as expected"
fiI think it would be a good idea to replace the if [ -x /sbin/genpowerd ]; then block to a call to a hook script if said script exists and is executable that does the right thing depending upon your UPS handler. The default being the genpowerd block being already there.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments