You are not logged in.
Been using Arch for about 24hrs now (It replaced RHEL5 which was running for 18mths) and I'm very impressed. Have found it very good for a new user, the extensive wiki's have been a huge help to get things going. Under RHEL I really needed to do a lot of google searching to get things working but have only had to do it twice for the same build under Arch. I was able to fix the first issue (wTorrent wiki missed install of php-sqlite) and now network-ups-tools.
I had it working 100% under RHEL so its not a device/hardware issue that I can see. But under Arch I keep getting connection lost messages after starting the ups daemon.
System can see a USB device
[root@fiorano ~]# lsusb
Bus 005 Device 002: ID 0592:0002 Powerware Corp. UPS (X-Slot)
[root@fiorano ~]# ls -l /dev/bus/usb/005/002
crw-rw-r-- 1 root nut 189, 513 Jan 3 16:44 /dev/bus/usb/005/002
Config files:
# nut.conf
MODE = standalone
# ups.conf
[myups]
driver = bcmxcp_usb
port = auto
desc = "Powerwave 5110"
# upsd.conf
no changes
# upsd.users
[monmaster]
password = 1
allowfrom = localhost
upsmon master
instcmds = ALL
# upsmon.conf
DEADTIME 15
FINALDELAY 5
HOSTSYNC 15
MINSUPPLIES 1
MONITOR myups@localhost 1 monmaster 1 master
NOCOMMWARNTIME 300
POLLFREQ 5
POLLFREQALERT 5
POWERDOWNFLAG /etc/killpower
RBWARNTIME 43200
SHUTDOWNCMD "/sbin/shutdown -h +0"
# upssched.conf
CMDSCRIPT /usr/local/ups/bin/upssched-cmd
# /etc/udev/rules.d/52-nut-usbups.rules
# various models - bcmxcp_usb
SYSFS{idVendor}=="0592", SYSFS{idProduct}=="0002", MODE="664", GROUP="nut"
I can communicate with the UPS and the process is being performed by the nut user so udev rules file is ok
[root@fiorano ups]# bcmxcp_usb -D -a myups
Network UPS Tools - BCMXCP UPS driver 0.21 (2.4.1)
USB communication subdriver 0.17
debug level is '1'
Shutdown delay longer than battery capacity when Low Battery warning is given. (max 60 seconds)
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
nut 1608 0.0 0.0 1800 788 pts/0 S+ 17:09 0:00 bcmxcp_usb -D -a myups
This time with more debug data....
[root@fiorano ups]# bcmxcp_usb -DDDDD -a myups
Network UPS Tools - BCMXCP UPS driver 0.21 (2.4.1)
USB communication subdriver 0.17
send_to_all: SETINFO driver.parameter.port "auto"
debug level is '5'
send_to_all: SETINFO ups.firmware "Cont:00.50 Inve:01.50"
send_to_all: SETINFO ups.power.nominal "700"
send_to_all: SETINFO output.phases "1"
send_to_all: SETINFO ups.model "POWERWARE UPS 700VA"
Length of meter map: 92
Index Offset Format NUT
0027 0000 51 output.frequency
0028 0004 51 input.frequency
0033 0008 51 battery.voltage
0041 0012 f0 None
0043 0016 f0 battery.charge.low
0047 0020 f0 None
0056 0024 f0 input.voltage
0065 0028 51 output.current
0068 0032 51 output.current.nominal
0078 0036 f0 output.voltage
Length of alarm map: 24
Index Alarm Supported
-001 INVERTER_AC_OVER_VOLTAGE No
-001 INVERTER_AC_UNDER_VOLTAGE No
-001 INVERTER_OVER_OR_UNDER_FREQ No
-001 BYPASS_AC_OVER_VOLTAGE No
-001 BYPASS_AC_UNDER_VOLTAGE No
-001 BYPASS_OVER_OR_UNDER_FREQ No
0000 INPUT_AC_OVER_VOLTAGE Yes
0001 INPUT_AC_UNDER_VOLTAGE Yes
0002 INPUT_UNDER_OR_OVER_FREQ Yes
-001 OUTPUT_OVER_VOLTAGE No
-001 OUTPUT_UNDER_VOLTAGE No
-001 OUTPUT_UNDER_OR_OVER_FREQ No
-001 REMOTE_EMERGENCY_PWR_OFF No
-001 REMOTE_GO_TO_BYPASS No
-001 BUILDING_ALARM_6 No
-001 BUILDING_ALARM_5 No
-001 BUILDING_ALARM_4 No
-001 BUILDING_ALARM_3 No
-001 BUILDING_ALARM_2 No
-001 BUILDING_ALARM_1 No
-001 STATIC_SWITCH_OVER_TEMP No
-001 CHARGER_OVER_TEMP No
-001 CHARGER_LOGIC_PWR_FAIL No
-001 CHARGER_OVER_VOLTAGE_OR_CURRENT No
-001 INVERTER_OVER_TEMP No
0003 OUTPUT_OVERLOAD Yes
-001 RECTIFIER_INPUT_OVER_CURRENT No
-001 INVERTER_OUTPUT_OVER_CURRENT No
-001 DC_LINK_OVER_VOLTAGE No
-001 DC_LINK_UNDER_VOLTAGE No
-001 RECTIFIER_FAILED No
-001 INVERTER_FAULT No
-001 BATTERY_CONNECTOR_FAIL No
-001 BYPASS_BREAKER_FAIL No
-001 CHARGER_FAIL No
-001 RAMP_UP_FAILED No
-001 STATIC_SWITCH_FAILED No
-001 ANALOG_AD_REF_FAIL No
-001 BYPASS_UNCALIBRATED No
-001 RECTIFIER_UNCALIBRATED No
-001 OUTPUT_UNCALIBRATED No
-001 INVERTER_UNCALIBRATED No
-001 DC_VOLT_UNCALIBRATED No
-001 OUTPUT_CURRENT_UNCALIBRATED No
-001 RECTIFIER_CURRENT_UNCALIBRATED No
-001 BATTERY_CURRENT_UNCALIBRATED No
-001 INVERTER_ON_OFF_STAT_FAIL No
-001 BATTERY_CURRENT_LIMIT No
-001 INVERTER_STARTUP_FAIL No
-001 ANALOG_BOARD_AD_STAT_FAIL No
-001 OUTPUT_CURRENT_OVER_100 No
-001 BATTERY_GROUND_FAULT No
-001 WAITING_FOR_CHARGER_SYNC No
-001 NV_RAM_FAIL No
-001 ANALOG_BOARD_AD_TIMEOUT No
0004 SHUTDOWN_IMMINENT Yes
0005 BATTERY_LOW Yes
0006 UTILITY_FAIL Yes
0007 OUTPUT_SHORT_CIRCUIT Yes
0008 UTILITY_NOT_PRESENT Yes
-001 FULL_TIME_CHARGING No
-001 FAST_BYPASS_COMMAND No
-001 AD_ERROR No
-001 INTERNAL_COM_FAIL No
-001 RECTIFIER_SELFTEST_FAIL No
-001 RECTIFIER_EEPROM_FAIL No
-001 RECTIFIER_EPROM_FAIL No
-001 INPUT_LINE_VOLTAGE_LOSS No
-001 BATTERY_DC_OVER_VOLTAGE No
-001 POWER_SUPPLY_OVER_TEMP No
-001 POWER_SUPPLY_FAIL No
-001 POWER_SUPPLY_5V_FAIL No
-001 POWER_SUPPLY_12V_FAIL No
-001 HEATSINK_OVER_TEMP No
-001 HEATSINK_TEMP_SENSOR_FAIL No
-001 RECTIFIER_CURRENT_OVER_125 No
-001 RECTIFIER_FAULT_INTERRUPT_FAIL No
-001 RECTIFIER_POWER_CAPASITOR_FAIL No
-001 INVERTER_PROGRAM_STACK_ERROR No
-001 INVERTER_BOARD_SELFTEST_FAIL No
-001 INVERTER_AD_SELFTEST_FAIL No
-001 INVERTER_RAM_SELFTEST_FAIL No
-001 NV_MEMORY_CHECKSUM_FAIL No
-001 PROGRAM_CHECKSUM_FAIL No
-001 INVERTER_CPU_SELFTEST_FAIL No
-001 NETWORK_NOT_RESPONDING No
-001 FRONT_PANEL_SELFTEST_FAIL No
-001 NODE_EEPROM_VERIFICATION_ERROR No
-001 OUTPUT_AC_OVER_VOLT_TEST_FAIL No
-001 OUTPUT_DC_OVER_VOLTAGE No
-001 INPUT_PHASE_ROTATION_ERROR No
-001 INVERTER_RAMP_UP_TEST_FAILED No
-001 INVERTER_OFF_COMMAND No
-001 INVERTER_ON_COMMAND No
-001 TO_BYPASS_COMMAND No
-001 FROM_BYPASS_COMMAND No
-001 AUTO_MODE_COMMAND No
-001 EMERGENCY_SHUTDOWN_COMMAND No
-001 SETUP_SWITCH_OPEN No
-001 INVERTER_OVER_VOLT_INT No
-001 INVERTER_UNDER_VOLT_INT No
-001 ABSOLUTE_DCOV_ACOV No
-001 PHASE_A_CURRENT_LIMIT No
-001 PHASE_B_CURRENT_LIMIT No
-001 PHASE_C_CURRENT_LIMIT No
-001 BYPASS_NOT_AVAILABLE No
-001 RECTIFIER_BREAKER_OPEN No
-001 BATTERY_CONTACTOR_OPEN No
-001 INVERTER_CONTACTOR_OPEN No
-001 BYPASS_BREAKER_OPEN No
-001 INV_BOARD_ACOV_INT_TEST_FAIL No
-001 INVERTER_OVER_TEMP_TRIP No
-001 INV_BOARD_ACUV_INT_TEST_FAIL No
-001 INVERTER_VOLTAGE_FEEDBACK_ERROR No
-001 DC_UNDER_VOLTAGE_TIMEOUT No
-001 AC_UNDER_VOLTAGE_TIMEOUT No
-001 DC_UNDER_VOLTAGE_WHILE_CHARGE No
-001 INVERTER_VOLTAGE_BIAS_ERROR No
-001 RECTIFIER_PHASE_ROTATION No
-001 BYPASS_PHASER_ROTATION No
-001 SYSTEM_INTERFACE_BOARD_FAIL No
-001 PARALLEL_BOARD_FAIL No
-001 LOST_LOAD_SHARING_PHASE_A No
-001 LOST_LOAD_SHARING_PHASE_B No
-001 LOST_LOAD_SHARING_PHASE_C No
-001 DC_OVER_VOLTAGE_TIMEOUT No
-001 BATTERY_TOTALLY_DISCHARGED No
-001 INVERTER_PHASE_BIAS_ERROR No
-001 INVERTER_VOLTAGE_BIAS_ERROR_2 No
-001 DC_LINK_BLEED_COMPLETE No
-001 LARGE_CHARGER_INPUT_CURRENT No
-001 INV_VOLT_TOO_LOW_FOR_RAMP_LEVEL No
-001 LOSS_OF_REDUNDANCY No
-001 LOSS_OF_SYNC_BUS No
-001 RECTIFIER_BREAKER_SHUNT_TRIP No
-001 LOSS_OF_CHARGER_SYNC No
-001 INVERTER_LOW_LEVEL_TEST_TIMEOUT No
-001 OUTPUT_BREAKER_OPEN No
-001 CONTROL_POWER_ON No
-001 INVERTER_ON No
-001 CHARGER_ON No
-001 BYPASS_ON No
-001 BYPASS_POWER_LOSS No
-001 ON_MANUAL_BYPASS No
-001 BYPASS_MANUAL_TURN_OFF No
-001 INVERTER_BLEEDING_DC_LINK_VOLT No
-001 CPU_ISR_ERROR No
-001 SYSTEM_ISR_RESTART No
-001 PARALLEL_DC No
-001 BATTERY_NEEDS_SERVICE No
-001 BATTERY_CHARGING No
-001 BATTERY_NOT_CHARGED No
-001 DISABLED_BATTERY_TIME No
-001 SERIES_7000_ENABLE No
-001 OTHER_UPS_ON No
-001 PARALLEL_INVERTER No
-001 UPS_IN_PARALLEL No
-001 OUTPUT_BREAKER_REALY_FAIL No
-001 CONTROL_POWER_OFF No
-001 LEVEL_2_OVERLOAD_PHASE_A No
-001 LEVEL_2_OVERLOAD_PHASE_B No
-001 LEVEL_2_OVERLOAD_PHASE_C No
-001 LEVEL_3_OVERLOAD_PHASE_A No
-001 LEVEL_3_OVERLOAD_PHASE_B No
-001 LEVEL_3_OVERLOAD_PHASE_C No
-001 LEVEL_4_OVERLOAD_PHASE_A No
-001 LEVEL_4_OVERLOAD_PHASE_B No
-001 LEVEL_4_OVERLOAD_PHASE_C No
0009 UPS_ON_BATTERY Yes
-001 UPS_ON_BYPASS No
-001 LOAD_DUMPED No
-001 LOAD_ON_INVERTER No
-001 UPS_ON_COMMAND No
-001 UPS_OFF_COMMAND No
-001 LOW_BATTERY_SHUTDOWN No
-001 AUTO_ON_ENABLED No
-001 SOFTWARE_INCOMPABILITY_DETECTED No
-001 INVERTER_TEMP_SENSOR_FAILED No
-001 DC_START_OCCURED No
-001 IN_PARALLEL_OPERATION No
-001 SYNCING_TO_BYPASS No
-001 RAMPING_UPS_UP No
-001 INVERTER_ON_DELAY No
-001 CHARGER_ON_DELAY No
-001 WAITING_FOR_UTIL_INPUT No
-001 CLOSE_BYPASS_BREAKER No
-001 TEMPORARY_BYPASS_OPERATION No
-001 SYNCING_TO_OUTPUT No
-001 BYPASS_FAILURE No
-001 AUTO_OFF_COMMAND_EXECUTED No
-001 AUTO_ON_COMMAND_EXECUTED No
0010 BATTERY_TEST_FAILED Yes
Lengt of Config_block: 64
Length of statistics map: 0
Lengt of command list: 22
Lengt of outlet_block: 0
Lengt of alarm_block: 11
send_to_all: SETINFO output.voltage.nominal "240"
send_to_all: SETINFO ups.serial ""
send_to_all: SETINFO input.voltage.nominal "240"
send_to_all: SETINFO input.frequency.nominal "50"
send_to_all: SETINFO input.frequency.low "45"
send_to_all: SETINFO input.frequency.high "55"
send_to_all: SETINFO input.transfer.boost.high "216"
send_to_all: SETINFO input.transfer.trim.low "260"
Shutdown delay longer than battery capacity when Low Battery warning is given. (max 60 seconds)
send_to_all: SETINFO ups.beeper.status "enabled"
send_to_all: SETINFO input.transfer.low "186"
send_to_all: SETINFO input.transfer.high "280"
send_to_all: SETINFO ambient.temperature.high "1"
send_to_all: ADDCMD shutdown.return
send_to_all: ADDCMD shutdown.stayoff
send_to_all: ADDCMD test.battery.start
send_to_all: SETINFO output.frequency " 49.9"
send_to_all: SETINFO input.frequency " 49.9"
send_to_all: SETINFO battery.voltage " 13.5"
send_to_all: SETINFO battery.charge.low "11"
send_to_all: SETINFO input.voltage "234"
send_to_all: SETINFO output.current " 0.3"
send_to_all: SETINFO output.current.nominal " 1.8"
send_to_all: SETINFO output.voltage "234"
send_to_all: SETINFO ups.load " 16.7"
send_to_all: SETINFO ups.status "OL"
send_to_all: DATAOK
dstate_init: sock /var/state/ups/bcmxcp_usb-myups open on fd 5
send_to_all: SETINFO driver.version "2.4.1"
send_to_all: SETINFO driver.version.internal "0.21"
send_to_all: SETINFO driver.name "bcmxcp_usb"
send_to_all: SETINFO driver.parameter.pollinterval "2"
send_to_all: SETINFO input.voltage "236"
send_to_all: SETINFO output.voltage "236"
send_to_all: SETINFO battery.voltage " 13.7"
send_to_all: SETINFO input.voltage "234"
send_to_all: SETINFO output.voltage "234"
send_to_all: SETINFO input.voltage "236"
send_to_all: SETINFO output.voltage "236"
^CSignal 2: exiting
But starting the daemon and things fail...
:: Starting UPSd Daemon [DONE]
[root@fiorano ups]#
Broadcast message from nut (Sun Jan 3 17:24:55 2010):
Communications with UPS myups@localhost lost
Broadcast message from nut (Sun Jan 3 17:25:00 2010):
UPS myups@localhost is unavailable
Here are my daemon and message logs, showing a comms issue with the UPS but I am using the exact same settings as my previous OS build?
[root@fiorano ~]# tail -f /var/log/messages.log
Jan 3 17:24:55 fiorano bcmxcp_usb[1730]: Startup successful
Jan 3 17:24:55 fiorano upsd[1731]: listening on 127.0.0.1 port 3493
Jan 3 17:24:55 fiorano upsmon[1735]: Startup successful
Jan 3 17:24:55 fiorano upsmon[1737]: Communications with UPS myups@localhost lost
Jan 3 17:24:55 fiorano wall[1739]: wall: user nut broadcasted 1 lines (46 chars)
Jan 3 17:25:00 fiorano upsmon[1737]: UPS myups@localhost is unavailable
Jan 3 17:25:00 fiorano wall[1742]: wall: user nut broadcasted 1 lines (36 chars)
[root@fiorano ~]# tail -f /var/log/daemon.log
Jan 3 17:24:55 fiorano bcmxcp_usb[1730]: Startup successful
Jan 3 17:24:55 fiorano upsd[1731]: listening on 127.0.0.1 port 3493
Jan 3 17:24:55 fiorano upsd[1731]: not listening on ::1 port 3493
Jan 3 17:24:55 fiorano upsmon[1735]: Startup successful
Jan 3 17:24:55 fiorano upsmon[1737]: UPS [myups@localhost]: connect failed: Connection failure: Connection refused
Jan 3 17:24:55 fiorano upsmon[1737]: Communications with UPS myups@localhost lost
Jan 3 17:25:00 fiorano upsmon[1737]: UPS [myups@localhost]: connect failed: Connection failure: Connection refused
Jan 3 17:25:00 fiorano upsmon[1737]: UPS myups@localhost is unavailable
Jan 3 17:25:05 fiorano upsmon[1737]: UPS [myups@localhost]: connect failed: Connection failure: Connection refused
Jan 3 17:25:10 fiorano upsmon[1737]: UPS [myups@localhost]: connect failed: Connection failure: Connection refused
Jan 3 17:25:15 fiorano upsmon[1737]: UPS [myups@localhost]: connect failed: Connection failure: Connection refused
Hopefully someone can point me in the right direction to get this fixed. I did not install any packages manually, everything has been done via pacman (system is fully up to date as per the time of this post.)
Offline
Is your nut user in the nut group? If the daemon really runs as the user nut
crw-rw-r-- 1 root nut 189, 513 Jan 3 16:44 /dev/bus/usb/005/002 <= owned by root, can also be rw by users of the nut group, others can only read. I'm not an expert on this but it can be easy to forget to create and/or add a user to a group.
Just for debugging I guess you can try to address it without any alias, like 3493@127.0.0.1
No other ideas here.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Yeah the nut user and group exist and the user is part of the nut group.
nut:x:55:55::/var/state/ups:/bin/false
(55 is nut for both user and group)
Really hoping to resolve this as I have had a few times where I needed the UPS to safely shutdown the machine. Don't want to change OS again!!
Last edited by dave00 (2010-01-04 10:00:20)
Offline
I don't know what else to say, starting it as root seems to work, even though it later changes the effective user to nut.
If starting fine only as root seems to point to a permissions problem somewhere, the only other thing I see is /var/state/ups , is it mode 775?
Jan 3 17:24:55 fiorano upsd[1731]: not listening on ::1 port 3493
Also you may try to disable ipv6 if you are not using it, it shouldn't be the source of the problem but the less variables the better.
I have never setup anything like that so I can't be of much help. You can always install RHEL5 (or centos5 will do too I guess) and setup everything there and compare the relevant files for any differences, maybe it's something really small in config file that is preventing it from working. I would try to keep the config files as simple as possible until you can get it to work.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
That dir wasn't 755 so fixed it and started the daemon. No change.
[root@fiorano ~]# ls -la /var/state/ups/
total 8
drwxrwx--- 2 root nut 4096 Jan 3 18:45 .
drwxr-xr-x 3 root root 4096 Jan 3 15:28 ..
[root@fiorano ~]# chmod 755 /var/state/ups/
[root@fiorano ~]# ls -la /var/state/ups/
total 8
drwxr-xr-x 2 root nut 4096 Jan 3 18:45 .
drwxr-xr-x 3 root root 4096 Jan 3 15:28 ..
ipv6 is disabled, the daemon log just seems to highlight the fact that its not listening for ipv6.
[root@fiorano ~]# cat /etc/modprobe.d/modprobe.conf
#
# /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
#
# disable autoload of ipv6
alias net-pf-10 off
[root@fiorano ~]# lsmod | grep ipv6
[root@fiorano ~]#
I have a backup of all my etc files from the working RHEL box and everything matches except one file had the wrong path which i've fixed.
[root@fiorano ups]# vi upssched.conf
#CMDSCRIPT /usr/local/ups/bin/upssched-cmd
CMDSCRIPT /usr/bin/upssched-cmd
Still doesn't work.
Does the NUT user or group need to be modified to have access to the USB device?
Offline
Have tried everything I can think of and many more google searches without any success.
It is NOT a communication issue between the machine and UPS.
Starting the processes which are called in the rc.d script manually, the usb driver starts ok. upsd starts ok.
[root@fiorano ups]# /usr/bin/upsdrvctl start
Network UPS Tools - UPS driver controller 2.4.1
Network UPS Tools - BCMXCP UPS driver 0.21 (2.4.1)
USB communication subdriver 0.17
Shutdown delay longer than battery capacity when Low Battery warning is given. (max 60 seconds)
[root@fiorano ups]# /usr/sbin/upsd
Network UPS Tools upsd 2.4.1
/etc/ups/upsd.conf is world readable
listening on 127.0.0.1 port 3493
not listening on ::1 port 3493
But from there my authentication issue is apparent. I cannot pull any stats on the UPS, nor run upsmon
[root@fiorano ups]# upsc myups
Error: Connection failure: Connection refused
[root@fiorano ups]# /usr/sbin/upsmon
Network UPS Tools upsmon 2.4.1
UPS: myups@localhost (master) (power value 1)
Using power down flag file /etc/killpower
[root@fiorano ups]#
Broadcast message from nut (Tue Jan 5 21:50:08 2010):
Communications with UPS myups@localhost lost
Broadcast message from nut (Tue Jan 5 21:50:13 2010):
UPS myups@localhost is unavailable
BUT to prove the USB comms is ok, I issued the following:
[root@fiorano ups]# /usr/bin/upsdrvctl shutdown
Network UPS Tools - UPS driver controller 2.4.1
Network UPS Tools - BCMXCP UPS driver 0.21 (2.4.1)
USB communication subdriver 0.17
Initiating UPS shutdown
Going down in 120 sec
CLOSING
Thinking it wouldn't work...it did only realising when my server was offline.
So I don't think im that far of getting it working. I think it is file/group permissions with the nut user or something like that. I'd like to force it to all use root if possible to test but not sure how.
Offline
I think you should make it 775 and not 755, 755 means that root can read,write,execute and users in the nut group (which nut is a part of) can only read and execute, I'm not sure if that matters but if nut wants to write something there it can't and that may cause something to abort and seem like an authentication problem.
Can you post the script you call in /etc/rc.d to start/stop/restart the service? Maybe someone can spot a problem there.
As for starting things as another user I think you can use 'su user_name command arguments' or 'su - user_name command arguments' but in your case as the nut user doesn't have a login shell I guess the second option is not the correct one.
Maybe someone more experienced in debugging these kind of problems can help, I'm all out of ideas now.
Maybe you can google for a nice guide and forget about your config files for a moment and try something different and check if it works, then little by little adapt it until you get what you want, probably somewhere in between you will stumble upon the problem and hopefully find a solution.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
I think you should make it 775
Didn't help.
Can you post the script you call in /etc/rc.d to start/stop/restart the service? Maybe someone can spot a problem there.
Sure, it was put there by the package retrieved from the default repo by pacman as was everything else. All I did was modify a few files in /etc/ups so all user/permissions etc should be setup correctly by the package?
[root@fiorano ~]# less /etc/rc.d/upsd
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
PID=`pidof -o %PPID /usr/sbin/upsd`
case "$1" in
start)
stat_busy "Starting UPSd Daemon"
/usr/bin/upsdrvctl start &> /dev/null
[ -z "$PID" ] && /usr/sbin/upsd &>/dev/null
/usr/sbin/upsmon &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon upsd
stat_done
fi
;;
stop)
stat_busy "Stopping UPSd Daemon"
/usr/bin/upsdrvctl stop &> /dev/null
/usr/sbin/upsmon -c stop &> /dev/null
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon upsd
stat_done
fi
;;
restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
Maybe someone more experienced in debugging these kind of problems can help, I'm all out of ideas now.
Hopefully someone else stops by, but really appreciate your help. I'm sure its something small that I'm overlooking!
forget about your config files for a moment and try something different and check if it works
Things is, NUT is fairly simple to begin with, there is really only 3 items you need to get it to work that I can see. The UPS driver, upsd user and monitor line.
Offline
I will try to help you out with this as I have had these same issues recently.
The network-ups-tools package will install everything you need and will create the "nut" group and permissions for you.
nut.conf: dont even open this file - just leave it.
ups.conf: setup the ups name, driver, and port - thats it - yours looks good
upsd.users: setup your upsd user - JUST the username password and "master" settings - nothing else.
upsmon.conf: setup your "MONITOR" line - yours looks correct already.
What did it for me is that I *did not* create a separate user on the system for NUT. I just run it as myself (unprivilaged user) and added my own account to the "nut" group. Then I added the "upsd" daemon to the daemons list in rc.conf and rebooted the machine. Everything started fine and I had no issues.
After your machine starts up - log in and type "upsc" in the terminal and all your ups info should come up.
Hope that helps. I am just throwing this from the top of my head - so I apologize if I skimmed over something to quickly. Once I get home, I will post my config files up here for you if you like and explain things a bit better if needed.
Hope you get everythign working.
-J
This may not be the most secure way to do things but it worked well for me as I am the only user on my machine, I do not allow any incoming connections, and I am behind a firewall on my router.
Offline
What did it for me is that I *did not* create a separate user on the system for NUT. I just run it as myself (unprivilaged user) and added my own account to the "nut" group. Then I added the "upsd" daemon to the daemons list in rc.conf and rebooted the machine. Everything started fine and I had no issues.
Appreciate your help Jason. I have a nut user and group which was created by the package install. But not quite sure what you mean by "run it as myself (unprivilaged user)". I have added my normal user to the nut group, but what am I doing from here?
Offline
jason.blier wrote:What did it for me is that I *did not* create a separate user on the system for NUT. I just run it as myself (unprivilaged user) and added my own account to the "nut" group. Then I added the "upsd" daemon to the daemons list in rc.conf and rebooted the machine. Everything started fine and I had no issues.
Appreciate your help Jason. I have a nut user and group which was created by the package install. But not quite sure what you mean by "run it as myself (unprivilaged user)". I have added my normal user to the nut group, but what am I doing from here?
Sorry dave00,
What I meant to say was that I did not setup a login/shell account for NUT. I run upsmon with my user privilages.
Eg. I have 2 accounts on my machine - "root" and "jason". "jason" is my normal login account and that is what I use to run upsmon/NUT.
So, in your "upsmon.conf" - set the RUN_AS_USER varialbe to your normal login account and add that account to the "nut" group. Then you can add "upsd" to the daemons list in rc.conf and reboot the machine.
I will post my config files tomorrow morning for you to go through.
Offline
As promised:
ups.conf
[ups]
driver = bcmxcp_usb
port = auto
upsd.conf
LISTEN 127.0.0.1 3493
upsd.users
[monitor]
password = 1234
upsmon master
upsmon.conf
RUN_AS_USER jason
MONITOR ups@localhost 1 monitor 1234 master
MINSUPPLIES 1
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
notice the RUN_AS_USER variable is set to "jason" (my normal login account).
Also be sure to actually reboot the machine once you add yourself to the nut group and uspd to the daemons list.
Hope it works for you.
Offline
Also be sure to actually reboot the machine once you add yourself to the nut group and uspd to the daemons list.
Copied all your config except changed the user name to my normal user which is "media", added to the nut group, daemon list and rebooted...
Jan 25 23:15:43 fiorano bcmxcp_usb[1694]: Startup successful
Jan 25 23:15:43 fiorano upsd[1695]: /etc/ups/upsd.conf is world readable
Jan 25 23:15:43 fiorano upsd[1695]: listening on 127.0.0.1 port 3493
Jan 25 23:15:43 fiorano upsd[1695]: /var/state/ups is world readable
Jan 25 23:15:43 fiorano upsd[1695]: Connected to UPS [myups]: bcmxcp_usb-myups
Jan 25 23:15:43 fiorano upsd[1695]: /etc/ups/upsd.users is world readable
Jan 25 23:15:43 fiorano upsd[1696]: Startup successful
Jan 25 23:15:43 fiorano upsmon[1698]: Startup successful
Jan 25 23:15:48 fiorano upsmon[1700]: Communications with UPS ups@localhost lost
Jan 25 23:15:48 fiorano wall[1712]: wall: user media broadcasted 1 lines (44 chars)
Jan 25 23:15:53 fiorano upsmon[1700]: UPS ups@localhost is unavailable
Jan 25 23:15:53 fiorano wall[1715]: wall: user media broadcasted 1 lines (34 chars)
But I am now able to pull stats from the device which I couldn't before. No idea why it is still saying the comms lost with ups message?
[media@fiorano ~]$ upsc myups
ambient.temperature.high: 1
battery.charge.low: 11
battery.voltage: 13.5
driver.name: bcmxcp_usb
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.4.1
driver.version.internal: 0.21
input.frequency: 49.9
input.frequency.high: 55
input.frequency.low: 45
input.frequency.nominal: 50
input.transfer.boost.high: 216
input.transfer.high: 280
input.transfer.low: 186
input.transfer.trim.low: 260
input.voltage: 246
input.voltage.nominal: 240
output.current: 0.3
output.current.nominal: 1.8
output.frequency: 49.9
output.phases: 1
output.voltage: 246
output.voltage.nominal: 240
ups.beeper.status: enabled
ups.firmware: Cont:00.50 Inve:01.50
ups.load: 16.7
ups.model: POWERWARE UPS 700VA
ups.power.nominal: 700
ups.serial:
ups.status: OL
Thanks for your help Jason!! All I need to do now is work out why those upsmon unavail messages are showing and if the ambient.temperature.high value is a problem. never noticed that before moving the pc into another room!
Offline
Hey,
I just got nut running here.
I had this same follow on issue of upsmon saying it wasn't connecting, even after upsd was working and the upsc and upscmmd commands were providing output.
I had to add this to /etc/ups/upsd.users:
[upsuser]
password = userpass
allowfrom = localhost
upsmon master
Where "upsuser" and "userpass" match the entries on the MONITOR line in upsmon.conf
HTH...
android
Offline
Rebuilt my machine and got a replacement UPS (same model), using identical config to Jason above except running as nut user, no other changes were made on the system and I'm no longer getting the lost connection messages.
I did start getting a new error message in /var/log/daemon.log with or without the change suggested by android :
Jun 26 10:13:21 fiorano upsd[1913]: listening on 127.0.0.1 port 3493
Jun 26 10:13:21 fiorano upsd[1913]: Connected to UPS [ups]: bcmxcp_usb-ups
Jun 26 10:13:21 fiorano upsd[1913]: allowfrom in upsd.users is no longer used
Jun 26 10:13:21 fiorano upsd[1914]: Startup successful
Jun 26 10:13:21 fiorano upsmon[1916]: Startup successful
Jun 26 10:13:21 fiorano upsmon[1918]: Login on UPS [ups@localhost] failed - got [ERR ACCESS-DENIED]
I wasn't getting any errors on my upsc ups but google found an answer and as usual its always simple - hosts.allow for localhost! Adding the following, fixed the issue
# /etc/hosts.allow
#
ALL : localhost 127.0.0.1
Startup is now all ok.
Jun 26 10:23:17 fiorano upsd[1979]: Signal 15: exiting
Jun 26 10:23:20 fiorano upsd[2010]: listening on 127.0.0.1 port 3493
Jun 26 10:23:20 fiorano upsd[2010]: Connected to UPS [ups]: bcmxcp_usb-ups
Jun 26 10:23:20 fiorano upsd[2011]: Startup successful
Jun 26 10:23:20 fiorano upsmon[2013]: Startup successful
Jun 26 10:23:20 fiorano upsd[2011]: User monitor@127.0.0.1 logged into UPS [ups]
Just wanted to put this here in case someone else went searching for answers as my googling often ended up back on these forums
Last edited by dave00 (2010-06-26 00:26:43)
Offline