I have several MGE/Eaton uninterruptible power supply (UPS) units which work well with openSUSE 12.1, but this was not an out-of-the-box experience. This page describes the required setup.
There are two basic strategies for stopping a server when building power fails:
Since I live in a region with frequent short power outages, I choose the pessimist strategy, which is implemented in the UPS configuration files described in this page.
The configuration described by this page also works for openSUSE 11.2 and 11.3.

When I bought the UPS unit used for this test it was called MGE
(Merlin Gerin) Pulsar Ellipse ASR 1500 USBS
and had reference number
66781. After the confusing merger of MGE and Eaton and an even more
confusing re-assignment of the two companies' products, the unit is
now known as the Eaton Ellipse ASR 1500 USBS
but mercifully still
has the same reference number 66781, and is
still (2009-12-27) marketed.
Four of the eight sockets (the four at the back, visible in the picture) are battery protected. The four on top, not visible, just have surge protection. A custom cable with an RJ45 connector at the UPS end (not visible in the picture), plugs into a USB slot in the server. Read a summary of the features.
The software used is the GPL version 2 licenced Network UPS Tools (NUT) project version 2.4.1 which is distributed by openSUSE as an RPM package.
The configuration files are to be found in directory /etc/ups. Certain run-time files are in /var/lib/ups/upssched and there is a useful script at /usr/sbin.
| Permissions | Owner Group | Name | Purpose | Use |
|---|---|---|---|---|
| Files provided by NUT | ||||
| drwxr-xr-x | root root | /etc/ups | Directory | |
| -rw-r--r-- | root root | /etc/ups/hosts.conf | CGI programs | Not used |
| -rw-r--r-- | root root | /etc/ups/nut.conf | General | |
| -rw-r--r-- | root root | /etc/ups/ups.conf | Define UPSs | |
| -rw------- | upsd root | /etc/ups/upsd.conf | Access control | Use if no IPv6 |
| -rw------- | upsd root | /etc/ups/upsd.users | Network users | |
| -rw------- | upsd root | /etc/ups/upsmon.conf | Monitoring | |
| -rw-r--r-- | root root | /etc/ups/upssched.conf | Commands | |
| -rw-r--r-- | root root | /etc/ups/upsset.conf | Web access | Not used |
| drwx------ | upsd daemon | /var/lib/ups | Directory | |
| drwxr-xr-x | upsd daemon | /var/lib/ups/upssched | Directory | |
| -rwxr-xr-x | upsd daemon | /usr/sbin/upsd | Binary | |
| -rwxr-xr-x | upsd daemon | /usr/sbin/upsmon | Binary | |
| -rwxr-xr-x | upsd daemon | /usr/sbin/upssched | Binary | |
| -rwxr-xr-x | root root | /bin/upssched-cmd | Sample script | Not used |
| Custom script for NUT | ||||
| -rwxr-xr-- | upsd daemon | /usr/sbin/upssched-cmd | Pessimist strategy script |
|
| TCP wrapper files used by NUT | ||||
| -rw-r--r-- | root root | /etc/hosts.allow | TCP wrappers access control |
|
| -rw-r--r-- | root root | /etc/hosts.deny | TCP wrappers access control |
Not used |
The setup is for a simple configuration with one UPS providing protection for one server. There is no remote access and no web access. If remote access is needed, then the sysadmin has to use SSH to tunnel to the server to which the UPS is attached, and then use the commands available to the local administrator.
The sample configuration files provided by the NUT project contain detailed descriptions of the use of each file. Hint: make a copy of the /etc/ups directory before making changes. You will find further documentation at /usr/share/doc/packages/nut, and on the NUT project site.
The general section of the NUT configuration determines which part of the NUT is to be started.
The standalone mode calls for a local only configuration, with 1 UPS protecting the local system. This implies starting the 3 NUT layers (driver, upsd and upsmon) and the matching configuration files.
# /etc/ups/nut.conf MODE = standalone
Specify and name the UPS which will provide the protection.
# /etc/ups/ups.conf
# Make sure this matches in /usr/sbin/upssched-cmd
[Eaton-66781]
driver = usbhid-ups
port = auto
desc = "Eaton Ellipse ASR 1500 USBS"
vendorid = 0463
Specify which ports the upsd daemon will listen on. By default, openSUSE 12.1 enables IPv6 so specify:
# /etc/ups/upsd.conf # Make sure this matches the IPv6 setting in YaST -> Network Devices -> # Network Settings -> Global options -> IPv6 Protocol Settings # LISTEN <address> [<port>] LISTEN 127.0.0.1 3493 LISTEN ::1 3493
If you disenable IPv6 using YaST -> Network Devices -> Network Settings -> Global options -> IPv6 Protocol Settings, then specify only:
# /etc/ups/upsd.conf # LISTEN <address> [<port>] LISTEN 127.0.0.1 3493 # IPv6 turned off
Note: The logic of file upsd.conf is subtle. If no LISTEN addresses are specified in upsd.conf, the compiled in defaults are used. As soon as you specify one or more LISTEN directives, upsd will only listen to the specified addresses.
Thus if both IPv4 and IPv6 LISTEN directives are commented out
# /etc/ups/upsd.conf # LISTEN <address> [<port>] # LISTEN 127.0.0.1 3493 # LISTEN ::1 3493
then NUT listens to 127.0.0.1 and ::1 as shown by /var/log/messages
Nov 10 09:52:41 glacon2 usbhid-ups[15911]: Startup successful Nov 10 09:52:41 glacon2 upsd[15914]: listening on 127.0.0.1 port 3493 Nov 10 09:52:41 glacon2 upsd[15914]: listening on ::1 port 3493 Nov 10 09:52:41 glacon2 upsd[15914]: Connected to UPS [Eaton-66781]: usbhid-ups-Eaton-66781
But if only ::1 is commented out
# /etc/ups/upsd.conf # LISTEN <address> [<port>] LISTEN 127.0.0.1 3493 # LISTEN ::1 3493
then NUT only listens to 127.0.0.1
Nov 10 09:34:24 glacon usbhid-ups[4282]: Startup successful Nov 10 09:34:24 glacon upsd[4285]: listening on 127.0.0.1 port 3493 Nov 10 09:34:24 glacon upsd[4285]: Connected to UPS [Eaton-66781]: usbhid-ups-Eaton-66781
There are no network users, but we must still define a local user
who has access to the UPS monitoring. This will be needed for the
MONITOR declaration in upsmon.conf The value I use is
# upsd.users
[upsmaster]
password = sekret
upsmon master
You may want something better than sekret
as a password.
By default, upsmon splits into two processes. One stays as root
and waits to run the SHUTDOWNCMD. The other one switches to user
upsd
and does everything else. This file configures these two
processes. Here is a summary of the possible entries:
List the UPSs to be monitored, where
upsmasterwith password
sekret.
mastermeans this system will shutdown last, allowing the slaves time to shutdown first.
slavemeans this system shuts down immediately when power goes critical.
where prog is a program such as /usr/sbin/upssched which will react to the NOTIFY events that have EXEC set with NOTIFYFLAG. See NOTIFYFLAG below for more details.
Where n seconds is the polling interval.
Where n seconds is the polling interval while the UPS is on battery.
Where n seconds is the interval to wait before declaring a stale ups dead
.
The upsmon process will create a a file with this name when it's time to shut down the load. See the shutdown.txt file in the docs subdirectory for more information.
Specify messages sent by upsmon when certain events occur. For example
NOTIFYMSG ONLINE "UPS %s on line power"
Where %s is replaced with the identifier of the UPS in question, and message is ascii only, not even ISO Latin1. No accents.
| COMMBAD | Communications lost to the UPS |
| COMMOK | Communications established with the UPS |
| FSD | UPS is being shutdown by the master (FSD = "Forced Shutdown") |
| LOWBATT | UPS has a low battery (if also on battery, it's "critical") |
| NOCOMM | A UPS is unavailable (can't be contacted for monitoring) |
| NOPARENT | The process that shuts down the system has died (shutdown impossible) |
| ONBATT | UPS is on battery |
| ONLINE | UPS is back online |
| REPLBATT | The UPS battery is bad and needs to be replaced |
| SHUTDOWN | The system is being shutdown |
By default, upsmon sends walls (global messages to all logged-in users) and writes to the syslog when things happen. You can change this.
notifytype values are listed above.
| EXEC | Execute NOTIFYCMD (see above) with the message |
| IGNORE | Don't do anything, don't use any other flags on the same line. |
| SYSLOG | Write the message in the syslog |
| WALL | Write the message to all users on the system |
Where t seconds is the replace battery warning interval.
Where t seconds is the no communications warning time.
Where t seconds is the last sleep interval before shutting down the system.
Here, finally are the values I used:
# /etc/ups/upsmon.conf MONITOR Eaton-66781@localhost 1 upsmaster sekret master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" NOTIFYCMD /usr/sbin/upssched POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower # You can change the default messages to something else if you like. # NOTIFYMSG notifytype "message" NOTIFYMSG COMMBAD "UPS %s: Communications lost +++ Perdu contact avec l'onduleur." NOTIFYMSG COMMOK "UPS %s: Communications (re-)established +++ Onduleur retrouve'." NOTIFYMSG FSD "UPS %s: Forced shutdown in progress +++ Arret obligatoire en cours." NOTIFYMSG LOWBATT "UPS %s: Battery is low +++ Batterie se vide." NOTIFYMSG NOCOMM "UPS %s: Not available +++ Onduleur indisponible." NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible." NOTIFYMSG ONBATT "UPS %s: On battery +++ Onduleur sur batterie." NOTIFYMSG ONLINE "UPS %s: On line power +++ Onduleur sur secteur." NOTIFYMSG REPLBATT "UPS %s: Battery needs to be replaced +++ Batterie d'onduleur a` remplacer." NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding +++ Arret automatique en cours." # Note that %s is replaced with the identifier of the UPS in question. NOTIFYFLAG COMMBAD SYSLOG+EXEC NOTIFYFLAG COMMOK SYSLOG+EXEC NOTIFYFLAG FSD SYSLOG+WALL+EXEC NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC NOTIFYFLAG ONLINE SYSLOG+EXEC NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC NOTIFYFLAG SHUTDOWN SYSLOG+EXEC RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5
This file specifies the timer actions associated with the UPS events. It works in close cooperation with the script upssched-cmd.
Where the script scriptname gets called to invoke commands for timers that trigger. It is given a single argument - the timername in your AT ... START-TIMER definitions.
This must be defined *before* the first AT line. Otherwise the program will complain and exit without doing anything.
This sets the file name of the FIFO that will pass communications between processes to start and stop timers. This should be set to some path where normal users can't create the file, due to the possibility of symlinking and other evil.
Note: by default, upsmon will run upssched as whatever user you have defined with RUN_AS_USER in upsmon.conf. Make sure that user can create files and write to files in the path you use for PIPEFN and LOCKFN. My recommendation: create a special directory for upssched, make it owned by your upsmon user, then use it for both.
Required Declaration. upssched needs to be able to create this filename in order to avoid a race condition when two events are dispatched from upsmon at nearly the same time. This file will only exist briefly. It must not be created by any other process.
You should put this in the same directory as PIPEFN.
Define a handler for a specific event notifytype on UPS upsname. upsname can be the special value * to apply this handler to every possible value of upsname.
Run the command command via your CMDSCRIPT when it happens. Note: Any AT that matches both the notifytype and the upsname for the current event will be used.
Possible values for command
Declare and start a timer called timername that will trigger after interval seconds, calling your CMDSCRIPT with timername as the first argument.
Example: Start a timer that will execute when any UPS (*) has been gone 10 seconds
AT COMMBAD * START-TIMER upsgone 10
Cancel a running timer called timername, if possible. If the timer has passed then pass the optional argument [cmd] to CMDSCRIPT.
Example: If a specific UPS (myups@localhost) comes back online, then stop the timer before it triggers
AT COMMOK myups@localhost CANCEL-TIMER upsgone
Immediately pass command as an argument to CMDSCRIPT.
Example: If any UPS (*) reverts to utility power, then execute 'ups-back-on-line' via CMDSCRIPT.
AT ONLINE * EXECUTE ups-back-on-line
First, if you havn't already done so, as root you have to create direcory /var/lib/ups/upssched using commands:
mkdir /var/lib/ups/upssched chown upsd:daemon /var/lib/ups/upssched
Here, finally are the values I used for this configuration file:
# /etc/ups/upssched.conf # See also /usr/sbin/upssched-cmd CMDSCRIPT /usr/sbin/upssched-cmd PIPEFN /var/lib/ups/upssched/upssched.pipe LOCKFN /var/lib/ups/upssched/upssched.lock ## Give two minute warning #AT ONBATT * START-TIMER ups-on-battery-timer2 5 #AT ONBATT * START-TIMER ups-on-battery-timer3 65 #AT ONBATT * START-TIMER ups-on-battery-timer4 125 # Give one minute warning AT ONBATT * START-TIMER ups-on-battery-timer3 5 AT ONBATT * START-TIMER ups-on-battery-timer4 65 # Turn off timers if power comes back AT ONLINE * CANCEL-TIMER ups-on-battery-timer2 AT ONLINE * CANCEL-TIMER ups-on-battery-timer3 AT ONLINE * CANCEL-TIMER ups-on-battery-timer4 AT ONLINE * EXECUTE ups-back-on-line
upssched-cmd is a script for handling timer completion and other events. It works in close cooperation with the configuration file upssched.conf which specifies the timers. NUT provides a script /bin/upssched-cmd which is minimal and is not used in the configuration described here.
The script provided here is adapted from a complete script supplied
by MGE with the UPS when I bought it. The MGE script addressed
the optimist
strategy described in the
Introduction but the version given here
implements the pessimist
strategy.
I placed this script in the directory /usr/sbin to emphasize its nature. It's not an executable for the ordinary user. Although it isn't a binary file, it shouldn't be in /bin.
#!/bin/bash
# /usr/sbin/upssched-cmd
# Adapted from code supplied by MGE.
# See also /etc/ups/upssched.conf
# $1 is the name of the timer which has just expired.
# Debugging: Log all calls to this script
logger -t upssched-cmd Calling upssched-cmd $1
# Make sure this corresponds to declaration in /etc/ups/ups.conf
Ups="Eaton-66781@localhost"
# Messages to be put in front of the users
MSG0=$'Power back - shutdown cancelled. +++ Secteur de retour - arret abandonne.'
MSG2=$'Running on battery - possible shutdown in 2 minutes - save your work! \
+++ Sur batterie - arret possible en 2 minutes - sauvez votre travail!'
MSG3=$'Running on battery - probable shutdown in 1 minute - save your work now! \
+++ Sur batterie - arret en 1 minute - sauvez votre travail maintenant!'
# Where does openSUSE hide stuff?
statePath="/var/lib/ups/"
sbinPath="/usr/sbin/"
# Do not shutdown based on battery runtime or charge since
# the "quick shutdown" strategy does not rely on measuring
# the battery charge. All shutdowns are based on elapsed time.
case $1 in
# Handles shutdown timer criteria (when triggered,
# timer has expired, so immediately shutdown)
ups-on-battery-timer2)
logger -t upssched-cmd "Shutdown second warning"
echo $MSG2 | wall
;;
ups-on-battery-timer3)
logger -t upssched-cmd "Shutdown third warning"
echo $MSG3 | wall
;;
ups-on-battery-timer4)
logger -t upssched-cmd "Shutdown timer reached: Calling upsmon -c fsd"
${sbinPath}upsmon -c fsd
;;
ups-back-on-line)
logger -t upssched-cmd "ups_back-on-line: removing timers"
# Remove possible timers
/bin/rm -f ${statePath}ups-on-battery-timer2
/bin/rm -f ${statePath}ups-on-battery-timer3
/bin/rm -f ${statePath}ups-on-battery-timer4
logger -t upssched-cmd "UPS back on-line, timers removed"
echo $MSG0 | wall
;;
*)
logger -t upssched-cmd "Unrecognized command: $1"
;;
esac
NUT uses TCP-Wrappers to provide controlled access to the daemon upsd. Access control is applied to NUT clients specified in upsd.users. The TCP-Wrappers support is optional in NUT but is included in the openSUSE 12.1 packaging of NUT. NUT works directly with TCP-Wrappers and does not require the super-daemon inetd, which is not used by openSUSE 12.1.
Note: Unfortunately this means that the very useful wrapper test programs tcpdchk and tcpdmatch which assume that the inetd daemon is present are not available to test your configuration.
The two files hosts.allow and hosts.deny provide a powerful means of controlling access, providing precision of access control not available with firewalls. The mechanism is based on rules for what is allowed and what is to be denied. In my simple configuration I explicitly state for each rule whether it is an ALLOW rule or a DENY rule, and I place all the rules in the file hosts.allow. I have no hosts.deny file; since I rename the example provided by SuSE.
The rules have two forms, basic and debugging:
where
localhost, LOCAL, 127.0.0.1, [::1]
Note that the IPv6 address of the local host is placed in square brackets.
where
localhost, LOCAL, 127.0.0.1, [::1]
spawn (/bin/mail -r hosts.allow@localhost\
-s '%s@%h (bigserver) refused access to %d from %c'\
sysadmin@localhost) &
Where you replace bigserver
and sysadmin
by your own values.
If the TCP-Wrappers access control rejects the access to upsd, you will receive an e-mail with a subject line such as "upsd@::1 (glacon2) refused access to upsd from upsmaster@::1". I got this message because I forgot to include [::1] in the client_list.
Finally, here are the relevant parts of my /etc/hosts.allow
# /etc/hosts.allow
# 2010-10-03 Roger Price
# Notes:
# 1. See `man tcpd', `man -S5 hosts_access' and `man -S5 hosts_options'
# for a detailed description of /etc/hosts.allow and /etc/hosts.deny.
# 2. This file contains both the authorisations and the denials.
# The option ALLOW or DENY is explicit on each rule.
# 3. The file hosts.deny is no longer used.
...
upsd : localhost, LOCAL, 127.0.0.1, [::1] : ALLOW
upsd : ALL : spawn (/bin/mail -r hosts.allow@localhost\
-s '%s@%h (glacon2) refused access to %d from %c'\
roger@localhost) & : DENY
...
# And now the denials which previously appeared in /etc/hosts.deny
#
ALL : ALL : DENY
See man tcpd
, man -S5 hosts_access
for a detailed
description of hosts.allow and hosts.deny. See
also man -S5 hosts_options
for additional options to the rules.
This file is not used and is not present in my configuration. All denials are specified in hosts.allow.
Bus 003 Device 002: ID 0463:ffff MGE UPS Systems UPS
sandrane:~ # rcupsd status Checking for service NUT UPS server unused Checking for service NUT UPS monitor unused sandrane:~ # rcupsd start Starting NUT UPS drivers done Starting NUT UPS server done Starting NUT UPS monitor done sandrane:~ # rcupsd status Checking for service NUT UPS server running Checking for service NUT UPS monitor running
The following entries appear in /var/log/messages
Dec 29 01:05:00 sandrane usbhid-ups[5510]: Startup successful Dec 29 01:05:00 sandrane upsd[5513]: listening on 127.0.0.1 port 3493 Dec 29 01:05:00 sandrane upsd[5513]: listening on ::1 port 3493 Dec 29 01:05:00 sandrane upsd[5513]: Connected to UPS [Eaton-66781]: usbhid-ups-Eaton-66781 Dec 29 01:05:00 sandrane upsd[5514]: Startup successful Dec 29 01:05:00 sandrane upsmon[5517]: Startup successful Dec 29 01:05:00 sandrane upsd[5514]: User upsmaster@::1 logged into UPS [Eaton-66781]
and the command ps aux | grep ups should show:
upsd ... Ss 13:19 0:00 /usr/lib/ups/driver/usbhid-ups -a Eaton-66781 upsd ... Ss 13:19 0:00 /usr/sbin/upsd -u upsd root ... Ss 13:19 0:00 /usr/sbin/upsmon upsd ... S 13:19 0:00 /usr/sbin/upsmon
The command upsc -L should show Eaton-66781: Eaton
Ellipse ASR 1500 USBS
, and the command upsc Eaton-66781 will
give full details of the UPS:
battery.charge: 100 battery.charge.low: 30 battery.runtime: 3406 battery.type: PbAc driver.name: usbhid-ups driver.parameter.pollfreq: 30 driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.parameter.vendorid: 0463 driver.version: 2.2.2 driver.version.data: MGE HID 1.10 driver.version.internal: 0.33 input.transfer.high: 264 input.transfer.low: 184 outlet.0.desc: Main Outlet outlet.0.id: 1 outlet.0.switchable: no outlet.1.desc: PowerShare Outlet 1 outlet.1.id: 2 outlet.1.status: on outlet.1.switchable: no outlet.2.desc: PowerShare Outlet 2 output.frequency.nominal: 50 output.voltage: 230.0 output.voltage.nominal: 230 ups.beeper.status: enabled ups.delay.shutdown: 20 ups.delay.start: 30 ups.load: 7 ups.mfr: MGE UPS SYSTEMS ups.model: Ellipse 1500 ups.power.nominal: 1500 ups.productid: ffff ups.serial: 1HAH1202C ups.status: OL CHRG ups.timer.shutdown: -1 ups.timer.start: -10 ups.vendorid: 0463
NUT as packaged in openSUSE 11.3 is sensitive to the operation of IPv4 and IPv6. These are both turned on by default in the openSUSE distribution. What happens if I turn IPv6 off? First some background from Arjen de Korte:
A couple of releases ago we decided to no longer listen on all interfaces, but instead only on the loopback interface. This in order to not automatically expose the upsd service on systems that are connected to the internet (which is a security risk if you don't protect the communication through SSL). In order to allow the least amount of surprises for people that are upgrading their systems, we decided to listen to both the IPv4 and IPv6 loopback addresses if IPv6 support is detected at compilation time. In most of the cases, there is really no benefit to switch off IPv6 and in the rare cases there is, there is an option that can be passed to the upsd server to override this default.
This means that if you turn off IPv6, you need to adjust your NUT
configuration to take this into account.
See upsd.conf
and man 5 upsd.conf
.
Notes:
A few notes on personal experiences.
Jan 5 03:40:59 cyan upsmon [9847]: Login on UPS [Eaton-66781@localhost] failed - got [ERR ACCESS-DENIED]
then maybe your file /etc/hosts.allow does not allow
protocol upsd from 127.0.0.1 or [::1]. See
hosts.allow, and
man tcpd
, man -S5 hosts_access
and man -S5
hosts_options
for a detailed description of hosts.allow and
hosts.deny.
Broadcast Message from upsd@glacon2 (somewhere) at 22:55 ... UPS Eaton-66781@localhost is unavailable
Note: This is typical for usbhid-ups driver and the MGE/Eaton Ellipse series with NUT versions before 2.4.2. It has to do with a reply from the UPS that was misunderstood by the driver, occasionally resulting in a storm of reconnects. This effect is limited to the MGE/Eaton Ellipse series, other MGE/Eaton devices are not affected by this problem.
Broadcast Message from upsd@glacon2 (somewhere) at 19:10 ... UPS Eaton-66781@localhost: Not available +++ Onduleur indisponible
I suspect that this is also a peculiarity of the MGE/Eaton Ellipse series with the usbhid-ups driver. Somehow they become synchronised in their inability to connect. The fix is to restart the UPS daemon with the command rcupsd restart. This de-synchronises the driver and the UPS.
Broadcast Message from upsd@glacon2 (somewhere) at 16:34 ... UPS Eaton-66781@localhost: On battery +++ Onduleur sur batterie
but no further messages. The file /var/log/messages shows no trace of activity by /usr/sbin/upssched-cmd. The problem is with the permissions of script /usr/sbin/upssched-cmd:
glacon2:~ # ls -alF /usr/sbin/upssched-cmd -rw-r--r-- 1 upsd daemon 1936 2010-02-28 16:17 /usr/sbin/upssched-cmd
Once the permissions were changed to conform to table 1
glacon2:~ # chmod 754 /usr/sbin/upssched-cmd glacon2:~ # ls -alF /usr/sbin/upssched-cmd -rwxr-xr-- 1 upsd daemon 1936 2010-02-28 16:17 /usr/sbin/upssched-cmd*
the script executes correctly.
Starting NUT UPS drivers ....done
Starting NUT UPS server startproc: exit status of parent of /usr/sbin/upsd: 1
....failed
File /var/log/messages tails with
Nov 7 09:53:57 glacon usbhid-ups[4974]: Startup successful Nov 7 09:53:57 glacon upsd[4977]: listening on 127.0.0.1 port 3493 Nov 7 09:53:57 glacon upsd[4977]: not listening on ::1 port 3493 Nov 7 09:53:59 glacon usbhid-ups[4974]: Signal 15: exiting
This can happen if you turn IPv6 off, but forget to change upsd.conf. See configuration file upsd.conf for the required modification, then run the command rcupsd restart.
Alternatively, you can turn IPv6 on again: YaST ->
Network Devices -> Network Settings -> Global options -> IPv6 Protocol
Settings and select Enable IPv6
and then re-boot.
Broadcast Message from upsd@glacon2 (somewhere) at 16:34 ... UPS Eaton-66781@localhost: On battery +++ Onduleur sur batterie
but there was no further activity and no shutdown. The file /var/log/messages shows
Feb 19 11:15:26 sandrane upsmon[3435]: UPS Eaton-66781@localhost: On battery +++ Onduleur sur batterie Feb 19 11:15:33 sandrane upssched[4720]: Failed to connect to parent and failed to create parent: No such file or directory
The problem is that in file upssched.conf you specified
PIPEFN /var/lib/ups/upssched/upssched.pipe LOCKFN /var/lib/ups/upssched/upssched.lock
but you have forgotten to create directory /var/lib/ups/upssched. Do it now:
sandrane:/var/lib/ups # mkdir /var/lib/ups/upssched sandrane:/var/lib/ups # chown upsd:daemon /var/lib/ups/upssched
If you examine directory /var/lib/ups/ you should see:
sandrane:~ # ls -alF /var/lib/ups total 20 drwx------ 3 upsd daemon 4096 19 févr. 11:53 ./ drwxr-xr-x 44 root root 4096 19 févr. 10:47 ../ -rw-r--r-- 1 upsd daemon 5 19 févr. 11:10 upsd.pid drwxr-xr-x 2 upsd daemon 4096 19 févr. 11:53 upssched/ srw-rw---- 1 upsd daemon 0 19 févr. 11:10 usbhid-ups-Eaton-66781= -rw-r--r-- 1 upsd daemon 5 19 févr. 11:10 usbhid-ups-Eaton-66781.pid
cyan upsmon[4340]: UPS [Eaton-66781@localhost]: connect failed:
Connection failure: Connection refused
every 5 seconds. Has the UPS been stolen? No, it's still there. The command lsusb shows
Bus 002 Device 002: ID 0463:ffff MGE UPS Systems UPS
Is the upsd daemon which sits between the UPS drivers and the monitoring programs still operational? The command ps aux | grep upsd shows no activity. upsd is dead. I tried restarting the daemon with the command rcupsd restart:
cyan:~ # rcupsd restart Shutting down NUT UPS monitor done Shutting down NUT UPS server done Shutting down NUT UPS drivers done Starting NUT UPS drivers done Starting NUT UPS server startproc: exit status of parent of /usr/sbin/upsd: 1
This error appeared when the server executing the NUT daemon was repositioned in the local network. It was taken from it's place as a router receiving traffic directly from the Internet to a subsidiary position below another router. The IP number changed as did the FQDN (fully qualified domain name), however no changes were made to the server configuration. The problem was solved by returning the server to it's previous rôle as a router, and the problem was not investigated any further.
As one of the many who have used the work of the NUT project as part of their system setup, I would like to express my gratitude and my appreciation for the software that the NUT project has made available to system administrators.
Much of the code and text in this page is derived from work by the NUT project, MGE/Eaton and contributions by Charles Lepple, Arjen de Korte, Arnaud Quette and others in the Nut-upsuser mailing list.
The <HTML> element of this page with its content is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The <HTML> element is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this page. If not, see <http://www.gnu.org/licenses/>.
To republish this page, you will need to place a valid DOCTYPE declaration before the <HTML> element.
© Copyright 2005-2012 Roger Price < roger at rogerprice dot org >
In order to facilitate access from all browsers, now and in the future,
these pages conform to the International Standard ISO/IEC 15445 and the
corresponding W3C Recommendations. Last change:
Sun Feb 19 12:22:15 CET 2012

http://rogerprice.org