[Nut-upsuser] FreeBSD rc.d scripts or shutdown howto?

Patrick Agrain patrick.agrain at alcatel-lucent.fr
Tue Aug 21 08:26:11 UTC 2007


I've found the same behavior on RHES 4.5 with nut-2.2.0.

The patch included in the NUT RPMs ( nut-client, or nut ) includes the 
shutdown procedure too late in the /etc/init.d/halt script.
At this moment, all filesystems have been unmounted and access to 
/sbin/upsdrvctl is no more possible.

Test to get this part sooner in the halt script generates a "Permission 
denied" problem when "including" the file /etc/sysconfig/ups.
I'm still looking for an acceptable solution.

Ugly workaround :
Reducing the procedure to the minimum ( if /etc/killpower then 
/sbin/upsdrvctl shutdown ) works when put before unmounting the loopback 
filesystem (still on RHES4.5).

Patrick Agrain

At 04:03 21/08/2007, you wrote:
>Hello again.
>After an hour of Googling and just not "getting" it, I figured I'd
>call upon the list once more...
>I am starting upsd, upsmon, etc in my FreeBSD's /etc/rc.local, because
>it's easy. BUT... rc.shutdown seems kill off all those processes prior
>to excuting my upsdrvctl shutdown command, thereby preventing any ups
>communications and yup, the power don't get killed.
>rc.shutdown snippet:
>[code to run all rc.d stop script here]
># Insert other shutdown procedures here
>if [ -f /etc/killpower ]; then
>         echo "Killing the power, bye!"
>         /usr/local/ups/bin/upsdrvctl shutdown <<< oops, upsd is already dead
>         sleep 120
>         reboot
>rc.local snippet, for what it's worth:
>/usr/local/ups/bin/upsdrvctl start
>The distro directory scripts/FreeBSD, where such scripts used to be as
>I've read in lots of places, well, it doesn't seem to exist in the
>v2.x.x distributions of nut anyway.
>Once again -- any help getting this last little bit working would be
>hugely appreciated.
>Nut-upsuser mailing list
>Nut-upsuser at lists.alioth.debian.org

More information about the Nut-upsuser mailing list