On 11/9/06, <b class="gmail_sendername">Arjen de Korte</b> &lt;<a href="mailto:nut+users@de-korte.org">nut+users@de-korte.org</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&gt;&gt; [ups_name]<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; driver = genericups<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; upstype = 7<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; port = /dev/ttyS0<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; desc = &quot;Sweex 1000VA UPS&quot;<br>&gt; Ok, I tried this.<br>&gt; The driver was loaded and..... the server shutdown immediately.
<br><br>Lesson #1: Always first test whether the driver is producing good results<br>(you must be able to read the status from your UPS correctly), before<br>using it to shutdown a system.</blockquote><div><br>I thought I was doing this . I didn't expect the thing would ever shutdown when it's on power cord.
<br>I'm new to all this UPS stuff. And gee I like it from the first date!<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; I had to attach a screen and a keyboard to the server and boot it in
<br>&gt; single user mode to disable nut in /etc/default/<br><br>Lesson #2: Unless you're sure of #1, don't put NUT in scripts that are<br>started automatically to prevent deadlocks... :-)</blockquote><div><br>Right, my mistake 
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">[...]<br><br>&gt; This gives me:<br>&gt;<br>&gt;&nbsp;&nbsp;radius1:/var/log# ls -l /dev/ttyS0
<br>&gt; crw-rw----&nbsp;&nbsp;1 root dialout 4, 64 2005-02-26 07:39 /dev/ttyS0<br>&gt;<br>&gt; So, I guess not good. What is the correct chown?<br>&gt; chown root:nut /dev/ttyS0 ?<br>&gt;<br>&gt; Could this be the reason of the instant shutdown?
<br><br>No, not really. When the genericups driver fails to lock the serial port<br>(because of wrong permissions or it is locked by another process) it will<br>fail to startup.<br><br>Are you absolutely sure that the UPS is connected to /dev/ttyS0? For
<br>'upstype=7' the signals for 'on battery' and 'low battery' are -CTS and<br>-DCD (both zero). I wouldn't be surprized at all if this is the same as<br>nothing connected to the port you're monitoring (although I can't test
<br>that right now).</blockquote><div><br>The machine kept rebooting, even with no serial cable to the UPS connected anymore,<br>so I guess that's a yes? How can I be absolutely sure it's connected to /dev/ttyS0?<br>That proliant server has a serial A and a serial B RS232, I took serial A.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Note that the genericups driver is not able to detect whether or not<br>something is connected to the port it is monitoring, unlike many other
<br>(somewhat) smarter protocols that are used by other drivers. This is due<br>to the limitations of the contact closure protocol used, not by the<br>driver.<br><br>&gt; I don't want this to happen again. (radius)<br><br>
Lesson #3: You really, REALLY, shouldn't experiment with a UPS on a live<br>system... :-)</blockquote><div><br>Yes, Easy to say when the system is already operational. I didn't have that much choice.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
When in doubt, it is always better to follow the instructions from the<br>genericups man page under the chapter 'TESTING COMPATIBILITY' to prevent<br>inadvertent shutdowns of your system.</blockquote><div><br>Yes, I guess you're right, but I start to get sick of it.&nbsp;
<br>As I said before this is a live system and I can't mess with it to much.<br>I really hope someone can give me the link I 'm missing here.<br>Otherwise it's better to stop waisting my time on that ups and look for another one better supported.
<br>MGE? Suggestions from recent models working without problems are welcome. <br>I use the stable debian package, nut 2.0.1-4 <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Kind regards,<br>Arjen<br><br></blockquote></div><br>Tnx for all help and suggestions,<br>Yves<br>