NUT 2.4.1 setup with openSUSE 12.1

Introduction

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:

  1. Optimist: Keep going as long as possible with the available battery power. When the battery charge drops to 30%, stop the server. This is the most common strategy. When building power comes back, restart the server and hope that building power will last long enough to at least partially recharge the battery.
  2. Pessimist: Shut down quickly as soon as building power fails. When building power comes back, restart the server, but be ready to stop again as soon as the building power fails again. Hope to be able to stop as often as the building power fails. Note: If you're living in a region with frequent short power outages, you'd be better served with a UPS that supports delaying restart of the load until the batteries have recharged to a certain minimum level. An entry-level MGE/Eaton Ellipse series UPS such as the one I use doesn't have that, but the MGE/Eaton Evolution does. This will guarantee that the system will always have enough battery power to complete a power-up and power-down sequence if the building power returns and fails again at the worst possible moment.

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.

picture of UPS

The UPS unit

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

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.

Table 1 — Permissions and ownership of key files
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

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.

Documentation

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.

Configuration

nut.conf

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

ups.conf

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

upsd.conf

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

upsd.users

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.

upsmon.conf

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:

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

upssched.conf

This file specifies the timer actions associated with the UPS events. It works in close cooperation with the script upssched-cmd.

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

/usr/sbin/upssched-cmd

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

hosts.allow or how to avoid [ERR ACCESS-DENIED]

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:

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.

hosts.deny

This file is not used and is not present in my configuration. All denials are specified in hosts.allow.

Running the daemon

  1. Check that the permissions and owners of the key configuration files are as shown in Table 1. Do this carefully and thoroughly. Wrong permissions and ownership are a common source of problems with NUT.
  2. Restart your box. Experience shows that detection of the USB interface to an Eaton/MGE Ellipse UPS is a delicate matter, and best done during the initial power-on sequence. Note: This problem is limited to the Eaton/MGE Ellipse series devices with combined USB/serial ports also known as USBS ports (RJ-45). It is not a problem with other MGE/Eaton devices.
  3. Check with command lsusb that the UPS is detected:
      Bus 003 Device 002: ID 0463:ffff MGE UPS Systems UPS
  4. Try starting the daemon with the command rcupsd start
     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
  5. Start the daemon : Yast -> System -> Execution levels -> start upsd

IPv4 and IPv6

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:

  1. This sensitivity to IPv6 operation appeared in openSUSE 11.3. It was not present in release 11.2.
  2. In openSUSE, NUT is compiled with both IPv4 and IPv6 enabled. You could force it to listen on a specific interface by appending -4 (IPv4) or -6 (IPv6) to the call of the daemon upsd. This isn't in the man page for upsd, but will be in the list of options that are displayed when you type upsd -h. However it is much simpler to specify the sockets upsd should listen to with the LISTEN directive in upsd.conf. This will then override the built in defaults.

What went wrong?

A few notes on personal experiences.

  1. Permissions and ownership : Check them again, carefully.
  2. rcupsd doesn't start NUT : If you install NUT, set it up according to these instructions, and then try to start NUT with the command rcupsd start it may well fail silently. Remember that you were advised to restart your box before starting NUT. Now is the time to do so. Further evidence of UPS non-detection would be given by the command /usr/lib/ups/driver/upsdrvctl start
  3. Login on UPS failed : If you see this message in your log:
     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.

  4. Data stale : If the command upsc Eaton-66781 produces the result "Error: Data stale", try restarting the ups daemon with the command rcupsd restart. This symptom may be accompanied by an unusually high system load reported by xload on an otherwise idle machine, and a broadcast message such as
     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.

  5. UPS not available every 5 minutes After 52 days of uninterrupted service, I started getting the following message every 5 minutes:
     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.

  6. No activity by upssched-cmd : You pulled the power cord from the wall to test the new setup, you received the notification:
     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.

  7. Cannot start NUT UPS server : The command rcupsd restart reports
     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.

  8. Still no activity by upssched-cmd : You pulled the power cord from the wall to test the new setup, you received the notification:
     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
  9. No connection to UPS : The command upsc -L reports Error: Connection failure: Connection refused and the log /var/log/messages is filling up with a
     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.

Acknowledgements and Copyright

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
Valid HTML 4.01! Valid CSS! Level A conformance icon,            W3C-WAI Web Content Accessibility Guidelines 1.0 Valid ISO 15445!
http://rogerprice.org