On Fri, November 28, 2014 2:45 am, Marcus MERIGHI wrote: > [email protected] (Joe Gidi), 2014.11.27 (Thu) 16:41 (CET): >> I just spent some more time poking at this and I'm still unable to get > > So did I... > >> sensorsd to recognize upd state changes. This is a bit of a frustrating >> regression from my point of view, since I can no longer use apcupsd >> unless >> I disable uhidev in the kernel. >> >> Does anyone have a working example configuration for sensorsd/upd? > > What I have now: > > $ getcap -a -f /etc/sensorsd.conf > hw.sensors.upd0.indicator0:low=1:high=2:command=/etc/sensorsd/upd.sh \ > %l %n %s %x %t %2 %3 %4 > hw.sensors.upd0.indicator1:low=1:high=2:command=/etc/sensorsd/upd.sh \ > %l %n %s %x %t %2 %3 %4 > hw.sensors.upd0.indicator2:low=1:high=2:command=/etc/sensorsd/upd.sh \ > %l %n %s %x %t %2 %3 %4 > hw.sensors.upd0.indicator3:low=1:high=2:command=/etc/sensorsd/upd.sh \ > %l %n %s %x %t %2 %3 %4 > hw.sensors.upd0.indicator4:low=1:high=2:command=/etc/sensorsd/upd.sh \ > %l %n %s %x %t %2 %3 %4 > hw.sensors.upd0.percent0:low=10:high=100:command=\ > /etc/sensorsd/upd-capacityremaining.sh %l %n %s %x %t %2 %3 %4 > hw.sensors.upd0.percent1:low=95:high=100:command=/etc/sensorsd/upd.sh \ > %l %n %s %x %t %2 %3 %4 > > The ``command=/etc/sensorsd/upd.sh'' lines are just informational. > > The workhorse is "command=/etc/sensorsd/upd-capacityremaining.sh": > ---- > #!/bin/sh -e > if [[ X"${1}" == X"below" ]]; then > logger -t "UPD-capacityremaining" "SHUTDOWN (${@})" > shutdown -hp +1 > else > logger -t "UPD-capacityremaining" "NON-SHUTDOWN (${@})" > fi > ---- > > I did some testing (plug/unplug, wait for hw.sensors.upd0.percent0 to go > below low=) and left it as "working". > > Bye, Marcus
Hi Marcus, Thanks for this! The percent0 example will be useful. Were you able to get any useful results with the other indicator sensors? The 'low=1:high=2' attributes don't seem to do anything for me. Thanks again, -- Joe Gidi [email protected] "You cannot buy skill." -- Ross Seyfried

