New package Apcupsd is available.
-
I think is definitely related to pcnet protocol implementation.
No error using SNMP.
I hope will be resolved,
APC "powerchute" protocol is useful to centrally manage shutdown bidirectionally (UPS to pfsense and vice versa) in a controlled mode, unlike the SNMP implementation.Thank you again Danilo!
-
I think is definitely related to pcnet protocol implementation.
No error using SNMP.
I hope will be resolved,
APC "powerchute" protocol is useful to centrally manage shutdown bidirectionally (UPS to pfsense and vice versa) in a controlled mode, unlike the SNMP implementation.Thank you again Danilo!
I've found the error.
apcupsd.trace:
0.000 apcupsd: apcupsd.c:156 Options parsed. 0.000 apcupsd: apcupsd.c:156 Options parsed. 0.000 apcupsd: apcupsd.c:179 Config file /usr/local/etc/apcupsd/apcupsd.conf processed. 0.000 apcupsd: apcupsd.c:179 Config file /usr/local/etc/apcupsd/apcupsd.conf processed. 0.000 apcupsd: drivers.c:146 Attached to driver: pcnet 0.000 apcupsd: drivers.c:146 Attached to driver: pcnet 0.008 apcupsd: apcupsd.c:251 NIS thread started. 0.011 apcupsd: apcupsd.c:251 NIS thread started. apcupsd FATAL ERROR in pcnet.c at line 669 Cannot bind socket (48) apcupsd FATAL ERROR in newups.c at line 103 Mutex lock failure. ERR=Resource deadlock avoided
It's starting apcupsd twice on booting.
I will send a PR for fix this.
Thank you @LucaTo
-
Just see here: https://github.com/pfsense/FreeBSD-ports/pull/169
I'm testing now the changes in /usr/local/pkg/apcupsd.inc
seems it works like a charms, zero errors on reboot! :)Aug 12 22:36:50 sshlockout 69588 sshlockout/webConfigurator v3.0 starting up Aug 12 22:36:50 login login on ttyu0 as root Aug 12 22:36:50 login login on ttyv0 as root Aug 12 22:36:49 kernel done. Aug 12 22:36:48 apcupsd 55611 NIS server startup succeeded Aug 12 22:36:48 apcupsd 55611 apcupsd 3.14.13 (02 February 2015) freebsd startup succeeded Aug 12 22:36:48 xinetd 25528 Reconfigured: new=0 old=1 dropped=0 (services) Aug 12 22:36:48 xinetd 25528 readjusting service 6969-udp Aug 12 22:36:48 xinetd 25528 Swapping defaults Aug 12 22:36:48 xinetd 25528 Starting reconfiguration Aug 12 22:36:48 radiusd 48622 Ready to process requests. Aug 12 22:36:48 radiusd 46856 Loaded virtual server <default>Aug 12 22:36:47 xinetd 25528 Reconfigured: new=0 old=1 dropped=0 (services) Aug 12 22:36:47 xinetd 25528 readjusting service 6969-udp Aug 12 22:36:47 xinetd 25528 Swapping defaults Aug 12 22:36:47 xinetd 25528 Starting reconfiguration Aug 12 22:36:47 kernel done. Aug 12 22:36:47 php-fpm 28459 /rc.start_packages: Restarting/Starting all packages. Aug 12 22:36:46 check_reload_status Reloading filter Aug 12 22:36:46 syslogd kernel boot file is /boot/kernel/kernel</default>
thanks for the excellent work @dbaio
-
-
New pfsense installation, based on a Intel D510MO mobo (Atom),
apcupsd works fine :)
But… due to a buggy bios this mobo can't handle the "halt" state (reboot at the end, this issue is not rare, many other mobos present the same problem).
In this case the system reboots (instead of stay on halt state) at the end of "halt" ("shutdown -h now" from command line) but... poweroff regularly after select "Diagnostics-->Halt system" from pfsense web gui ???My workaround is a little change in apccontrol file (/usr/local/etc/apcupsd/apccontrol),
changing shutdown switch from -h (halt) to -p (poweroff)
and change bios setting from "power failure: last state" to "power on"note: this mod survive on reboot or changhing settings on apcupsd web gui (maybe not after reinstalling or updating the pkg)
;; doshutdown) printf "Beginning Shutdown Sequence" | wall ${SHUTDOWN} -p now "apcupsd initiated shutdown" ;;
Maybe this trick can be useful to someone else ;)
I think would be useful an option on apcupsd web setting page for select the type of shutdown :"halt" or "poweroff" ;D -
;; doshutdown) printf "Beginning Shutdown Sequence" | wall ${SHUTDOWN} -p now "apcupsd initiated shutdown" ;;
Maybe this trick can be useful to someone else ;)
I think would be useful an option on apcupsd web setting page for select the type of shutdown :"halt" or "poweroff" ;DGood idea.
Let's first resolve this problem and release apcupsd, then propose this improvement.
Regards. -
New pfsense installation, based on a Asus AM1M-A (AMD AM1 5350 cpu),
also in this case bios doesn't handle the "halt" state and reboot… (this is a common issue in most cases using "consumer" motherboard).I think would be really useful, as I had wrote, an option on apcupsd web setting page for select the type of shutdown :"halt" or "poweroff" (to avoid to manually edit apccontrol, and and make this setting persistent in future pkg update)
Anyone has encountered the same situation?
-
I think would be really useful, as I had wrote, an option on apcupsd web setting page for select the type of shutdown :"halt" or "poweroff" (to avoid to manually edit apccontrol, and and make this setting persistent in future pkg update)
Oh, had forgotten this. :(
Could you test this update ?
https://github.com/dbaio/FreeBSD-ports/commit/3caacbdb891167480e081be532721644f65c9813It will create a
doshutdown
script to replace the default command on apccontrol.Regards.
-
Hi dbaio!
Tested, it works perfectly :)
Great work! Many many thanks!
Pfsense,apcupsd+apc ups it's a perfect marriage! ;D -
Hi dbaio!
Tested, it works perfectly :)
Great work! Many many thanks!
Pfsense,apcupsd+apc ups it's a perfect marriage! ;DThank you.
https://github.com/pfsense/FreeBSD-ports/pull/273 -