[Nut-upsuser] Master privileges unavailable

Marc Cuypers mozilla at mgvd.be
Thu Jan 12 08:23:32 UTC 2006


Hi Arnaud,

Arnaud Quette wrote:
> Hi Marc,
> 
> you seem to be facing several problems...
> 
> 2006/1/9, Marc Cuypers <mozilla at mgvd.be <mailto:mozilla at mgvd.be>>:
> 
>     Hi,
> 
>     I'm using debian sarge on my server and connected a MGE-ups ellipse via
>     the serial port.
> 
>     I searched the internet for the answer, but can't find it.
> 
>     My config files:
> 
>     <upsd.users>
>     [admin]
>        password = pwd
>        allowfrom = 127.0.0.1/32 <http://127.0.0.1/32>
>        actions = set
>        instcmds = all
> 
>     [upsmon]
>        password = pwd
>        allowfrom = 127.0.0.1/32 <http://127.0.0.1/32> 10.0.0.224/32
>     <http://10.0.0.224/32>
>        upsmon master
> 
>     [upsslave]
>        password = pwd
>        allowfrom = 10.0.0.223/32 <http://10.0.0.223/32>
>        upsmon slave
>     </upsd.users>
> 
>     <upsd.conf>
>     ACL localhost 127.0.0.1/32 <http://127.0.0.1/32>
>     ACL test2 10.0.0.223/32 <http://10.0.0.223/32>
> 
>     ACCEPT localhost test2
>     REJECT all
>     </upsd.conf>
> 
>     <upsmon.conf>
>     MONITOR mge at 127.0.0.1 <mailto:mge at 127.0.0.1> 1 admin pwd master
>     MINSUPPLIES 1
>     SHUTDOWNCMD "/sbin/shutdown -h +0"
>     NOTIFYCMD /etc/nut/notifyme_cmd.sh
>     NOTIFYFLAG ONLINE SYSLOG+EXEC
>     NOTIFYFLAG ONBATT SYSLOG+EXEC
>     NOTIFYFLAG LOWBATT SYSLOG+EXEC
>     NOTIFYFLAG FSD SYSLOG+EXEC
>     NOTIFYFLAG COMMOK SYSLOG+EXEC
>     NOTIFYFLAG COMMBAD SYSLOG
>     NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
>     NOTIFYFLAG REPLBATT SYSLOG+EXEC
>     NOTIFYFLAG NOCOMM SYSLOG+EXEC
>     RBWARNTIME 43200
>     NOCOMMWARNTIME 300
>     FINALDELAY 5
>     DEADTIME 15
>     HOSTSYNC 15
>     POLLFREQ 15
>     POLLFREQALERT 5
>     </upsmon.conf>
> 
>     I got two problems:
> 
>     1. Master privileges unavailable.
> 
>     Jan  9 16:53:15 localhost upsd[5066]: upsd.conf: invalid directive
>     MAXAGE=25
> 
> 
> though I don't see it in your above uspd.conf (maybe a too short 
> excerpt), there is a mismatch here.
> You should have "MAXAGE 25", ie not with the "=" char.
> 
>     Jan  9 16:53:15 localhost upsd[5066]: Connected to UPS [mge]:
>     mge-shut-ttyS1
>     Jan  9 16:53:19 localhost upsd[5067]: Startup successful
>     Jan  9 16:53:19 localhost upsmon[5069]: Startup successful
>     Jan  9 16:53:19 localhost upsd[5067]: Connection from 127.0.0.1
>     <http://127.0.0.1>
>     Jan  9 16:53:19 localhost upsd[5067]: Client admin at 127.0.0.1
>     <mailto:admin at 127.0.0.1> logged into
>     UPS [mge]
>     Jan  9 16:53:19 localhost upsmon[5070]: Master privileges unavailable on
>     UPS [mge at 127.0.0.1 <mailto:mge at 127.0.0.1>]
> 
> 
> now this one:
> as the above msg states, you need the master priv. to run upsmon.
> As you've defined 2 users, you have also used the wrong one.
> You should use the "[upsmon]" one which defines a "upsmon master".
> simply changing
>  MONITOR mge at 127.0.0.1 <mailto:mge at 127.0.0.1> 1 admin pwd master
> to
> MONITOR mge at 127.0.0.1 <mailto:mge at 127.0.0.1> 1 upsmon pwd master
> 
> will do the trick.
> 
>     Jan  9 16:53:19 localhost upsmon[5070]: Reason: Access denied
> 
>     What could be the problem?
Made the changes but still have the problem.
<syslog>
Jan 12 08:56:28 localhost mge-shut[13136]: Startup successful
Jan 12 08:56:28 localhost upsd[13137]: Connected to UPS [mge]: 
mge-shut-ttyS1
Jan 12 08:56:32 localhost upsd[13138]: Startup successful
Jan 12 08:56:32 localhost upsd[13138]: Connection from 10.0.0.223
Jan 12 08:56:32 localhost upsd[13138]: Client upsslave at 10.0.0.223 logged 
into UPS [mge]
Jan 12 08:56:32 localhost upsmon[13140]: Startup successful
Jan 12 08:56:32 localhost upsd[13138]: Connection from 127.0.0.1
Jan 12 08:56:32 localhost upsd[13138]: Client upsmon at 127.0.0.1 logged 
into UPS [mge]
Jan 12 08:56:32 localhost upsmon[13141]: Master privileges unavailable 
on UPS [mge at 127.0.0.1]
Jan 12 08:56:32 localhost upsmon[13141]: Reason: Access denied
</syslog>

My new config files are:

<upsd.users>
[admin]
   password = pwd
   allowfrom = 127.0.0.1/32
   actions = set
   instcmds = all

[upsmon]
   password = pwd
   allowfrom = 127.0.0.1/32 10.0.0.224/32
   upsmon master

[upsslave]
   password = pwd
   allowfrom = 10.0.0.223/32
   upsmon slave
</upsd.users>
<upsd.conf>
[admin]
   password = pwd
   allowfrom = 127.0.0.1/32
   actions = set
   instcmds = all

[upsmon]
   password = pwd
   allowfrom = 127.0.0.1/32 10.0.0.224/32
   upsmon master

[upsslave]
   password = pwd
   allowfrom = 10.0.0.223/32
   upsmon slave
</upsd.conf>

I started al services manually.
	upsdrvctl start
	upsd -D -D -D
	upsmon
upsd gave the following info when start upsmon on the localhost.
user_matchacl: failed.  What could be the problem?

<debug upsd>
acl_check: localhost: match 1
ACL [localhost] matches, action=1
Connection from 127.0.0.1
acl_check: localhost: match 1
ACL [localhost] matches, action=1
write: [destfd=7] [len=3] [OK
]
acl_check: localhost: match 1
ACL [localhost] matches, action=1
write: [destfd=7] [len=3] [OK
]
acl_check: localhost: match 1
ACL [localhost] matches, action=1
Client upsmon at 127.0.0.1 logged into UPS [mge]
write: [destfd=7] [len=3] [OK
]
acl_check: localhost: match 1
ACL [localhost] matches, action=1
user_matchacl: failed
write: [destfd=7] [len=18] [ERR ACCESS-DENIED
]
acl_check: localhost: match 0
acl_check: test2: match 1
ACL [test2] matches, action=1
write: [destfd=6] [len=29] [VAR mge ups.status "OL CHRG"
]
acl_check: localhost: match 0
acl_check: test2: match 1
ACL [test2] matches, action=1
write: [destfd=6] [len=29] [VAR mge ups.status "OL CHRG"
]
</debug upsd>

> 
>     2. I get mails that the ups is on battery and the next moment it is
>     online.  The electricity was never down.  What could be the problem?
> 
> 
> I've a Debian bug logged for that one, but I have not yet found the time 
> to reproduce it:
> See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=345362
> 
> I've made a quick test with 2.0.2 (the one shipped with Testing/Sid) on 
> an  Ellipse USBS (serial mode) and everything goes fine.
> So please, try to upgrade to these packages and report back if you still 
> face this issue.
> 
I haven't had the problem since, it seems to have vanished from itself. 
  I'll keep you posted.

BTW: are you coming to FOSDEM in Brussels in Februari?

-- 
Marc



More information about the Nut-upsuser mailing list