[Nut-upsuser] nut 2.4 et MGE 2200

sabine GOUDARD sabine.goudard at st-etienne.archi.fr
Tue Nov 30 13:48:23 UTC 2010


I add #!/bin/bash at the beginning of my script
my script is in /home/nut
the user nut is owner
I run my script with sh /home/nut/alert_ups

I try running upsmon in debug mode with "upsmon -DDD".
I have a denied permission when the file ups.log is created

I create it and I add nut owner

and all is OK

 

I'm going to continue my setteings
Thanks


PS : sorry for my bad english

Le 29/11/2010 16:51, Arnaud Quette a écrit :
Hi again Sabine,

first, please keep the list cc'ed


2010/11/29 sabine GOUDARD <[sabine.goudard at st-etienne.archi.fr>


 

2007 effectively ....



indeed, time passes too quickly!
 


 my script: very simple

if I run it manually I have no problem

# write to a specific log file
date=$(date +"%F %T")
echo "$date >> UPS ALERT, shutting down in a few seconds..." >>
/var/log/ups.log


is the above your complete script?
if so, you should really add a header like:
!#/bin/sh

don't forget that this will be run from a program, which may be different
that running from a shell.
next, how do you manually call your script? ie "sh myscript.sh" or simply
"./myscript.sh".
in other word, are the executable bits set?

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.
in this case, you should put it in a more neutral location, like
/usr/local/bin.

to get the exact issue, try running upsmon in debug mode (after having
stopped it), using "upsmon -DDD".
and generate a power failure. have a look at the same time at upsmon output
to see what's going on...
my guess is that it will be solved by either of the above fix (location,
exec bits, header line for interpreter declaration)


I have restart upsmon after each modification in upsmon.conf

 

I also have question about

POWERDOWNFLAG /etc/killpower

When UPS is on LB, it stops and when it restarts

I don't have any file killpower ?


this one gets cleared (removed) when upsmon restarts.

cheers,

Arnaud
-- 
Linux / Unix Expert R+D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/ ->
mailto:sabine.goudard at st-etienne.archi.fr]


-- 

Sabine GOUDARD - Informatique et Multimédia

Ecole Nationale Supérieure d’Architecture de Saint-Étienne

1, rue Buisson BP 94 42003 Saint-Étienne Cedex 1

Tél. : 04 77 42 37 20 - Fax : 04 77 42 35 40

sabine.goudard at st-etienne.archi.fr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20101130/4e075c80/attachment.htm>


More information about the Nut-upsuser mailing list