Hi Martin,

2009/5/28 Martin Maney <ma...@two14.net>

> I had a chance to test this on the Lenny machine where the problem was
> first seen.  Replacing one line in the init script allows the machine
> to send the shutdown command to the UPS:
>
>   poweroff)
>     flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf`
>     wait_delay=`sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p'
> /etc/default/nut`
>     if [ -f "$flag" ] ; then
> -      if /sbin/upsmon -K >/dev/null 2>&1 ; then
> +      if true ; then
>         log_daemon_msg "Shutting down the UPS ..."
>
> Apparently the author doesn't entirely trust upsmon -K or something,
> since the preceeding line has already found the kill file; all upsmon
> adds, according to the man page, is a check of the text in it.
> Harmless when it works...
>

I just saw your report, thanks for it.

to answer the above, upsmon -K will not only check if the POWERDOWNFLAG file
exists, but also if it contains the right magic (just to be sure that only
touching the files won't allow to poweroff the UPS!)

so, your above patch will obviously work, but will also remove a security
harness.
it's acceptable as a temp solution, but I will do my best to prioritize an
upload for Lenny.

cheers,
Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/

Reply via email to