NUT running two instances!

Hi all

I’m hoping some one might be able to help me with this.
When checking the status of my UPS via the command line I get an error of “A previous upsmon instance is already running!
Either stop the previous instance first, or use the ‘reload’ command.”.

After trying to dig a bit further it looks as though for some reson the service is running twice… I think.

[root@stratus ~]# ps aux | grep upsmon
root      4517  0.0  0.0   9816  2540 ?        Ss   16:25   0:00 /usr/sbin/upsmon
root      4518  0.0  0.0  10344  6528 ?        S    16:25   0:00 /usr/sbin/upsmon
root      4699  0.0  0.0   6656  2476 pts/0    S+   16:26   0:00 grep upsmon

So far I have tried stopping the service and removing the pid file in /var/run/upsmon.pid of which there is only one file relating to upsmon. Restarting the service just gives the same error. I have also done this again then removed nut via pakfire and rebooted. Re-installed and got the same issue.

upsmon.conf

RUN_AS_USER root

MONITOR apc-1500@localhost 1 admin w1Ntep82 master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
NOTIFYCMD /usr/sbin/upssched
POLLFREQ 2
POLLFREQALERT 1
HOSTSYNC 15
DEADTIME 15
FINALDELAY 5
POWERDOWNFLAG /etc/killpower

NOTIFYMSG ONLINE    "UPS %s on line power"
NOTIFYMSG ONBATT    "UPS %s on battery, Prepare for Shut Down!"
NOTIFYMSG LOWBATT   "UPS %s battery is low, that shit is going down MOFO"
NOTIFYMSG FSD       "UPS %s: forced shutdown in progress, coz your MUM"
NOTIFYMSG COMMOK    "Communications with UPS %s established WOP WOP!"
NOTIFYMSG COMMBAD   "Communications with UPS %s lost, gone, missing, dead, over, broken"
NOTIFYMSG SHUTDOWN  "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT  "UPS %s battery needs to be replaced its gone shit!"
NOTIFYMSG NOCOMM    "UPS %s is unavailable"
NOTIFYMSG NOPARENT  "upsmon parent process died - shutdown impossible"

NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL

RBWARNTIME 43200

NOCOMMWARNTIME 600

FINALDELAY 5

upsd.conf

LISTEN 127.0.0.1 3493
LISTEN 192.168.15.1

Any idea’s on how I can fix this would be greatly appreciated.

Thanks in advance

try removing the Port 3493 for localhost from upsd.conf

this is the default Port and seems not neccesary following this site

after stopping the Service via GUI did you killed all upsmon instances via CLI? before restarting?

thank you for your reply.
I’m not sure there ever was an issue any more as all has been working.
My problem I think was that I was using the wrong command to check the UPS from the command line.

1 Like