Bug 79465 - Red Hat NUT only supports one UPS on a system
Red Hat NUT only supports one UPS on a system
Product: Red Hat Linux
Classification: Retired
Component: nut (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-12-11 17:44 EST by C.M. Connelly
Modified: 2007-04-18 12:48 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-09-09 11:54:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
add upsdrvctl support to /etc/rc.d/init.d/ups (909 bytes, patch)
2003-05-14 14:33 EDT, Gilbert E. Detillieux
no flags Details | Diff
add upsdrvctl support to /etc/rc.d/init.d/halt (657 bytes, patch)
2003-05-14 16:04 EDT, Gilbert E. Detillieux
no flags Details | Diff

  None (edit)
Description C.M. Connelly 2002-12-11 17:44:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

Description of problem:
Red Hat's NUT configuration only allows you to attach and monitor one UPS on a
single system.

UPS details are specified in /etc/sysconfig/ups, which is read by
/etc/init.d/ups.  Unfortunately, this setup only allows you to enter information
for a single UPS.  Additional UPSs can be defined in /etc/ups/ups.conf and
activated by hand (by running <driver> -a <upsname>), but there is no way of
automating the loading of these additional drivers without extensively modifying
the init.d script.

Debian supports multiple UPSs, but does so by requiring you to define them in
upsd.conf, which is deprecated.

The main issue here is that the init script is starting things by reading a Red
Hat specific file in /etc/sysconfig instead of by reading the NUT configuration
from ups.conf.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Not really a question of reproducing the problem -- it's fundamental to the way
that Red Hat has chosen to manage the configuration information.

Actual Results:  Only the driver for the UPS defined in /etc/sysconfig/ups is
loaded when the init.d script is run.  Additional UPSs are ignored, and drivers
must be started by hand or by another script.

Expected Results:  All UPSs defined in /etc/ups/ups.conf should be monitored.

Additional info:

If you want to keep the redundant configuration in /etc/sysconfig, then perhaps
the init.d script could be modified to read multiple files starting with ups --
ups1, ups2, etc. -- and do a loop over the code that loads the drivers.

Otherwise the script should parse the /etc/ups/ups.conf file, and run commands
as necessary for each of the UPSs defined in that file.
Comment 1 Markku Kolkka 2003-02-13 08:00:55 EST
The /etc/sysconfig/ups file is completely redundant and should be removed. The
method used to start the UPS driver in /etc/init.d/ups is deprecated and
upsdrvctl should be used instead.
Comment 2 Gilbert E. Detillieux 2003-05-14 14:33:16 EDT
Created attachment 91679 [details]
add upsdrvctl support to /etc/rc.d/init.d/ups

This patch to ups.init (installed as /etc/rc.d/init.d/ups) will let you run
upsdrvctl (e.g. to support multiple drivers) rather than a single driver.
Set the MODEL variable in /etc/sysconfig/ups as follows to enable this:

Comment 3 Gilbert E. Detillieux 2003-05-14 16:04:02 EDT
Created attachment 91681 [details]
add upsdrvctl support to /etc/rc.d/init.d/halt

This patch needs to be applied to initscripts-6.40/rc.d/init.d/halt (in the
corresponding initscripts package, of course), to allow proper UPS shutdown
when MODEL=upsdrvctl is used in /etc/sysconfig/ups.

I've submitted it here since it's related to my previous patch, even though it
applies to a file that's not part of the nut packages, per se.
Comment 4 Ngo Than 2003-09-09 11:54:51 EDT
i have added your into 1.4.0-1, which will be available in rawhide soon. 
many thanks for your patch files and report. 

Note You need to log in before you can comment on or make changes to this bug.