Linux - nutups problem?

Kasyx

Expert Member
Joined
Jun 6, 2006
Messages
2,565
Reaction score
1
Location
127.0.0.1
I am trying to install nutups on a machine for the UPS, I think I have configured everything correctly but when I attempt to run it I get this:

Code:
mail:~ # /etc/init.d/upsd start
Starting NUT UPS drivers                                              skipped
Starting NUT UPS server                                               done
Starting NUT UPS monitor                                              done

(shortly after)
Broadcast Message from upsd@mail
        (somewhere) at 11:07 ...

UPS myups@localhost is unavailable

and then if I tail /var/log/messages, I see this:

Code:
Feb  7 10:59:28 mail upsmon[9416]: Poll UPS [myups@localhost] failed - Write error: Bad file descriptor
Feb  7 10:59:33 mail upsd[9412]: Rejecting TCP connection from 192.168.0.1
Feb  7 10:59:33 mail upsmon[9416]: Set username on [myups@localhost] failed: Server disconnected

My ups.conf is as follows:

Code:
[myups]
#       driver = mge-utalk
        driver = newmge-shut
#       driver = mge-shut
        port = /dev/ttyS3
        desc = "Local UPS"

My upsd.conf:

Code:
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACCEPT localhost
ACCEPT all
LISTEN 0.0.0.0 3493

If anyone can see anything wrong with that, please let me know. Sorry about the heinous amount of info but I really need to sort this out.
 
Code:
Feb  7 10:59:28 mail upsmon[9416]: Poll UPS [myups@localhost] failed - Write error: Bad file descriptor
Feb  7 10:59:33 mail upsd[9412]: Rejecting TCP connection from 192.168.0.1
Feb  7 10:59:33 mail upsmon[9416]: Set username on [myups@localhost] failed: Server disconnected

My upsd.conf:
Code:
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACCEPT localhost
ACCEPT all
LISTEN 0.0.0.0 3493

If anyone can see anything wrong with that, please let me know. Sorry about the heinous amount of info but I really need to sort this out.

I think the problem is that you're not accepting any connections from 192.168.0.1 in upsd.conf. If the UPS is physically on the same box, and judging by your ups.conf it is, rather stick with localhost with upsmon.conf, e.g.

Code:
MONITOR myups@localhost 1 myups leetpasswd master

Hmm, you haven't gone and defined localhost as something other than 127.0.0.1 in /etc/hosts have you?
 
Nope, 127.0.0.1 is indeed still localhost :D

Thanks for the help, I will give this a try and see if it continues to break or not :)
 
upsd.users:
Code:
[admin]
        password = leetpasswd
        allowfrom = localhost 192.168.0.1
        actions = SET
        instcmds = ALL
        upsmon master

[monuser]
        password = leetpasswd
        allowfrom = localhost 192.168.0.1
        upsmon master

Here is the upsmon.conf file. It already has the line you gave me in it:
Code:
MONITOR myups@localhost 1 admin leetpasswd master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
NOTIFYCMD /usr/lib/powersave/powersave-notify
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
NOTIFYFLAG ONLINE   SYSLOG
NOTIFYFLAG COMMOK   SYSLOG
NOTIFYFLAG SHUTDOWN SYSLOG
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL+EXEC
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
RBWARNTIME 43200
NOCOMMWARNTIME 300

Unfortunately, I have never actually worked with nutups before, and I am just trying to hack my way through this, hoping to figure it out as I go along... :D Any help would be greatly appreciated.
 
Right, being the idiot that I am, I have messed around with stuff. Mainly, it seems, the ownership of the /etc/ups/ folder :(
Now, I think I broke it.
When attempting to run the upsd as a service, I get this:

Code:
mail:/etc/ups # service upsd start
Starting NUT UPS drivers                                              done
Starting NUT UPS server startproc:  exit status of parent of /usr/sbin/upsd: 1
                                                                      failed

:(

When attempting to run the upsd manually, I get:

Code:
mail:/etc/ups # upsd
Network UPS Tools upsd 2.2.0-
listening on 0.0.0.0 port 3493
Can't open /etc/ups/ups.conf: Can't open /etc/ups/ups.conf: Permission denied

Here is a copy of ls -lah on the /etc/ups dir:
Code:
drw-------   2 root   root   4.0K Feb  5 14:48 .
drwxr-xr-x 119 root   root    12K Feb  8 10:13 ..
-r--------   1 nutups nut    3.7K Feb  6 16:47 ups.conf
-r--------   1 nutups nut    2.0K Feb  7 08:34 upsd.conf
-r--------   1 nutups nut    2.4K Feb  8 09:49 upsd.users
-r--------   1 root   daemon  12K Feb  8 09:59 upsmon.conf
-r--------   1 root   root   3.9K Nov 22 05:55 upssched.conf

Help?
 
Top
Sign up to the MyBroadband newsletter
X