Kjell,<br><br>have you taken a look at that one?<br><br>-- Arnaud<br><br><div class="gmail_quote">2009/1/29 Arjen de Korte <span dir="ltr">&lt;<a href="mailto:nut%2Bdevel@de-korte.org">nut+devel@de-korte.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">----- Doorgestuurd bericht van <a href="mailto:dkbrig@gmail.com">dkbrig@gmail.com</a> -----<br>

 &nbsp; &nbsp; Datum: Thu, 29 Jan 2009 11:16:06 -0600<br>
 &nbsp; &nbsp; &nbsp; Van: Danny &lt;<a href="mailto:dkbrig@gmail.com">dkbrig@gmail.com</a>&gt;<br>
 &nbsp;Onderwerp: upscode2.c<br>
 &nbsp; &nbsp; &nbsp; Aan: <a href="mailto:adkorte-guest@alioth.debian.org">adkorte-guest@alioth.debian.org</a><br>
<br>
Hi,<br>
<br>
I apologize if you are not the correct person, but I was wanting to<br>
submit a bug report for the upscode2.c driver but could not find a way<br>
to do that from the NUT website.<br>
<br>
Here is the problem code and what I have noticed in upscode2.c:<br>
<br>
void upsdrv_shutdown(void)<br>
{<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if (can_upsd &amp;&amp; can_uppc) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upslogx(LOG_EMERG, &quot;Emergency shutdown&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upscsend(&quot;UPSD&quot;); &nbsp; &nbsp; &nbsp; /* Set shutdown delay */<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upscsend(&quot;1&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* 1 second (lowest possible.<br>
0 returns current.*/<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upslogx(LOG_EMERG, &quot;Shutting down...&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upscsend(&quot;UPPC&quot;); &nbsp; &nbsp; &nbsp; /* Powercycle UPS */<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upscsend(&quot;IJHLDMGCIU&quot;); /* security code */<br>
 &nbsp; &nbsp; &nbsp; &nbsp; }<br>
 &nbsp; &nbsp; &nbsp; &nbsp; else {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; upslogx(LOG_EMERG, &quot;Shutdown called, but UPS does not<br>
support it&quot;);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; }<br>
}<br>
<br>
<br>
The problem is that the if(can_upsd &amp;&amp; can_uppc) check was added<br>
between SVN 408 and SVN 743. &nbsp;Those variables can_upsd and can_uppc<br>
get set to 0 (zero) when upscode2 starts and then based on the output<br>
of the UPCL command to the UPS, they get set to a one if the UPS<br>
supports those commands.<br>
<br>
However, if you call the driver with the -k option to force a<br>
shutdown, which my shutdown scripts do, it fails because those<br>
variables are never set, because the routine upsc_commandlist is never<br>
called. &nbsp;That is the routine where the output of the UPCL command to<br>
the UPS is checked to see if the UPS supports those commands.<br>
<br>
I noticed that in version 408 those checks didn&#39;t exist, but in SVN<br>
743 they were added. &nbsp;I checked NUT 2.0.5 and the upscode2.c driver<br>
didn&#39;t contain those checks and therefore the shutdown for my UPS<br>
worked properly. &nbsp;But with version 2.2.2, those checks exist and the<br>
shutdown doesn&#39;t work.<br>
<br>
Thanks,<br>
Danny<br>
<a href="mailto:dkbrig@gmail.com">dkbrig@gmail.com</a><br>
<br>
<br>
<br>
----- Einde doorgestuurd bericht -----<br>
<br>
_______________________________________________<br>
Nut-upsdev mailing list<br>
<a href="mailto:Nut-upsdev@lists.alioth.debian.org">Nut-upsdev@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev</a><br>
</blockquote></div><br><br>