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 fi ... rc.local snippet, for what it's worth: ... /usr/local/ups/bin/upsdrvctl start /usr/local/ups/sbin/upsd /usr/local/ups/sbin/upsmon ... 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. Thanks. -- Bryan.
Charles Lepple
2007-Aug-21 03:07 UTC
[Nut-upsuser] FreeBSD rc.d scripts or shutdown howto?
On 8/20/07, Bryan <gruvin at gmail.com> wrote:> if [ -f /etc/killpower ]; then > echo "Killing the power, bye!" > /usr/local/ups/bin/upsdrvctl shutdown <<< oops, upsd is already deadupsdrvctl doesn't actually communicate with upsd - it simply starts and stops drivers directly (and except in the case of shutting down the UPS, the drivers then connect to upsd). If you're using a USB driver, make sure the OS isn't unmounting whatever USB filesystem might be necessary. Another idea is to plug the server into another UPS (or directly into the wall) and manually run the driver with "-k" and probably a few "-D" options to see what is going on. Some drivers (tripplite_usb, for one) do not fully implement the UPS shutdown commands, and other UPSes do not let you shut them down unless they are already on battery. -- - Charles Lepple
Patrick Agrain
2007-Aug-21 08:26 UTC
[Nut-upsuser] FreeBSD rc.d scripts or shutdown howto?
Hello, 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). Regards, 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 >fi >... > >rc.local snippet, for what it's worth: >... >/usr/local/ups/bin/upsdrvctl start >/usr/local/ups/sbin/upsd >/usr/local/ups/sbin/upsmon >... > >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. > >Thanks. > >-- >Bryan. > >_______________________________________________ >Nut-upsuser mailing list >Nut-upsuser at lists.alioth.debian.org >http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser