<p>I add #!/bin/bash at the beginning of my script<br />
my script is in /home/nut<br />
the user nut is owner<br />
I run my script with sh /home/nut/alert_ups<br />
<br />
I try running upsmon in debug mode with "upsmon -DDD".<br />
I have a denied permission when the file ups.log is created</p>
<p>I create it and I add nut owner</p>
<p>and all is OK</p>
<p>&#160;</p>
<p>I'm going to continue my setteings<br />
Thanks<br />
<br />
<br />
PS : sorry for my bad english<br />
<br />
Le 29/11/2010 16:51, Arnaud Quette a écrit&#160;:</p>
<blockquote>Hi again Sabine,<br />
<br />
first, please keep the list cc'ed<br />
<br />
<div>2010/11/29 sabine GOUDARD <span>&lt;<a href="mailto:sabine.goudard@st-etienne.archi.fr">sabine.goudard@st-etienne.archi.fr</a>&gt;</span><br />
<blockquote class="gmail_quote">
<p>&#160;</p>
<p><span><span>2007 effectively ....<br />
</span></span></p>
</blockquote>
<div>indeed, time passes too quickly!<br />
&#160;</div>
<blockquote class="gmail_quote">
<p><span><span>               </span><span>my script: very simple<br />
<br />
</span><span>if I run it manually I have no problem</span></span></p>
<p># write to a specific log file<br />
date=$(date +"%F %T")<br />
echo "$date &gt;&gt; UPS ALERT, shutting down in a few             seconds..." &gt;&gt; /var/log/ups.log</p>
</blockquote>
<div>is the above your complete script?<br />
if so, you should really add a header like:<br />
!#/bin/sh<br />
<br />
don't forget that this will be run from a program, which may           be different that running from a shell.<br />
next, how do you manually call your script? ie "sh           myscript.sh" or simply "./myscript.sh".<br />
in other word, are the executable bits set?<br />
<br />
your problem here may be that the NUT user (the one running           upsmon) doesn't have the right privileges to access to your           home, where your script is located.<br />
in this case, you should put it in a more neutral location,           like /usr/local/bin.<br />
<br />
to get the exact issue, try running upsmon in debug mode           (after having stopped it), using "upsmon -DDD".<br />
and generate a power failure. have a look at the same time at           upsmon output to see what's going on...<br />
my guess is that it will be solved by either of the above fix           (location, exec bits, header line for interpreter declaration)</div>
<blockquote class="gmail_quote">
<p>I have restart upsmon after each modification in             upsmon.conf</p>
<p>&#160;</p>
<p>I also have question about</p>
<p>POWERDOWNFLAG /etc/killpower</p>
<p>When UPS is on LB, it&#160; stops and when it restarts</p>
<p>I don't have any file killpower ?</p>
</blockquote>
<div>this one gets cleared (removed) when upsmon restarts.<br />
<br />
cheers,</div>
</div>
Arnaud<br />
-- <br />
Linux / Unix Expert R&amp;D - Eaton - <a href="http://powerquality.eaton.com">http://powerquality.eaton.com</a><br />
Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/</a><br />
Debian Developer - <a href="http://www.debian.org">http://www.debian.org</a><br />
Free Software Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a><br />
<br />
</blockquote><hr style="border:dotted 1px silver; width:90%; border:dotted 1px silver;"><p>Sabine GOUDARD&#160;- Informatique et Multimédia</p>
<p><strong>Ecole Nationale Supérieure  d’Architecture de Saint-Étienne</strong></p>
<p>1, rue Buisson BP 94 42003 Saint-Étienne Cedex 1</p>
<p>Tél.&#160;: 04 77 42 37 20 -  Fax&#160;: 04 77 42 35 40</p>
<p>sabine.goudard@st-etienne.archi.fr</p>