Compare commits
6 commits
nll-2.8.0
...
debian-squ
Author | SHA1 | Date | |
---|---|---|---|
|
967650bf3d | ||
|
79c1db9081 | ||
|
0cff03445d | ||
|
502231e441 | ||
|
b50e87d3d7 | ||
|
a700f109ab |
1145 changed files with 53063 additions and 264532 deletions
38
.drone.yml
38
.drone.yml
|
@ -1,38 +0,0 @@
|
|||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: Build Bullseye
|
||||
image: debian:bullseye
|
||||
volumes:
|
||||
- name: finished_files
|
||||
path: /deb_files
|
||||
commands:
|
||||
- apt update
|
||||
- apt -y upgrade
|
||||
- apt -y install --no-install-recommends build-essential equivs devscripts git rename
|
||||
- git clean -f -d -x
|
||||
- mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control
|
||||
- dpkg-buildpackage -b -uc
|
||||
- rename 's/\.deb/_bullseye\.deb/' ../*.deb
|
||||
- mkdir -p /deb_files/bullseye/
|
||||
- cp ../*.deb /deb_files/bullseye/
|
||||
- find /deb_files/
|
||||
|
||||
- name: gitea_release
|
||||
image: plugins/gitea-release
|
||||
volumes:
|
||||
- name: finished_files
|
||||
path: /deb_files
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: GITEA_KEY
|
||||
base_url: https://git.neulandlabor.de/
|
||||
files:
|
||||
- /deb_files/bullseye/*
|
||||
when:
|
||||
event: tag
|
||||
|
||||
volumes:
|
||||
- name: finished_files
|
||||
temp: {}
|
9
AUTHORS
9
AUTHORS
|
@ -96,6 +96,11 @@ N: Lars Balker Rasmussen
|
|||
E: lbr@mjolner.dk
|
||||
D: Solaris and minor patches
|
||||
|
||||
N: Carlos Rodrigues
|
||||
E: carlos.efr@mail.telepac.pt
|
||||
W: http://students.fct.unl.pt/~cer09566/
|
||||
D: author of the "megatec" driver
|
||||
|
||||
N: David Santinoli
|
||||
E: david@santinoli.com
|
||||
W: http://www.santinoli.com
|
||||
|
@ -170,7 +175,3 @@ D: pwmib support for snmp-ups
|
|||
N: Kjell Claesson
|
||||
E: Kjell.claesson@epost.tidanet.se
|
||||
D: Author of bcmxcp driver, 3-phase work.
|
||||
|
||||
N: Giuseppe Corbelli
|
||||
E: giuseppe.corbelli@copanitalia.com
|
||||
D: Author of asem driver
|
||||
|
|
2
COPYING
2
COPYING
|
@ -5,7 +5,7 @@
|
|||
|
||||
The files in the scripts/python/ directory are released under GNU General
|
||||
Public License (GPL) version 3, or (at your option) any later version. See
|
||||
"LICENSE-GPL3" in the root of this distribution.
|
||||
"LICENSE.GPL3" in the root of this distribution.
|
||||
|
||||
The Perl client module (scripts/perl/Nut.pm) is released under the same
|
||||
license as Perl itself. That is to say either GPL version 1 or (at your option)
|
||||
|
|
864
INSTALL
864
INSTALL
|
@ -1,368 +1,522 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell command './configure && make && make install'
|
||||
should configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the 'README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
'INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
|
||||
The 'configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a 'Makefile' in each directory of the package.
|
||||
It may also create one or more '.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script 'config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file 'config.log' containing compiler output (useful mainly for
|
||||
debugging 'configure').
|
||||
|
||||
It can also use an optional file (typically called 'config.cache' and
|
||||
enabled with '--cache-file=config.cache' or simply '-C') that saves the
|
||||
results of its tests to speed up reconfiguring. Caching is disabled by
|
||||
default to prevent problems with accidental use of stale cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how 'configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the 'README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point 'config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file 'configure.ac' (or 'configure.in') is used to create
|
||||
'configure' by a program called 'autoconf'. You need 'configure.ac' if
|
||||
you want to change it or regenerate 'configure' using a newer version of
|
||||
'autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. 'cd' to the directory containing the package's source code and type
|
||||
'./configure' to configure the package for your system.
|
||||
|
||||
Running 'configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type 'make' to compile the package.
|
||||
|
||||
3. Optionally, type 'make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type 'make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the 'make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type 'make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior 'make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing 'make clean'. To also remove the
|
||||
files that 'configure' created (so you can compile the package for
|
||||
a different kind of computer), type 'make distclean'. There is
|
||||
also a 'make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type 'make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide 'make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like 'make install' and 'make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the 'configure' script does not know about. Run './configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give 'configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here is
|
||||
an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU 'make'. 'cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the 'configure' script. 'configure' automatically checks for the source
|
||||
code in the directory that 'configure' is in and in '..'. This is known
|
||||
as a "VPATH" build.
|
||||
|
||||
With a non-GNU 'make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use 'make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple '-arch' options to the
|
||||
compiler but only a single '-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the 'lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, 'make install' installs the package's commands under
|
||||
'/usr/local/bin', include files under '/usr/local/include', etc. You
|
||||
can specify an installation prefix other than '/usr/local' by giving
|
||||
'configure' the option '--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like '--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run 'configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the default
|
||||
for these options is expressed in terms of '${prefix}', so that
|
||||
specifying just '--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to 'configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
'make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, 'make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
'${prefix}'. Any directories that were specified during 'configure',
|
||||
but not in terms of '${prefix}', must each be overridden at install time
|
||||
for the entire installation to be relocated. The approach of makefile
|
||||
variable overrides for each directory variable is required by the GNU
|
||||
Coding Standards, and ideally causes no recompilation. However, some
|
||||
platforms have known limitations with the semantics of shared libraries
|
||||
that end up requiring recompilation when using this method, particularly
|
||||
noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the 'DESTDIR' variable. For
|
||||
example, 'make install DESTDIR=/alternate/directory' will prepend
|
||||
'/alternate/directory' before all installation names. The approach of
|
||||
'DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of '${prefix}'
|
||||
at 'configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving 'configure' the
|
||||
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to '--enable-FEATURE' options to
|
||||
'configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
|
||||
is something like 'gnu-as' or 'x' (for the X Window System). The
|
||||
'README' should mention any '--enable-' and '--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, 'configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the 'configure' options '--x-includes=DIR' and
|
||||
'--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of 'make' will be. For these packages, running './configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with 'make V=1'; while running './configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with 'make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
|
||||
is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
HP-UX 'make' updates targets which have the same time stamps as their
|
||||
prerequisites, which makes it generally unusable when shipped generated
|
||||
files such as 'configure' are involved. Use GNU 'make' instead.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
|
||||
workaround. If GNU CC is not installed, it is therefore recommended to
|
||||
try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
|
||||
in your 'PATH', put it _after_ '/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in '/boot/common',
|
||||
not '/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features 'configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, 'configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
'--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as 'sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file 'config.sub' for the possible values of each field. If
|
||||
'config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option '--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with '--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
Network UPS Tools: INSTALL
|
||||
|
||||
If you want to set default values for 'configure' scripts to share,
|
||||
you can create a site shell script called 'config.site' that gives
|
||||
default values for variables like 'CC', 'cache_file', and 'prefix'.
|
||||
'configure' looks for 'PREFIX/share/config.site' if it exists, then
|
||||
'PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
'CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all 'configure' scripts look for a site script.
|
||||
These are the essential steps for compiling and installing this
|
||||
software, including configuring safe shutdowns when the UPS battery
|
||||
runs out of power.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
There are many programs and other features in this package. You should
|
||||
check out the README file and other accompanying documentation to see
|
||||
how it all works.
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to 'configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the 'configure' command line, using 'VAR=value'. For example:
|
||||
The paths shown below are the default values you get by just calling
|
||||
configure by itself. If you have used --prefix or similar, things will
|
||||
be different. Also, if you didn't install this program from source
|
||||
yourself, the paths will probably have a number of differences.
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
Note: by default, your system probably won't find the man pages, since
|
||||
they install to /usr/local/ups/man. You can fix this by editing your
|
||||
MANPATH, or just do this:
|
||||
|
||||
causes the specified 'gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
man -M /usr/local/ups/man <man page>
|
||||
|
||||
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
|
||||
Autoconf limitation. Until the limitation is lifted, you can use this
|
||||
workaround:
|
||||
man -M /usr/local/ups/man upsd.conf
|
||||
|
||||
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
Also, if your favorite system offers up to date binary packages,
|
||||
always prefer these over a source installation. Along with the known
|
||||
advantages of such systems for installation, upgrade and removal, there
|
||||
are many integration issues that have been addressed.
|
||||
|
||||
'configure' Invocation
|
||||
======================
|
||||
============================================================================
|
||||
============================================================================
|
||||
============================================================================
|
||||
|
||||
'configure' recognizes the following options to control how it
|
||||
operates.
|
||||
Prepare your system
|
||||
===================
|
||||
|
||||
'--help'
|
||||
'-h'
|
||||
Print a summary of all of the options to 'configure', and exit.
|
||||
1. Create at least one user and a group for running this software. You
|
||||
might call them "ups" and "nut". The exact names aren't important as
|
||||
long as you are consistent.
|
||||
|
||||
'--help=short'
|
||||
'--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
'configure', and exit. The 'short' variant lists options used only
|
||||
in the top level, while the 'recursive' variant lists options also
|
||||
present in any nested packages.
|
||||
The process for doing this varies from one system to the next, and
|
||||
explaining how to add users is beyond the scope of this document.
|
||||
|
||||
'--version'
|
||||
'-V'
|
||||
Print the version of Autoconf used to generate the 'configure'
|
||||
script, and exit.
|
||||
For the purposes of this document, the user name and group name
|
||||
will be "ups" and "nut" respectively.
|
||||
|
||||
'--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally 'config.cache'. FILE defaults to '/dev/null' to
|
||||
disable caching.
|
||||
|
||||
'--config-cache'
|
||||
'-C'
|
||||
Alias for '--cache-file=config.cache'.
|
||||
|
||||
'--quiet'
|
||||
'--silent'
|
||||
'-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to '/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
'--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
'configure' can determine that directory automatically.
|
||||
|
||||
'--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names:: for
|
||||
more details, including other options available for fine-tuning the
|
||||
installation locations.
|
||||
|
||||
'--no-create'
|
||||
'-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
'configure' also accepts some other, not widely useful, options. Run
|
||||
'configure --help' for more details.
|
||||
Be sure the new user is a member of the new group! If you forget to
|
||||
do this, you will have problems later on when you try to start upsd.
|
||||
|
||||
============================================================================
|
||||
============================================================================
|
||||
============================================================================
|
||||
|
||||
Build and install
|
||||
=================
|
||||
|
||||
|
||||
1. Configure the source tree for your system. Add the --with-user and
|
||||
--with-group switch to set the user name and group that you created
|
||||
above.
|
||||
|
||||
./configure --with-user=ups --with-group=nut
|
||||
|
||||
If you need any other switches for configure, add them here. For
|
||||
example:
|
||||
|
||||
* to build and install USB drivers, add --with-usb (note that you
|
||||
need to install libusb development package or files).
|
||||
|
||||
* to build and install SNMP drivers, add --with-snmp (note that
|
||||
you need to install libsnmp development package or files).
|
||||
|
||||
* to build and install CGI scripts, add --with-cgi.
|
||||
|
||||
* to build and install NUT development files (needed to compile
|
||||
WMNut and MGE PSP), add --with-lib.
|
||||
|
||||
* to build and install HAL support, add --with-hal.
|
||||
|
||||
See docs/configure.txt or "./configure --help" for the available
|
||||
options.
|
||||
|
||||
If you alter paths with additional switches, be sure to use those
|
||||
new paths while reading the rest of the steps.
|
||||
|
||||
*** Reference: docs/configure.txt
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
2. Build the programs.
|
||||
|
||||
make
|
||||
|
||||
This will build the NUT client and server programs and the
|
||||
selected drivers. It will also build any other features that were
|
||||
selected during configuration in step 1. above.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
3. Gain privileges for installing software if necessary.
|
||||
|
||||
su
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
|
||||
4. Install the files to a system level directory.
|
||||
|
||||
make install
|
||||
|
||||
This will install the compiled programs and man pages, as well as
|
||||
some data files required by NUT. Any optional features selected
|
||||
during configuration will also be installed.
|
||||
|
||||
This will also install sample versions of the NUT configuration
|
||||
files. Sample files are installed with names like ups.conf.sample
|
||||
so they will not overwrite any existing real config files you may
|
||||
have created.
|
||||
|
||||
If you are packaging this software, then you will probably want to
|
||||
use the DESTDIR variable to redirect the build into another place,
|
||||
i.e.:
|
||||
|
||||
make DESTDIR=/tmp/package install
|
||||
make DESTDIR=/tmp/package install-conf
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
5. Create the state path directory for the driver(s) and server to use
|
||||
for storing UPS status data and other auxiliary files, and make it
|
||||
owned by the user you created.
|
||||
|
||||
mkdir -p /var/state/ups
|
||||
chmod 0770 /var/state/ups
|
||||
chown root:nut /var/state/ups
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
6. Set ownership data and permissions on your serial or USB ports
|
||||
that go to your UPS hardware. Be sure to limit access to just
|
||||
the user you created earlier.
|
||||
|
||||
These examples assume the second serial port (ttyS1) on a typical
|
||||
Slackware system. On FreeBSD, that would be cuaa1. Serial ports
|
||||
vary greatly, so yours may be called something else.
|
||||
|
||||
chmod 0660 /dev/ttyS1
|
||||
chown root:nut /dev/ttyS1
|
||||
|
||||
The setup for USB ports is slightly more complicated. Device files
|
||||
for USB devices, such as /proc/bus/usb/002/001, are usually
|
||||
created "on the fly" when a device is plugged in, and disappear
|
||||
when the device is disconnected. Moreover, the names of these
|
||||
device files can change randomly. To set up the correct
|
||||
permissions for the USB device, you may need to set up (operating
|
||||
system dependent) hotplugging scripts. Sample scripts and
|
||||
information are provided in the scripts/hotplug and
|
||||
scripts/udev directories. For most users, the hotplugging scripts
|
||||
will be installed automatically by "make install".
|
||||
|
||||
(If you want to try if a driver works without setting up
|
||||
hotplugging, you can add the "-u root" option to upsd, upsmon, and
|
||||
drivers; this should allow you to follow the below
|
||||
instructions. However, don't forget to set up the correct
|
||||
permissions later!).
|
||||
|
||||
NOTE: if you are using something like devfs or udev, make sure
|
||||
these permissions stay set across a reboot. If they revert to the
|
||||
old values, your drivers may fail to start.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
7. Create one section per UPS in /usr/local/ups/etc/ups.conf
|
||||
|
||||
To find out which driver to use, check the "HARDWARE SUPPORT TABLE"
|
||||
in the README file, or data/driver.list.
|
||||
|
||||
Once you have picked a driver, create a section for your UPS in
|
||||
ups.conf. You must supply values for "driver" and "port".
|
||||
|
||||
Some drivers may require other flags or settings. The "desc" value
|
||||
is optional, but is recommended to provide a better description of
|
||||
what your UPS is supporting.
|
||||
|
||||
A typical UPS without any extra settings looks like this:
|
||||
|
||||
[myupsname]
|
||||
driver = mydriver
|
||||
port = /dev/ttyS1
|
||||
desc = "Workstation"
|
||||
|
||||
NOTE: usbhid-ups is a special case and ignores the "port" value.
|
||||
You must still set this value, but it does not matter what you set
|
||||
it to; you can set "port" to "auto" if you like. If you only own
|
||||
one local UBS UPS, the driver will find it automatically. If you
|
||||
own more than one UBS UPS, refer to the usbhid-ups(8) man page for
|
||||
more information.
|
||||
|
||||
*** References: man pages: ups.conf(5), nutupsdrv(8), plus
|
||||
whatever driver(s) you intend to use.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
8. Start the driver(s) for your hardware.
|
||||
|
||||
/usr/local/ups/bin/upsdrvctl start
|
||||
|
||||
Make sure the driver doesn't report any errors. It should show a
|
||||
few details about the hardware and then enter the background. You
|
||||
should get back to the command prompt a few seconds later. For
|
||||
reference, a successful start of the belkin driver looks like this:
|
||||
|
||||
# /usr/local/ups/bin/upsdrvctl start
|
||||
Network UPS Tools - UPS driver controller 1.5.12
|
||||
Network UPS Tools - Belkin Smart protocol driver 0.21 (1.5.12)
|
||||
Detected F6C525-SER on /dev/cuaa0
|
||||
#
|
||||
|
||||
If the driver doesn't start cleanly, make sure you have picked the
|
||||
right one for your hardware. You might need to try other drivers
|
||||
by changing the "driver=" value in ups.conf.
|
||||
|
||||
Be sure to check the driver's man page to see if it needs any extra
|
||||
settings in ups.conf to detect your hardware.
|
||||
|
||||
If it says "can't bind /var/state/ups/..." or similar, then your
|
||||
state path probably isn't writable by the driver. Check the
|
||||
permissions and mode on that directory (step 5).
|
||||
|
||||
After making changes, try step 6 again.
|
||||
|
||||
*** References: man pages: nutupsdrv(8), upsdrvctl(8)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
9. Configure upsd, which serves data from the drivers to the clients.
|
||||
|
||||
First, edit upsd.conf to allow access to your client systems. By
|
||||
default, upsd will only listen to localhost port 3493/tcp. If you want
|
||||
to connect to it from other machines, you must specify each interface you
|
||||
want upsd to listen on for connections, optionally with a port number.
|
||||
|
||||
LISTEN 127.0.0.1 3493
|
||||
LISTEN ::1 3493
|
||||
|
||||
Note: if you run a firewall of some sort, you may have to add rules
|
||||
to allow these incoming connections.
|
||||
|
||||
Next, create upsd.users. For now, this can be an empty file.
|
||||
You can come back and add more to it later when it's time to
|
||||
configure upsmon or run one of the management tools.
|
||||
|
||||
Do not make either file world-readable, since they both hold
|
||||
access control data and passwords. They just need to be readable by
|
||||
the user you created in the preparation process.
|
||||
|
||||
The suggested configuration is to chown it to root, chgrp it to the
|
||||
group you created, then make it readable by the group.
|
||||
|
||||
chown root:nut upsd.conf upsd.users
|
||||
chmod 0640 upsd.conf upsd.users
|
||||
|
||||
*** References: man pages: upsd.conf(5), upsd.users(5), upsd(8)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
10. Start the network server.
|
||||
|
||||
/usr/local/ups/sbin/upsd
|
||||
|
||||
Make sure it is able to connect to the driver(s) on your system.
|
||||
A successful run looks like this:
|
||||
|
||||
# /usr/local/ups/sbin/upsd
|
||||
Network UPS Tools upsd 1.5.12
|
||||
Connected to UPS [belkin]: belkin-cuaa0
|
||||
Synchronizing...done
|
||||
#
|
||||
|
||||
upsd prints dots while it waits for the driver to respond. Your
|
||||
system may print more or less depending on how many drivers you
|
||||
have and how fast they are.
|
||||
|
||||
NOTE: if upsd says that it can't connect to a UPS or that the data
|
||||
is stale, then your ups.conf is not configured correctly, or you
|
||||
have a driver that isn't working properly. You must fix this before
|
||||
going on to the next step.
|
||||
|
||||
*** Reference: man page: upsd(8)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
11. Make sure that the UPS is providing good status data.
|
||||
|
||||
/usr/local/ups/bin/upsc myupsname@localhost ups.status
|
||||
|
||||
You should see just one line in response:
|
||||
|
||||
OL
|
||||
|
||||
OL means your system is running on line power. If it says something
|
||||
else (like OB - on battery, or LB - low battery), your driver was
|
||||
probably misconfigured in step 7. If you reconfigure the driver,
|
||||
use 'upsdrvctl stop' to stop it, then start it again in step 8.
|
||||
|
||||
*** Reference: man page: upsc(8)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
12. Look at all of the status data which is being monitored.
|
||||
|
||||
/usr/local/ups/bin/upsc myupsname@localhost
|
||||
|
||||
What happens now depends on the kind of UPS and driver you have.
|
||||
In the list, you should see ups.status with the same value you got
|
||||
above. A sample run on a MGE UPS SYSTEMS Ellipse ASR 600 looks
|
||||
like this:
|
||||
|
||||
battery.charge: 82
|
||||
battery.charge.low: 30
|
||||
battery.runtime: 1563
|
||||
driver.name: usbhid-ups
|
||||
driver.parameter.port: auto
|
||||
driver.version: 2.0.3
|
||||
driver.version.data: MGE HID 0.8
|
||||
driver.version.internal: 0.28
|
||||
input.transfer.high: 264.0
|
||||
input.transfer.low: 184.0
|
||||
outlet.desc: Main Outlet
|
||||
outlet.id: 1
|
||||
outlet.switchable: 0
|
||||
outlet.1.desc: PowerShare Outlet 1
|
||||
outlet.1.id: 2
|
||||
outlet.1.switch: 0
|
||||
outlet.1.switchable: 0
|
||||
output.voltage: 230.0
|
||||
ups.delay.shutdown: -1
|
||||
ups.delay.start: -10
|
||||
ups.load: 0
|
||||
ups.mfr: MGE UPS SYSTEMS
|
||||
ups.model: Ellipse 600
|
||||
ups.power.nominal: 600
|
||||
ups.serial: AP8F15005
|
||||
ups.status: OB DISCHRG
|
||||
|
||||
*** Reference: man page: upsc(8)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
13. Edit your startup scripts.
|
||||
|
||||
Make sure upsdrvctl and upsd are run every time your system starts.
|
||||
|
||||
============================================================================
|
||||
============================================================================
|
||||
============================================================================
|
||||
|
||||
Configuring shutdowns for low battery events
|
||||
--------------------------------------------
|
||||
|
||||
The whole point of UPS software is to bring down the OS cleanly when you
|
||||
run out of battery power. Everything else is just eye candy. To make
|
||||
sure your system shuts down properly, you will need to perform some
|
||||
additional configuration and run upsmon. Here are the basics:
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
1. Create a upsd user for upsmon to use while monitoring this UPS.
|
||||
|
||||
Edit upsd.users and create a new section. upsmon will connect
|
||||
to upsd and use this user name (in brackets) and password to
|
||||
authenticate. This example is for a user called "monuser":
|
||||
|
||||
[monuser]
|
||||
password = mypass
|
||||
upsmon master # or upsmon slave
|
||||
|
||||
*** References: man pages: upsd(8), upsd.users(5)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
2. Reload upsd. Depending on your configuration, you may be able to
|
||||
do this without stopping upsd:
|
||||
|
||||
/usr/local/ups/sbin/upsd -c reload
|
||||
|
||||
If that doesn't work (check the syslog), just restart it:
|
||||
|
||||
/usr/local/ups/sbin/upsd -c stop
|
||||
/usr/local/ups/sbin/upsd
|
||||
|
||||
Later: if you want to make reloading work, see the entry in the FAQ
|
||||
about starting upsd as a different user.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
3. Set the POWERDOWNFLAG location for upsmon.
|
||||
|
||||
In upsmon.conf, add a POWERDOWNFLAG directive with a filename.
|
||||
upsmon will create this file when the UPS needs to be powered off
|
||||
during a power failure when low battery is reached.
|
||||
|
||||
We will test for the presence of this file in a later step.
|
||||
|
||||
POWERDOWNFLAG /etc/killpower
|
||||
|
||||
*** References: man pages: upsmon(8), upsmon.conf(5)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
4. Secure upsmon.conf.
|
||||
|
||||
The recommended setting is to have it owned by root:nut, then
|
||||
make it readable by the group and not world. This file contains
|
||||
passwords that could be used by an attacker to start a shutdown,
|
||||
so keep it secure.
|
||||
|
||||
chown root:nut upsmon.conf
|
||||
chmod 0640 upsmon.conf
|
||||
|
||||
This step has been placed early in the process so you secure this
|
||||
file before adding sensitive data in the next step.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
5. Create a MONITOR directive for upsmon
|
||||
|
||||
Edit upsmon.conf and create a MONITOR line with the UPS definition
|
||||
(<upsname>@<hostname>), username and password from step 2, and
|
||||
the master or slave setting.
|
||||
|
||||
If it's the master (i.e., it's connected to this UPS directly):
|
||||
|
||||
MONITOR myupsname@mybox 1 monuser mypass master
|
||||
|
||||
If it's just monitoring this UPS over the network, and some other
|
||||
system is the master:
|
||||
|
||||
MONITOR myupsname@mybox 1 monuser mypass slave
|
||||
|
||||
The number "1" here is the power value. This should always be set
|
||||
to 1 unless you have a very special (read: expensive) system with
|
||||
redundant power supplies. See big-servers.txt and data-room.txt.
|
||||
|
||||
*** References: man pages: upsmon(8), upsmon.conf(5)
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
6. Define a SHUTDOWNCMD for upsmon.
|
||||
|
||||
Still in upsmon.conf, add a directive that tells upsmon how to
|
||||
shut down your system. This example seems to work on most systems:
|
||||
|
||||
SHUTDOWNCMD "/sbin/shutdown -h +0"
|
||||
|
||||
Notice the presence of "quotes" here to keep it together.
|
||||
|
||||
If your system has special needs, you may want to set this to
|
||||
a script which does local shutdown tasks before calling init.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
7. Start upsmon.
|
||||
|
||||
/usr/local/ups/sbin/upsmon
|
||||
|
||||
If it complains about something, then check your configuration.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
8. Look for messages in the syslog to indicate success. It should look
|
||||
something like this:
|
||||
|
||||
May 29 01:11:27 mybox upsmon[102]: Startup successful
|
||||
May 29 01:11:28 mybox upsd[100]: Client monuser@192.168.50.1
|
||||
logged into UPS [myupsname]
|
||||
|
||||
Any errors seen here are probably due to an error in the config
|
||||
files of either upsmon or upsd. You should fix them before
|
||||
continuing.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
9. Edit your startup scripts: add upsmon
|
||||
|
||||
Make sure upsmon starts when your system comes up. Do it after
|
||||
upsdrvctl and upsd, or it will complain about not being able to
|
||||
contact the server.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
10. Edit your shutdown scripts: add upsdrvctl shutdown
|
||||
|
||||
You should configure your system to power down the UPS after the
|
||||
filesystems are remounted read-only. Have it look for the presence
|
||||
of the POWERDOWNFLAG (from upsmon.conf), using this as an example:
|
||||
|
||||
if (test -f /etc/killpower)
|
||||
then
|
||||
echo "Killing the power, bye!"
|
||||
/usr/local/ups/bin/upsdrvctl shutdown
|
||||
|
||||
sleep 120
|
||||
|
||||
# uh oh... the UPS power-off failed
|
||||
# you probably want to reboot here so you don't get stuck!
|
||||
# *** see the section on power races in shutdown.txt! ***
|
||||
fi
|
||||
|
||||
Be careful: that upsdrvctl command will probably power off your
|
||||
machine. Don't use it unless your system is ready to be halted by
|
||||
force. If you run RAID, be sure the arrays are ready to lose power.
|
||||
Your kernel's power-off routines may not execute.
|
||||
|
||||
Make sure that the filesystem(s) holding your UPS drivers and
|
||||
configuration details are still mounted when that part of the script
|
||||
is run. You need upsdrvctl, ups.conf, and any drivers for the
|
||||
hardware on your system.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
More information can be found in the README file, the shutdown.txt document,
|
||||
the upsmon(8) man page and the upsmon.conf(5) man page.
|
||||
|
|
350
INSTALL.nut
350
INSTALL.nut
|
@ -1,350 +0,0 @@
|
|||
Installation instructions
|
||||
=========================
|
||||
|
||||
This chapter describes the various methods for installing Network UPS Tools.
|
||||
|
||||
Whenever it is possible, prefer <<Installing_packages, installing from packages>>.
|
||||
Packagers have done an excellent and hard work at improving NUT integration into
|
||||
their system. On the other hand, distributions and appliances tend to package
|
||||
"official releases" of projects such as NUT, and so do not deliver latest and
|
||||
greatest fixes, new drivers, bugs and other features.
|
||||
|
||||
[[Installing_source]]
|
||||
Installing from source
|
||||
----------------------
|
||||
|
||||
These are the essential steps for compiling and installing this software.
|
||||
|
||||
The NUT linkdoc:packager-guide[Packager Guide], which presents the best
|
||||
practices for installing and integrating NUT, is also a good reading.
|
||||
|
||||
The link:config-prereqs.txt[Prerequisites for building NUT on different OSes]
|
||||
document suggests prerequisite packages with tools and dependencies
|
||||
available and needed to build and test as much as possible of NUT on
|
||||
numerous platforms, written from perspective of CI testing (if you
|
||||
are interested in getting updated drivers for a particular device,
|
||||
you might select a sub-set of those suggestions).
|
||||
|
||||
[NOTE]
|
||||
.Keep in mind that...
|
||||
================================================================================
|
||||
|
||||
- the paths shown below are the default values you get by just calling
|
||||
configure by itself. If you have used --prefix or similar, things will be
|
||||
different. Also, if you didn't install this program from source yourself, the
|
||||
paths will probably have a number of differences.
|
||||
|
||||
- by default, your system probably won't find the man pages, since they
|
||||
install to /usr/local/ups/man. You can fix this by editing your MANPATH, or
|
||||
just do this:
|
||||
|
||||
man -M /usr/local/ups/man <man page>
|
||||
|
||||
- if your favorite system offers up to date binary packages, you should always
|
||||
prefer these over a source installation. Along with the known advantages of such
|
||||
systems for installation, upgrade and removal, there are many integration issues
|
||||
that have been addressed.
|
||||
|
||||
================================================================================
|
||||
|
||||
|
||||
Prepare your system
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
System User creation
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Create at least one system user and a group for running this software. You
|
||||
might call them "ups" and "nut". The exact names aren't important as
|
||||
long as you are consistent.
|
||||
|
||||
The process for doing this varies from one system to the next, and
|
||||
explaining how to add users is beyond the scope of this document.
|
||||
|
||||
For the purposes of this document, the user name and group name
|
||||
will be 'ups' and 'nut' respectively.
|
||||
|
||||
Be sure the new user is a member of the new group! If you forget to
|
||||
do this, you will have problems later on when you try to start upsd.
|
||||
|
||||
|
||||
Build and install
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
[[Configuration]]
|
||||
Configuration
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
Configure the source tree for your system. Add the '--with-user' and
|
||||
'--with-group' switch to set the user name and group that you created
|
||||
above.
|
||||
|
||||
./configure --with-user=ups --with-group=nut
|
||||
|
||||
If you need any other switches for configure, add them here. For example:
|
||||
|
||||
* to build and install USB drivers, add '--with-usb' (note that you
|
||||
need to install libusb development package or files).
|
||||
|
||||
* to build and install SNMP drivers, add '--with-snmp' (note that
|
||||
you need to install libsnmp development package or files).
|
||||
|
||||
* to build and install CGI scripts, add '--with-cgi'.
|
||||
|
||||
See <<Configure_options,Configure options>> from the User Manual,
|
||||
docs/configure.txt or './configure --help' for all the available
|
||||
options.
|
||||
|
||||
If you alter paths with additional switches, be sure to use those
|
||||
new paths while reading the rest of the steps.
|
||||
|
||||
Reference: <<Configure_options,Configure options>> from the
|
||||
User Manual.
|
||||
|
||||
|
||||
Build the programs
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
make
|
||||
|
||||
This will build the NUT client and server programs and the
|
||||
selected drivers. It will also build any other features that were
|
||||
selected during <<Configuration,configuration>> step above.
|
||||
|
||||
|
||||
Installation
|
||||
^^^^^^^^^^^^
|
||||
|
||||
[NOTE]
|
||||
=====================================================================
|
||||
|
||||
you should now gain privileges for installing software if necessary:
|
||||
|
||||
su
|
||||
|
||||
=====================================================================
|
||||
|
||||
Install the files to a system level directory:
|
||||
|
||||
make install
|
||||
|
||||
This will install the compiled programs and man pages, as well as
|
||||
some data files required by NUT. Any optional features selected
|
||||
during configuration will also be installed.
|
||||
|
||||
This will also install sample versions of the NUT configuration
|
||||
files. Sample files are installed with names like ups.conf.sample
|
||||
so they will not overwrite any existing real config files you may
|
||||
have created.
|
||||
|
||||
If you are packaging this software, then you will probably want to
|
||||
use the DESTDIR variable to redirect the build into another place,
|
||||
i.e.:
|
||||
|
||||
make DESTDIR=/tmp/package install
|
||||
make DESTDIR=/tmp/package install-conf
|
||||
|
||||
[[StatePath]]
|
||||
State path creation
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Create the state path directory for the driver(s) and server to use
|
||||
for storing UPS status data and other auxiliary files, and make it
|
||||
group-writable by the group of the system user you created.
|
||||
|
||||
mkdir -p /var/state/ups
|
||||
chmod 0770 /var/state/ups
|
||||
chown root:nut /var/state/ups
|
||||
|
||||
[[Ownership]]
|
||||
Ownership and permissions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Set ownership data and permissions on your serial or USB ports
|
||||
that go to your UPS hardware. Be sure to limit access to just
|
||||
the user you created earlier.
|
||||
|
||||
These examples assume the second serial port (ttyS1) on a typical
|
||||
Slackware system. On FreeBSD, that would be cuaa1. Serial ports
|
||||
vary greatly, so yours may be called something else.
|
||||
|
||||
chmod 0660 /dev/ttyS1
|
||||
chown root:nut /dev/ttyS1
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
FIXME: TBR
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
The setup for USB ports is slightly more complicated. Device files
|
||||
for USB devices, such as /proc/bus/usb/002/001, are usually
|
||||
created "on the fly" when a device is plugged in, and disappear
|
||||
when the device is disconnected. Moreover, the names of these
|
||||
device files can change randomly. To set up the correct
|
||||
permissions for the USB device, you may need to set up (operating
|
||||
system dependent) hotplugging scripts. Sample scripts and
|
||||
information are provided in the scripts/hotplug and
|
||||
scripts/udev directories. For most users, the hotplugging scripts
|
||||
will be installed automatically by "make install".
|
||||
|
||||
(If you want to try if a driver works without setting up
|
||||
hotplugging, you can add the "-u root" option to upsd, upsmon, and
|
||||
drivers; this should allow you to follow the below
|
||||
instructions. However, don't forget to set up the correct
|
||||
permissions later!).
|
||||
|
||||
NOTE: if you are using something like udev or devd, make sure
|
||||
these permissions stay set across a reboot. If they revert to the
|
||||
old values, your drivers may fail to start.
|
||||
|
||||
|
||||
You are now ready to configure NUT, and start testing and using it.
|
||||
|
||||
You can jump directly to the <<Configuration_notes,NUT configuration>>.
|
||||
|
||||
|
||||
[[Installing_packages]]
|
||||
Installing from packages
|
||||
------------------------
|
||||
|
||||
This chapter describes the specific installation steps when using
|
||||
binary packages that exist on various major systems.
|
||||
|
||||
[[Debian]]
|
||||
Debian, Ubuntu and other derivatives
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
NOTE: NUT is packaged and well maintained in these systems.
|
||||
The official Debian packager is part of the NUT Team.
|
||||
|
||||
Using your preferred method (apt-get, aptitude, Synaptic, ...), install
|
||||
the 'nut' package, and optionally the following:
|
||||
|
||||
- 'nut-cgi', if you need the CGI (HTML) option,
|
||||
- 'nut-snmp', if you need the snmp-ups driver,
|
||||
- 'nut-xml', for the netxml-ups driver,
|
||||
- 'nut-powerman-pdu', to control the PowerMan daemon (PDU management)
|
||||
- 'nut-dev', if you need the development files.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
- nut-client
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Configuration files are located in /etc/nut.
|
||||
linkman:nut.conf[5] must be edited to be able to invoke /etc/init.d/nut
|
||||
|
||||
NOTE: Ubuntu users can access the APT URL installation by clicking on link:apt://nut[this link].
|
||||
|
||||
|
||||
[[Mandriva]]
|
||||
Mandriva
|
||||
~~~~~~~~
|
||||
|
||||
NOTE: NUT is packaged and well maintained in these systems.
|
||||
The official Mandriva packager is part of the NUT Team.
|
||||
|
||||
Using your preferred method (urpmi, RPMdrake, ...), install one of the two below
|
||||
packages:
|
||||
|
||||
- 'nut-server' if you have a 'standalone' or 'netserver' installation,
|
||||
- 'nut' if you have a 'netclient' installation.
|
||||
|
||||
Optionally, you can also install the following:
|
||||
|
||||
- 'nut-cgi', if you need the CGI (HTML) option,
|
||||
- 'nut-devel', if you need the development files.
|
||||
|
||||
|
||||
[[SUSE]]
|
||||
SUSE / openSUSE
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
NOTE: NUT is packaged and well maintained in these systems.
|
||||
The official SUSE packager is part of the NUT Team.
|
||||
|
||||
Install the 'nut-classic' package, and optionally the following:
|
||||
|
||||
- 'nut-drivers-net', if you need the snmp-ups or the netxml-ups drivers,
|
||||
- 'nut-cgi', if you need the CGI (HTML) option,
|
||||
- 'nut-devel', if you need the development files,
|
||||
|
||||
NOTE: SUSE and openSUSE users can use the
|
||||
link:http://software.opensuse.org/search?baseproject=ALL&p=1&q=nut[one-click install method]
|
||||
to install NUT.
|
||||
|
||||
|
||||
[[RedHat]]
|
||||
Red Hat, Fedora and CentOS
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
NOTE: NUT is packaged and well maintained in these systems.
|
||||
The official Red Hat packager is part of the NUT Team.
|
||||
|
||||
Using your preferred method (yum, Add/Remove Software, ...), install one of the
|
||||
two below packages:
|
||||
|
||||
- 'nut' if you have a 'standalone' or 'netserver' installation,
|
||||
- 'nut-client' if you have a 'netclient' installation.
|
||||
|
||||
Optionally, you can also install the following:
|
||||
|
||||
- 'nut-cgi', if you need the CGI (HTML) option,
|
||||
- 'nut-xml', if you need the netxml-ups driver,
|
||||
- 'nut-devel', if you need the development files.
|
||||
|
||||
|
||||
[[FreeBSD]]
|
||||
FreeBSD
|
||||
~~~~~~~
|
||||
|
||||
You can either install NUT as a binary package or as a port.
|
||||
|
||||
Binary package
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
To install NUT as a package execute:
|
||||
|
||||
# pkg install nut
|
||||
|
||||
Port
|
||||
^^^^
|
||||
|
||||
The port is located under +sysutils/nut+.
|
||||
Use +make config+ to select configuration options, e.g. to build the optional CGI scripts.
|
||||
To install it, use:
|
||||
|
||||
# make install clean
|
||||
|
||||
USB UPS on FreeBSD
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For USB UPS devices the NUT package/port installs devd rules in +/usr/local/etc/devd/nut-usb.conf+ to set USB device permissions. 'devd' needs to be restarted for these rules to apply:
|
||||
|
||||
# service devd restart
|
||||
|
||||
(Re-)connect the device after restarting 'devd' and check that the USB device has the proper
|
||||
permissions. Check the last entries of the system message buffer. You should
|
||||
find an entry like
|
||||
|
||||
# dmesg | tail
|
||||
[...]
|
||||
ugen0.2: <INNO TECH USB to Serial> at usbus0
|
||||
|
||||
The device file must be owned by group +uucp+ and must be group
|
||||
read-/writable. In the example from above this would be
|
||||
|
||||
# ls -Ll /dev/ugen0.2
|
||||
crw-rw---- 1 root uucp 0xa5 Mar 12 10:33 /dev/ugen0.2
|
||||
|
||||
If the permissions are not correct, verify that your device is registered in
|
||||
+/usr/local/etc/devd/nut-usb.conf+. The vendor and product id can be found
|
||||
using:
|
||||
|
||||
# usbconfig -u 0 -a 2 dump_device_desc
|
||||
|
||||
where +-u+ specifies the USB bus number and +-a+ specifies the USB device index.
|
||||
|
||||
|
||||
You are now ready to configure NUT, and start testing and using it.
|
||||
|
||||
You can jump directly to the
|
||||
<<Configuration_notes,NUT configuration>>.
|
339
LICENSE-GPL2
339
LICENSE-GPL2
|
@ -1,339 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
676
LICENSE-GPL3
676
LICENSE-GPL3
|
@ -1,676 +0,0 @@
|
|||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
14
MAINTAINERS
14
MAINTAINERS
|
@ -37,18 +37,18 @@ S: Maintained: apcsmart, belkin, bestups, cyberpower, dummycons,
|
|||
|
||||
P: Arnaud Quette
|
||||
M: aquette.dev@gmail.com
|
||||
M: ArnaudQuette@eaton.com
|
||||
S: Maintained or Supported: dummy-ups, usbhid-ups, mge-shut
|
||||
mge-utalk, snmp-ups, ...
|
||||
M: arnaud.quette@mgeups.com
|
||||
S: Maintained or Supported: dummy-ups, usbhid-ups, mge-shut, newmge-shut
|
||||
mge-utalk, snmp-ups, HAL support
|
||||
|
||||
P: Arjen de Korte
|
||||
M: arjen@de-korte.org
|
||||
S: Maintained: safenet, genericups, powerpanel, netxml-ups, usbhid-ups
|
||||
|
||||
P: Fabio Di Niro
|
||||
M: blaxwan@users.sourceforge.net
|
||||
S: Maintained: metasys
|
||||
|
||||
P: Kirill Smelkov
|
||||
M: kirr@mns.spb.ru
|
||||
S: Maintained: al175
|
||||
|
||||
Packaging
|
||||
=========
|
||||
|
||||
|
|
289
Makefile.am
289
Makefile.am
|
@ -4,231 +4,31 @@
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# subdirectories to build and distribute. The order matters, as
|
||||
# several subdirectories depend on stuff in "common" or tools being built first
|
||||
SUBDIRS = include common clients conf data docs drivers tools \
|
||||
lib scripts server tests
|
||||
# several subdirectories depend on stuff in "common" being built first
|
||||
SUBDIRS = include common clients conf data docs drivers lib man \
|
||||
tools scripts server
|
||||
|
||||
# Automatically update the libtool script if it becomes out-of-date
|
||||
# See https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status libtool
|
||||
|
||||
# COPYING is included automatically.
|
||||
EXTRA_DIST = INSTALL.nut LICENSE-GPL2 LICENSE-GPL3 MAINTAINERS UPGRADING
|
||||
EXTRA_DIST = MAINTAINERS UPGRADING
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# flags to pass to ./configure when calling "make distcheck" and "make
|
||||
# distcheck-light". Try to check as many features as possible! Also
|
||||
# need to give augeas-lenses-dir, hotplug-dir and udev-dir, so that
|
||||
# staged install does not fail.
|
||||
# need to give hotplug-dir and udev-dir, so that staged install does
|
||||
# not fail.
|
||||
|
||||
DISTCHECK_FLAGS = --with-all --with-ssl --with-doc=auto
|
||||
DISTCHECK_LIGHT_FLAGS = --with-all=auto --with-ssl=auto --with-doc=auto
|
||||
DISTCHECK_VALGRIND_FLAGS = --with-all=auto --with-ssl=auto --with-doc=skip --with-valgrind CXXFLAGS='$(CXXFLAGS) -g' CFLAGS='$(CFLAGS) -g'
|
||||
DISTCHECK_FLAGS = --with-all --with-ssl --with-ipv6
|
||||
DISTCHECK_LIGHT_FLAGS = --with-all=auto --with-ssl=auto --with-ipv6=auto
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \
|
||||
--with-systemdsystemunitdir='$${prefix}/lib/systemd/system' \
|
||||
--with-systemdshutdowndir='$${prefix}/lib/systemd/system-shutdown' \
|
||||
--with-systemdtmpfilesdir='$${prefix}/usr/lib/tmpfiles.d' \
|
||||
--with-augeas-lenses-dir='$${prefix}/usr/share/augeas/lenses' \
|
||||
--with-hotplug-dir='$${prefix}/etc/hotplug' \
|
||||
--with-udev-dir='$${prefix}/etc/udev' \
|
||||
--with-devd-dir='$${prefix}/etc/devd'
|
||||
--with-udev-dir='$${prefix}/etc/udev'
|
||||
|
||||
distcheck-light:
|
||||
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck
|
||||
|
||||
# Make a distcheck (and check in particular) with enabled valgrind and debug info
|
||||
memcheck distcheck-valgrind:
|
||||
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck
|
||||
|
||||
# workaround the dist generated files that are also part of the distribution
|
||||
# Note that distcleancheck is disabled for now, while waiting for a proper
|
||||
# solution, that do not break older unix systems
|
||||
#distcleancheck_listfiles = \
|
||||
# find . -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
|
||||
distcleancheck:
|
||||
@:
|
||||
|
||||
# Quick alias for root dir recipe:
|
||||
realclean: maintainer-clean
|
||||
|
||||
# Files made by our targets:
|
||||
CLEANFILES = *-spellchecked cppcheck*.xml
|
||||
DISTCLEANFILES = ChangeLog
|
||||
|
||||
# Most of the files generated by custom rules in the configure script
|
||||
# or by autogen.sh are cleaned by the Makefile.am in their directories.
|
||||
# Files below are re-created by running `configure` script and may be
|
||||
# wiped by a `make distclean`:
|
||||
DISTCLEANFILES += config.log configure~
|
||||
#???# configure.ac~
|
||||
DISTCLEANFILES += include/config.h.in~
|
||||
|
||||
# Files made by autotools and common rituals of the configure script,
|
||||
# these are needed to run the configure script itself so are not wiped
|
||||
# by a mere `make distclean`; most of these are copied by autotools
|
||||
# from their installation, or made by `automake` etc. on the system
|
||||
# which generates `configure`; rebuilding NUT after deleting these
|
||||
# requires `autogen.sh` script to be re-run (and tools available):
|
||||
MAINTAINERCLEANFILES = INSTALL
|
||||
MAINTAINERCLEANFILES += aclocal.m4 config.guess config.sub
|
||||
MAINTAINERCLEANFILES += configure
|
||||
MAINTAINERCLEANFILES += depcomp install-sh ltmain.sh test-driver
|
||||
MAINTAINERCLEANFILES += m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4
|
||||
MAINTAINERCLEANFILES += Makefile.in .dirstamp include/config.h.in
|
||||
|
||||
# Executed after default rules
|
||||
maintainer-clean-local:
|
||||
rm -f missing || true
|
||||
|
||||
# Do not let $SUBDIRS/Makefile rules delete their local .deps because
|
||||
# this breaks our ability to clean up (e.g. some common/.../*.Plo files
|
||||
# are included by generated Makefiles from other subdirectories, so they
|
||||
# should be available during their clean-up). Just in case, we make sure
|
||||
# here that their sub-distcleans complete first.
|
||||
distclean-local:
|
||||
@for DIR in $(SUBDIRS) ; do \
|
||||
if test -f "$${DIR}/Makefile" ; then \
|
||||
echo " DISTCLEAN in $${DIR}" >&2 ; \
|
||||
( cd "$${DIR}" && $(MAKE) -s distclean ) || exit ; \
|
||||
fi ; \
|
||||
done
|
||||
rm -rf .inst tmp autom4te.cache
|
||||
find "$(builddir)" -type d -name '.deps' | while read DIR ; do rm -rf "$${DIR}" ; done
|
||||
|
||||
# Hook the documentation building and validating recipes
|
||||
# Note: these are optionally available (as determined during configure runs)
|
||||
spellcheck spellcheck-interactive:
|
||||
@RES=0; \
|
||||
(cd $(builddir)/docs && $(MAKE) -s $@) || RES=$$? ; \
|
||||
(cd $(builddir)/docs/man && $(MAKE) -s $@) || RES=$$? ; \
|
||||
(cd $(builddir)/conf && $(MAKE) -s $@) || RES=$$? ; \
|
||||
(cd $(builddir)/data && $(MAKE) -s $@) || RES=$$? ; \
|
||||
exit $$RES
|
||||
|
||||
# Note: the "all-docs" and "check-docs" targets may require tools not
|
||||
# found by `configure` script (and so avoided by conventional recipes)
|
||||
# such as PDF generators, so it should only be called at developer's
|
||||
# discretion, choice and risk. The "check-man" targets covers source
|
||||
# texts, man pages and HTML rendering of man pages, as enabled by tools.
|
||||
doc spellcheck-sortdict \
|
||||
all-docs check-docs \
|
||||
man all-man man-man check-man man-html all-html:
|
||||
cd $(builddir)/docs && $(MAKE) $@
|
||||
|
||||
check-NIT check-NIT-devel:
|
||||
cd $(builddir)/tests/NIT && $(MAKE) $@
|
||||
|
||||
# This target adds syntax-checking for committed shell script files,
|
||||
# to avoid surprises and delays in finding fatal typos after packaging
|
||||
###
|
||||
### Note: currently, shellcheck target calls check-scripts-syntax
|
||||
### so when both are invoked at once, in the end the check is only
|
||||
### executed once. Later it is anticipated that shellcheck would
|
||||
### be implemented by requiring, configuring and calling the tool
|
||||
### named "shellcheck" for even more code inspection and details.
|
||||
### Still, there remains value in also checking the script syntax
|
||||
### by the very version of the shell interpreter that would run
|
||||
### these scripts in production usage of the resulting packages.
|
||||
###
|
||||
check-scripts-syntax:
|
||||
@echo 'NOTE: modern bash complains about scripts using backticks (warning not error), which we ignore in NUT codebase for portability reasons: `...` obsolete, use $$(...)'
|
||||
@RUNBASH=bash; if [ -x /bin/bash ]; then RUNBASH=/bin/bash ; else if [ -x /usr/bin/env ] ; then RUNBASH="/usr/bin/env bash"; fi; fi ; \
|
||||
for F in `git ls-files || find . -type f` ; do \
|
||||
case "`file "$$F"`" in \
|
||||
*"Bourne-Again shell script"*) ( set -x ; $$RUNBASH -n "$$F" ; ) ;; \
|
||||
*"POSIX shell script"*|*"shell script"*) ( set -x ; /bin/sh -n "$$F" ; ) ;; \
|
||||
esac || { RES=$$? ; echo "ERROR: Syntax check failed for script file: $$F" >&2 ; exit $$RES ; } ; \
|
||||
done
|
||||
@echo 'SUCCESS: Shell scripts syntax is acceptable, no fatal issues were found'
|
||||
|
||||
shellcheck-disclaimer:
|
||||
@echo "==============================================================================="
|
||||
@echo "NOTICE: 'make shellcheck' is currently an alias for 'make check-scripts-syntax'"
|
||||
@echo "Later it may become a call to the real shellcheck tool (if available on the"
|
||||
@echo "build system during the configure phase)"
|
||||
@echo "==============================================================================="
|
||||
|
||||
# Note: currently not part of shellcheck target, because the script below
|
||||
# can test the logic with numerous SHELL_PROGS in a CI setting, and because
|
||||
# check-scripts-syntax probably has checked the basic syntax above already.
|
||||
shellcheck-nde:
|
||||
cd $(srcdir)/tests && SERVICE_FRAMEWORK="selftest" ./nut-driver-enumerator-test.sh
|
||||
|
||||
shellcheck: shellcheck-disclaimer check-scripts-syntax
|
||||
|
||||
CPPCHECK = @CPPCHECK@
|
||||
if HAVE_CPPCHECK
|
||||
cppcheck: cppcheck-cxx11.xml cppcheck-c99.xml
|
||||
|
||||
# Let the analysis get regenerated due to any change in source;
|
||||
# but note that with our different make implementations to support,
|
||||
# we can not either $(shell find ...) nor blindly say e.g. *.cpp
|
||||
# for each FS structure layer because e.g. there are no ./*.cpp
|
||||
# in the root dir of the codebase (and so make complains there is
|
||||
# `No rule to make target `*.cpp', needed by `cppcheck-cxx11.xml'`)
|
||||
#
|
||||
# Note that the actual `cppcheck` scan finds all files it likes
|
||||
# (so if CPPCHECK_SRC_* misses something, it just won't trigger
|
||||
# automagically a rebuild of the XML in developer working cycles).
|
||||
CPPCHECK_SRC_H = $(top_srcdir)/*/*.h $(top_srcdir)/*/*/*.h
|
||||
# CPPCHECK_SRC_H += $(top_srcdir)/*.h
|
||||
|
||||
CPPCHECK_SRC_C = $(top_srcdir)/*/*.c $(top_srcdir)/*/*/*.c
|
||||
# CPPCHECK_SRC_C += $(top_srcdir)/*.cpp
|
||||
|
||||
CPPCHECK_SRC_CXX = $(top_srcdir)/*/*.cpp
|
||||
# CPPCHECK_SRC_CXX += $(top_srcdir)/*.cpp $(top_srcdir)/*/*/*.cpp
|
||||
|
||||
cppcheck-cxx11.xml: $(CPPCHECK_SRC_CXX) $(CPPCHECK_SRC_H)
|
||||
$(CPPCHECK) --std=c++11 --enable=all --inconclusive --xml --xml-version=2 . 2>$@
|
||||
|
||||
cppcheck-c99.xml: $(CPPCHECK_SRC_C) $(CPPCHECK_SRC_H)
|
||||
$(CPPCHECK) --std=c99 --enable=all --inconclusive --xml --xml-version=2 . 2>$@
|
||||
else !HAVE_CPPCHECK
|
||||
cppcheck:
|
||||
@echo "CPPCHECK analysis not available since 'cppcheck' was not found."
|
||||
endif !HAVE_CPPCHECK
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Automatically generate the ChangeLog from Git logs:
|
||||
MAINTAINERCLEANFILES += ChangeLog
|
||||
|
||||
# Older boundary of the ChangeLog commits range
|
||||
# It can be a tag ('v2.2.0'), a commit hash, a date, ...
|
||||
# See gitrevisions for more information on specifying ranges
|
||||
GITLOG_START_POINT=v2.6.0
|
||||
|
||||
# Force ChangeLog regeneration upon make dist (due to nonexistant 'dummy-stamp'),
|
||||
# in case it has already been generated previously
|
||||
# Note that the script is hard-coded to generate "ChangeLog" in the current dir
|
||||
dummy-stamp:
|
||||
ChangeLog: tools/gitlog2changelog.py dummy-stamp
|
||||
cd $(top_builddir) && \
|
||||
./tools/gitlog2changelog.py $(GITLOG_START_POINT) || \
|
||||
{ echo "gitlog2changelog.py failed to generate the ChangeLog. See https://github.com/networkupstools/nut/commits/master" > $@ ; }
|
||||
|
||||
nut_version.h include/nut_version.h:
|
||||
cd $(abs_top_builddir)/include && $(MAKE) nut_version.h
|
||||
|
||||
tools/gitlog2changelog.py: tools/gitlog2changelog.py.in
|
||||
cd $(@D) && $(MAKE) -s $(@F)
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Maintainers targets: distribution signature and hashes
|
||||
nut-@PACKAGE_VERSION@.tar.gz: dist
|
||||
nut-@PACKAGE_VERSION@.tar.gz.sig: dist-sig
|
||||
nut-@PACKAGE_VERSION@.tar.gz.md5 nut-@PACKAGE_VERSION@.tar.gz.sha256: dist-hash
|
||||
|
||||
dist-sig: nut-@PACKAGE_VERSION@.tar.gz
|
||||
rm -f nut-@PACKAGE_VERSION@.tar.gz.sig
|
||||
gpg --detach-sign nut-@PACKAGE_VERSION@.tar.gz
|
||||
|
||||
dist-hash: nut-@PACKAGE_VERSION@.tar.gz
|
||||
md5sum nut-@PACKAGE_VERSION@.tar.gz > nut-@PACKAGE_VERSION@.tar.gz.md5
|
||||
sha256sum nut-@PACKAGE_VERSION@.tar.gz > nut-@PACKAGE_VERSION@.tar.gz.sha256
|
||||
distcleancheck_listfiles = \
|
||||
find . -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# targets from old build system (pre-automake).
|
||||
|
@ -268,14 +68,14 @@ install-dirs:
|
|||
@echo "Warning: 'make install-dirs' is deprecated."
|
||||
@echo "Use 'make installdirs' instead."
|
||||
@echo $(WARN)
|
||||
$(MAKE) installdirs
|
||||
make installdirs
|
||||
cgi build-cgi install-cgi install-cgi-dir install-cgi-bin \
|
||||
install-cgi-man install-cgi-conf install-cgi-html:
|
||||
@echo "Error: 'make $@' no longer exists."
|
||||
@echo "Use './configure --with-cgi' instead."
|
||||
install-lib:
|
||||
@echo "Error: 'make $@' no longer exists."
|
||||
@echo "Use './configure --with-dev' instead."
|
||||
@echo "Use './configure --with-lib' instead."
|
||||
usb build-usb install-usb:
|
||||
@echo "Error: 'make $@' no longer exists."
|
||||
@echo "Use './configure --with-usb' instead."
|
||||
|
@ -284,65 +84,4 @@ snmp build-snmp install-snmp install-snmp-mgr install-snmp-man:
|
|||
@echo "Use './configure --with-snmp' instead."
|
||||
setver:
|
||||
@echo "Error: 'make setver' no longer exists."
|
||||
@echo "Edit configure.ac to set version number."
|
||||
|
||||
# Clean the dist tarball and packages
|
||||
MAINTAINERCLEANFILES_DISTBALL = nut-*.tar.gz
|
||||
# HP-UX:
|
||||
MAINTAINERCLEANFILES_PACKAGES = NUT_HPUX_package@PACKAGE_VERSION@.depot
|
||||
# AIX as below, and RedHat-compatible (cover binary and source packages):
|
||||
MAINTAINERCLEANFILES_PACKAGES += nut*rpm
|
||||
# Debian-compatible (cover binary and source packages):
|
||||
MAINTAINERCLEANFILES_PACKAGES += nut*deb
|
||||
# Solaris SVR4 package archives:
|
||||
MAINTAINERCLEANFILES_PACKAGES += NUT_solaris_*_package@PACKAGE_VERSION@.local.gz
|
||||
# Newer Solaris IPS (aka "pkg(5)" format archives)
|
||||
MAINTAINERCLEANFILES_PACKAGES += *.p5p
|
||||
|
||||
MAINTAINERCLEANFILES += $(MAINTAINERCLEANFILES_DISTBALL)
|
||||
MAINTAINERCLEANFILES += $(MAINTAINERCLEANFILES_PACKAGES)
|
||||
|
||||
package: dist
|
||||
DESTDIR="$(abs_builddir)/_install_pkgprotodir" ; export DESTDIR; \
|
||||
rm -rf "$$DESTDIR"; \
|
||||
case "`uname -s`" in \
|
||||
"HP-UX") \
|
||||
( cd scripts/HP-UX && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" package && \
|
||||
mv NUT_HPUX_package.depot $(abs_top_builddir)/NUT_HPUX_package@PACKAGE_VERSION@.depot ) ;; \
|
||||
"SunOS") \
|
||||
$(MAKE) $(AM_MAKEFLAGS) && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" install && \
|
||||
( cd scripts/Solaris && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" package ) && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" uninstall && \
|
||||
rm -rf "$$DESTDIR" || \
|
||||
{ echo "FAILED to produce SunOS packages, inspect '$$DESTDIR' for clues" >&2 ; exit 1; } ;; \
|
||||
"AIX") \
|
||||
if test -d /usr/src/packages/SPECS -a -w /usr/src/packages/SPECS ; then : ; else echo "Can not write to /usr/src/packages/SPECS" >&2 ; exit 1; fi ; \
|
||||
if test -d /usr/src/packages/SOURCES -a -w /usr/src/packages/SOURCES ; then : ; else echo "Can not write to /usr/src/packages/SOURCES" >&2 ; exit 1; fi ; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) dist && \
|
||||
cp scripts/Aix/nut-aix.spec /usr/src/packages/SPECS && \
|
||||
cp scripts/Aix/nut.init nut-@PACKAGE_VERSION@.tar.gz /usr/src/packages/SOURCES && \
|
||||
rpm -ba /usr/src/packages/SPECS/nut-aix.spec && \
|
||||
mv /usr/src/packages/RPMS/nut*rpm $(abs_top_builddir)/ ;; \
|
||||
*) echo "Unsupported OS for 'make $@' (no recipe bound)" >&2; exit 1;; \
|
||||
esac
|
||||
|
||||
print-MAINTAINERCLEANFILES print-REALCLEANFILES:
|
||||
@echo $(MAINTAINERCLEANFILES)
|
||||
|
||||
print-DISTCLEANFILES:
|
||||
@echo $(DISTCLEANFILES)
|
||||
|
||||
# TODO: Recursive mode to consider patterns defined in sub-dir makefiles
|
||||
git-realclean-check:
|
||||
@if test -e .git && (command -v git); then \
|
||||
git status --ignored || while read F ; do \
|
||||
for P in $(MAINTAINERCLEANFILES) ; do \
|
||||
case "$$F" in \
|
||||
*/$$P) exit 1 ;; \
|
||||
esac ; \
|
||||
done; \
|
||||
done ; \
|
||||
fi
|
||||
@echo "Edit configure.in to set version number."
|
||||
|
|
845
Makefile.in
845
Makefile.in
File diff suppressed because it is too large
Load diff
619
README
619
README
|
@ -1,111 +1,144 @@
|
|||
Network UPS Tools Overview
|
||||
===========================
|
||||
=================================
|
||||
Network UPS Tools Documentation
|
||||
=================================
|
||||
|
||||
:Info: Program support page: <http://www.networkupstools.org/>
|
||||
:Author: Arnaud Quette <aquette.dev@gmail.com> and others, see AUTHORS file.
|
||||
:Copyright: Released under the GNU GPL - see COPYING for details.
|
||||
|
||||
Mailing list details: http://alioth.debian.org/mail/?group_id=30602
|
||||
|
||||
.. contents::
|
||||
|
||||
===========
|
||||
Description
|
||||
-----------
|
||||
===========
|
||||
|
||||
Network UPS Tools is a collection of programs which provide a common
|
||||
interface for monitoring and administering UPS, PDU and SCD hardware.
|
||||
It uses a layered approach to connect all of the parts.
|
||||
interface for monitoring and administering UPS and PDU hardware. NUT comes in
|
||||
two flavors: the "classic" and the "HAL enabled" one.
|
||||
|
||||
The "classic" flavor
|
||||
--------------------
|
||||
|
||||
It is the standard installation that uses a layered approach to connect
|
||||
all of the NUT parts.
|
||||
|
||||
Drivers are provided for a wide assortment of equipment. They
|
||||
understand the specific language of each device and map it back to a
|
||||
compatibility layer. This means both an expensive high end UPS, a simple
|
||||
"power strip" PDU, or any other power device can be handled transparently with
|
||||
a uniform management interface.
|
||||
compatibility layer. This means both an expensive "smart" protocol UPS
|
||||
and a simple "power strip" model can be handled transparently.
|
||||
|
||||
This information is cached by the network server `upsd`, which then
|
||||
This information is cached by the network server ``upsd``, which then
|
||||
answers queries from the clients. upsd contains a number of access
|
||||
control features to limit the abilities of the clients. Only authorized
|
||||
hosts may monitor or control your hardware if you wish. Since the
|
||||
notion of monitoring over the network is built into the software, you
|
||||
can hang many systems off one large UPS, and they will all shut down
|
||||
together. You can also use NUT to power on, off or cycle your data center
|
||||
nodes, individually or globally through PDU outlets.
|
||||
can hang many systems off one large UPS and they will all shut down
|
||||
together. You can also use NUT to power on, off or cycle your data centers
|
||||
nodes, individually or globally through PDUs outlets.
|
||||
|
||||
Clients such as `upsmon` check on the status of the hardware and do things
|
||||
Clients such as upsmon check on the status of the hardware and do things
|
||||
when necessary. The most important task is shutting down the operating
|
||||
system cleanly before the UPS runs out of power. Other programs are
|
||||
also provided to log information regularly, monitor status through your
|
||||
also provided to log UPS status regularly, monitor status through your
|
||||
web browser, and more.
|
||||
|
||||
The "HAL enabled" flavor
|
||||
------------------------
|
||||
|
||||
This one is intended for use:
|
||||
|
||||
- with supported USB UPS,
|
||||
- on HAL enabled systems (Linux, FreeBSD, Sun Solaris),
|
||||
- on HAL enabled desktops (Gnome and possibly KDE)
|
||||
|
||||
Using this approach, you don't have to configure NUT files, nor to
|
||||
manually start components, nor to install a specific NUT client.
|
||||
|
||||
Upon plugging your USB UPS, the right driver will be automatically
|
||||
launched, and the according Power Manager GUI will pop up.
|
||||
|
||||
Note that this feature is still beta and incomplete. But it
|
||||
represents a major evolution, and a huge user experience improvement!
|
||||
|
||||
For more information, refer to INSTALL and docs/nut-hal.txt.
|
||||
|
||||
==========
|
||||
Installing
|
||||
----------
|
||||
==========
|
||||
|
||||
If you are installing these programs for the first time, go read the
|
||||
<<_installation_instructions,installation instructions>>
|
||||
to find out how to do that. This document contains more information on what all
|
||||
of this stuff does.
|
||||
INSTALL file to find out how to do that. This document contains more
|
||||
information on what all of this stuff does.
|
||||
|
||||
|
||||
=========
|
||||
Upgrading
|
||||
---------
|
||||
=========
|
||||
|
||||
When upgrading from an older version, always check the
|
||||
<<Upgrading_notes,upgrading notes>> to see what may have
|
||||
changed. Compatibility issues and other changes will be listed there to ease
|
||||
the process.
|
||||
|
||||
|
||||
Configuring and using
|
||||
---------------------
|
||||
|
||||
Once NUT is installed, refer to the
|
||||
<<Configuration_notes,configuration notes>> for directions.
|
||||
When upgrading from an older version, always check the UPGRADING file to
|
||||
see what may have changed. Compatibility issues and other changes will
|
||||
be listed there to ease the process.
|
||||
|
||||
|
||||
=============
|
||||
Documentation
|
||||
-------------
|
||||
=============
|
||||
|
||||
This is just an overview of the software. You should read the man pages,
|
||||
included example configuration files, and auxiliary documentation for the parts
|
||||
that you intend to use.
|
||||
This file gives an overview of the software. You should read the man
|
||||
pages, included example configuration files, and auxiliary documentation
|
||||
for the parts that you intend to use.
|
||||
|
||||
|
||||
===================
|
||||
Network Information
|
||||
-------------------
|
||||
===================
|
||||
|
||||
These programs are designed to share information over the network. In
|
||||
the examples below, `localhost` is used as the hostname. This can also
|
||||
the examples below, ``localhost`` is used as the hostname. This can also
|
||||
be an IP address or a fully qualified domain name. You can specify a
|
||||
port number if your upsd process runs on another port.
|
||||
|
||||
In the case of the program `upsc`, to view the variables on the UPS called
|
||||
sparky on the `upsd` server running on the local machine, you'd do this:
|
||||
In the case of the program ``upsc``, to view the variables on the UPS called
|
||||
sparky on the ``upsd`` server running on the local machine, you'd do this::
|
||||
|
||||
/usr/local/ups/bin/upsc sparky@localhost
|
||||
|
||||
The default port number is 3493. You can change this with
|
||||
"configure --with-port" at compile-time. To make a client talk to upsd
|
||||
on a specific port, add it after the hostname with a colon, like this:
|
||||
on a specific port, add it after the hostname with a colon, like this::
|
||||
|
||||
/usr/local/ups/bin/upsc sparky@localhost:1234
|
||||
|
||||
This is handy when you have a mixed environment and some of the systems
|
||||
are on different ports.
|
||||
|
||||
The general form for UPS identifiers is this:
|
||||
The general form for UPS identifiers is this::
|
||||
|
||||
<upsname>[@<hostname>[:<port>]]
|
||||
|
||||
Keep this in mind when viewing the examples below.
|
||||
|
||||
|
||||
========
|
||||
Manifest
|
||||
--------
|
||||
========
|
||||
|
||||
This package is broken down into several categories:
|
||||
|
||||
- *drivers* - These programs talk directly to your UPS hardware.
|
||||
- *server* - upsd serves data from the drivers to the network.
|
||||
- *clients* - They talk to upsd and do things with the status data.
|
||||
- *cgi-bin* - Special class of clients that you can use with your web server.
|
||||
- *scripts* - Contains various scripts, like the Perl and Python binding,
|
||||
integration bits and applications.
|
||||
|
||||
- *server* - upsd serves data from the drivers to the network.
|
||||
|
||||
- *clients* - They talk to upsd and do things with the status data.
|
||||
|
||||
- *cgi-bin* - Special class of clients that you can use with your web server.
|
||||
|
||||
|
||||
=======
|
||||
Drivers
|
||||
-------
|
||||
=======
|
||||
|
||||
These programs provide support for specific UPS models. They understand
|
||||
the protocols and port specifications which define status information
|
||||
|
@ -113,226 +146,170 @@ and convert it to a form that upsd can understand.
|
|||
|
||||
To configure drivers, edit ups.conf. For this example, we'll have a UPS
|
||||
called "sparky" that uses the apcsmart driver and is connected to
|
||||
`/dev/ttyS1`. That's the second serial port on most Linux-based systems.
|
||||
The entry in `ups.conf` looks like this:
|
||||
``/dev/ttyS1``. That's the second serial port on most Linux-based systems.
|
||||
The entry in ``ups.conf`` looks like this::
|
||||
|
||||
[sparky]
|
||||
driver = apcsmart
|
||||
port = /dev/ttyS1
|
||||
|
||||
To start and stop drivers, use upsdrvctl of upsdrvsvcctl (installed on
|
||||
operating systems with a service management framework supported by NUT).
|
||||
By default, it will start or stop every UPS in the config file:
|
||||
To start and stop drivers, use upsdrvctl. By default, it will start or
|
||||
stop every UPS in the config file::
|
||||
|
||||
/usr/local/ups/sbin/upsdrvctl start
|
||||
/usr/local/ups/sbin/upsdrvctl stop
|
||||
/usr/local/ups/bin/upsdrvctl start
|
||||
/usr/local/ups/bin/upsdrvctl stop
|
||||
|
||||
However, you can also just start or stop one by adding its name:
|
||||
However, you can also just start or stop one by adding its name::
|
||||
|
||||
/usr/local/ups/sbin/upsdrvctl start sparky
|
||||
/usr/local/ups/sbin/upsdrvctl stop sparky
|
||||
/usr/local/ups/bin/upsdrvctl start sparky
|
||||
/usr/local/ups/bin/upsdrvctl stop sparky
|
||||
|
||||
On operating systems with a supported service management framework,
|
||||
you might wrap your NUT drivers into individual services instances
|
||||
with:
|
||||
|
||||
/usr/local/ups/sbin/upsdrvsvcctl resync
|
||||
|
||||
and then manage those service instances with commands like:
|
||||
|
||||
/usr/local/ups/sbin/upsdrvsvcctl start sparky
|
||||
/usr/local/ups/sbin/upsdrvsvcctl stop sparky
|
||||
|
||||
To find the driver name for your device, refer to the section below
|
||||
To get the driver name for your device, refer to the below section
|
||||
called "HARDWARE SUPPORT TABLE".
|
||||
|
||||
Extra Settings
|
||||
~~~~~~~~~~~~~~
|
||||
--------------
|
||||
|
||||
Some drivers may require additional settings to properly communicate
|
||||
with your hardware. If it doesn't detect your UPS by default, check the
|
||||
driver's man page or help (-h) to see which options are available.
|
||||
|
||||
For example, the usbhid-ups driver allows you to use USB serial numbers to
|
||||
distinguish between units via the "serial" configuration option. To use this
|
||||
feature, just add another line to your ups.conf section for that UPS:
|
||||
For example, the apcsmart driver allows setting "cable" to "940-0095B".
|
||||
To use this feature, just add another line to your ups.conf section for
|
||||
that UPS::
|
||||
|
||||
[sparky]
|
||||
driver = usbhid-ups
|
||||
port = auto
|
||||
serial = 1234567890
|
||||
driver = apcsmart
|
||||
port = /dev/ttyS1
|
||||
cable = 940-0095B
|
||||
|
||||
Hardware Compatibility List
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Hardware Support Table
|
||||
----------------------
|
||||
|
||||
The <<HCL,Hardware Compatibility List>> is available in the source directory
|
||||
('nut-X.Y.Z/data/driver.list'), and is generally distributed with packages.
|
||||
The NUT Hardware support table is available in the source directory:
|
||||
|
||||
nut-X.Y.Z/data/driver.list
|
||||
|
||||
This one should also be distributed with your favorite packages.
|
||||
For example, it is available on Debian systems as:
|
||||
|
||||
/usr/share/nut/driver.list
|
||||
|
||||
This table is also available link:http://www.networkupstools.org/stable-hcl.html[online].
|
||||
For another take on this list, try the web page:
|
||||
|
||||
http://random.networkupstools.org/compat/
|
||||
|
||||
If your driver has vanished, see the link:FAQ.html[FAQ] and
|
||||
<<Upgrading_notes,Upgrading notes>>.
|
||||
If your driver has vanished, see the FAQ and UPGRADING files.
|
||||
|
||||
Generic Device Drivers
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
Generic UPS Driver
|
||||
------------------
|
||||
|
||||
NUT provides several generic drivers that support a variety of very similar models.
|
||||
|
||||
- The `genericups` driver supports many serial models that use the same basic
|
||||
The ``genericups`` driver will support many models that use the same basic
|
||||
principle to communicate with the computer. This is known as "contact
|
||||
closure", and basically involves raising or lowering signals to indicate
|
||||
power status.
|
||||
+
|
||||
|
||||
This type of UPS tends to be cheaper, and only provides the very simplest
|
||||
data about power and battery status. Advanced features like battery
|
||||
charge readings and such require a "smart" UPS and a driver which
|
||||
supports it.
|
||||
+
|
||||
See the linkman:genericups[8] man page for more information.
|
||||
|
||||
- The `usbhid-ups` driver attempts to communicate with USB HID Power Device
|
||||
Class (PDC) UPSes. These units generally implement the same basic protocol,
|
||||
with minor variations in the exact set of supported attributes. This driver
|
||||
also applies several correction factors when the UPS firmware reports values
|
||||
with incorrect scale factors.
|
||||
+
|
||||
See the linkman:usbhid-ups[8] man page for more information.
|
||||
See the genericups(8) man page for more information.
|
||||
|
||||
- The `blazer_ser` and `blazer_usb` drivers supports the Megatec / Q1
|
||||
protocol that is used in many brands (Blazer, Energy Sistem, Fenton
|
||||
Technologies, Mustek and many others).
|
||||
+
|
||||
See the linkman:blazer[8] man page for more information.
|
||||
|
||||
- The `snmp-ups` driver handles various SNMP enabled devices, from many
|
||||
different manufacturers. In SNMP terms, `snmp-ups` is a manager, that
|
||||
monitors SNMP agents.
|
||||
+
|
||||
See the linkman:snmp-ups[8] man page for more information.
|
||||
|
||||
- The `powerman-pdu` is a bridge to the PowerMan daemon, thus handling all
|
||||
PowerMan supported devices. The PowerMan project supports several serial
|
||||
and networked PDU, along with Blade and IPMI enabled servers.
|
||||
+
|
||||
See the linkman:powerman-pdu[8] man page for more
|
||||
information.
|
||||
|
||||
- The `apcupsd-ups` driver is a bridge to the Apcupsd daemon, thus handling
|
||||
all Apcupsd supported devices. The Apcupsd project supports many serial,
|
||||
USB and networked APC UPS.
|
||||
+
|
||||
See the linkman:apcupsd-ups[8] man page for more information.
|
||||
There is also a document called contact-closure.txt included with the
|
||||
source distribution that contains information on this kind of hardware
|
||||
and details on adding additional types to the genericups driver.
|
||||
|
||||
UPS Shutdowns
|
||||
~~~~~~~~~~~~~
|
||||
-------------
|
||||
|
||||
upsdrvctl can also shut down (power down) all of your UPS hardware.
|
||||
|
||||
WARNING: if you play around with this command, expect your filesystems
|
||||
to die. Don't power off your computers unless they're ready for it:
|
||||
**WARNING:** if you play around with this command, expect your filesystems
|
||||
to die. Don't power off your computers unless they're ready for it::
|
||||
|
||||
/usr/local/ups/sbin/upsdrvctl shutdown
|
||||
/usr/local/ups/sbin/upsdrvctl shutdown sparky
|
||||
/usr/local/ups/bin/upsdrvctl shutdown
|
||||
/usr/local/ups/bin/upsdrvctl shutdown sparky
|
||||
|
||||
You should read the <<UPS_shutdown,Configuring automatic UPS shutdowns>>
|
||||
chapter to learn more about when to use this feature. If called at the wrong
|
||||
time, you may cause data loss by turning off a system with a filesystem
|
||||
You should read the shutdown.txt file in the docs subdirectory to
|
||||
learn more about when to use this feature. If called at the wrong time,
|
||||
you may cause data loss by turning off a system with a filesystem
|
||||
mounted read-write.
|
||||
|
||||
Power distribution unit management
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
NUT also provides an advanced support for power distribution units.
|
||||
|
||||
You should read the <<outlet_management,NUT outlets management and PDU notes>>
|
||||
chapter to learn more about when to use this feature.
|
||||
|
||||
==============
|
||||
Network Server
|
||||
--------------
|
||||
==============
|
||||
|
||||
`upsd` is responsible for passing data from the drivers to the client
|
||||
programs via the network. It should be run immediately after `upsdrvctl`
|
||||
``upsd`` is responsible for passing data from the drivers to the client
|
||||
programs via the network. It should be run immediately after ``upsdrvctl``
|
||||
in your system's startup scripts.
|
||||
|
||||
`upsd` should be kept running whenever possible, as it is the only source
|
||||
of status information for the monitoring clients like `upsmon`.
|
||||
``upsd`` should be kept running whenever possible, as it is the only source
|
||||
of status information for the monitoring clients like ``upsmon``.
|
||||
|
||||
|
||||
Monitoring client
|
||||
-----------------
|
||||
======
|
||||
upsmon
|
||||
======
|
||||
|
||||
`upsmon` provides the essential feature that you expect to find in UPS
|
||||
``upsmon`` provides the essential feature that you expect to find in UPS
|
||||
monitoring software: safe shutdowns when the power fails.
|
||||
|
||||
In the layered scheme of NUT software, it is a client. It has this
|
||||
separate section in the documentation since it is so important.
|
||||
|
||||
You configure it by telling it about UPSes that you want to monitor in
|
||||
upsmon.conf. Each UPS can be defined as one of two possible types:
|
||||
a "primary" or "secondary".
|
||||
upsmon.conf. Each UPS can be defined as one of three possible types:
|
||||
|
||||
Primary
|
||||
~~~~~~~
|
||||
- Master
|
||||
|
||||
The monitored UPS possibly supplies power to this system running `upsmon`,
|
||||
but more importantly -- this system can manage the UPS (typically, this
|
||||
instance of `upsmon` runs on the same system as the `upsd` and driver(s)):
|
||||
it is capable and responsible for shutting it down when the battery is
|
||||
depleted (or in another approach, lingering to deplete it or to tell the
|
||||
UPS to reboot its load after too much time has elapsed and this system
|
||||
is still alive -- meaning wall power returned at a "wrong" moment).
|
||||
This UPS supplies power to the system running upsmon, and
|
||||
this system is also responsible for shutting it down when
|
||||
the battery is depleted. This occurs after any slave systems
|
||||
have disconnected safely.
|
||||
|
||||
The shutdown of this (primary) system itself, as well as eventually an
|
||||
UPS shutdown, occurs after any secondary systems ordered to shut down
|
||||
first have disconnected, or a critical urgency threshold was passed.
|
||||
If your UPS is plugged directly into a system's serial port,
|
||||
the upsmon on that system should define that UPS as a master.
|
||||
|
||||
If your UPS is plugged directly into a system's serial or USB port, the
|
||||
`upsmon` process on that system should define its relation to that UPS
|
||||
as a primary. It may be more complicated for higher-end UPSes with a
|
||||
shared network management capability (typically via SNMP) or several
|
||||
serial/USB ports that can be used simultaneously, and depends on what
|
||||
vendors and drivers implement. Setups with several competing primaries
|
||||
(for redundancy) are technically possible, if each one runs its own
|
||||
full stack of NUT, but results can be random (currently NUT does not
|
||||
provide a way to coordinate several entities managing the same device).
|
||||
- Slave
|
||||
|
||||
This UPS supplies power to the system running upsmon, but
|
||||
this system can't shut it down directly. This system will
|
||||
shut down the operating system before the master turns off the
|
||||
power.
|
||||
|
||||
Use this mode when you run multiple computers on the same UPS.
|
||||
Obviously, only one can be connected to the serial port on the
|
||||
UPS, and that system is the master. Everything else is a
|
||||
slave.
|
||||
|
||||
- Monitor-only
|
||||
|
||||
This UPS will still generate notifications about status
|
||||
changes (on battery, on line, etc.) but no shutdowns of the
|
||||
local system result from critical situations on that UPS.
|
||||
|
||||
For a typical home user, there's one computer connected to one UPS.
|
||||
That means you would run on the same computer the whole NUT stack --
|
||||
a suitable driver, `upsd`, and `upsmon` in primary mode.
|
||||
|
||||
Secondary
|
||||
~~~~~~~~~
|
||||
|
||||
The monitored UPS may supply power to the system running `upsmon` (or
|
||||
alternatively, it may be a monitoring station with zero PSUs fed by
|
||||
that UPS), but more importantly, this system can't manage the UPS --
|
||||
e.g. shut it down directly (through a locally running NUT driver).
|
||||
|
||||
Use this mode when you run multiple computers on the same UPS.
|
||||
Obviously, only one can be connected to the serial or USB port
|
||||
on a typical UPS, and that system is the primary. Everything
|
||||
else is a secondary.
|
||||
|
||||
For a typical home user, there's one computer connected to one UPS.
|
||||
That means you run a driver, `upsd`, and `upsmon` in primary mode.
|
||||
That means you run a driver, upsd, and upsmon in master mode.
|
||||
|
||||
Additional Information
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
----------------------
|
||||
|
||||
More information on configuring upsmon can be found in these places:
|
||||
|
||||
- The linkman:upsmon[8] man page
|
||||
- <<BigServers,Typical setups for big servers>>
|
||||
- <<UPS_shutdown,Configuring automatic UPS shutdowns>> chapter
|
||||
- The stock `upsmon.conf` that comes with the package
|
||||
- The man page - upsmon(8)
|
||||
|
||||
- big-servers.txt in the docs subdirectory
|
||||
|
||||
- shutdown.txt in the docs subdirectory
|
||||
|
||||
- The stock upsmon.conf that comes with the package
|
||||
|
||||
|
||||
=======
|
||||
Clients
|
||||
-------
|
||||
=======
|
||||
|
||||
Clients talk to upsd over the network and do useful things with the data
|
||||
from the drivers. There are tools for command line access, and a few
|
||||
|
@ -342,48 +319,48 @@ programs.
|
|||
For more details on specific programs, refer to their man pages.
|
||||
|
||||
upsc
|
||||
~~~~
|
||||
----
|
||||
|
||||
`upsc` is a simple client that will display the values of variables known
|
||||
to `upsd` and your UPS drivers. It will list every variable by default,
|
||||
upsc is a simple client that will display the values of variables known
|
||||
to upsd and your UPS drivers. It will list every variable by default,
|
||||
or just one if you specify an additional argument. This can be useful
|
||||
in shell scripts for monitoring something without writing your own
|
||||
network code.
|
||||
|
||||
`upsc` is a quick way to find out if your driver(s) and upsd are working
|
||||
together properly. Just run `upsc <ups>` to see what's going on, i.e.:
|
||||
upsc is a quick way to find out if your driver(s) and upsd are working
|
||||
together properly. Just run upsc <ups> to see what's going on, i.e.::
|
||||
|
||||
morbo:~$ upsc sparky@localhost
|
||||
morbo:~$ upsc su700@localhost
|
||||
ambient.humidity: 035.6
|
||||
ambient.humidity.alarm.maximum: NO,NO
|
||||
ambient.humidity.alarm.minimum: NO,NO
|
||||
ambient.temperature: 25.14
|
||||
...
|
||||
|
||||
If you are interested in writing a simple client that monitors `upsd`,
|
||||
the source code for `upsc` is a good way to learn about using the
|
||||
[ and so on ]
|
||||
|
||||
If you are interested in writing a simple client that monitors upsd,
|
||||
the source code for upsc is a good way to learn about using the
|
||||
upsclient functions.
|
||||
|
||||
See the linkman:upsc[8] man page and
|
||||
<<nut-names,NUT command and variable naming scheme>> for more information.
|
||||
See the upsc(8) man page for more information.
|
||||
|
||||
upslog
|
||||
~~~~~~
|
||||
------
|
||||
|
||||
`upslog` will write status information from `upsd` to a file at set
|
||||
upslog will write status information from upsd to a file at set
|
||||
intervals. You can use this to generate graphs or reports with other
|
||||
programs such as `gnuplot`.
|
||||
programs such as gnuplot.
|
||||
|
||||
upsrw
|
||||
~~~~~
|
||||
-----
|
||||
|
||||
`upsrw` allows you to display and change the read/write variables in your
|
||||
upsrw allows you to display and change the read/write variables in your
|
||||
UPS hardware. Not all devices or drivers implement this, so this may
|
||||
not have any effect on your system.
|
||||
|
||||
A driver that supports read/write variables will give results like this:
|
||||
A driver that supports read/write variables will give results like this::
|
||||
|
||||
$ upsrw sparky@localhost
|
||||
$ upsrw su700@localhost
|
||||
|
||||
( many skipped )
|
||||
|
||||
|
@ -396,55 +373,54 @@ A driver that supports read/write variables will give results like this:
|
|||
|
||||
( more skipped )
|
||||
|
||||
On the other hand, one that doesn't support them won't print anything:
|
||||
On the other hand, one that doesn't support them won't print anything::
|
||||
|
||||
$ upsrw fenton@gearbox
|
||||
|
||||
( nothing )
|
||||
|
||||
`upsrw` requires administrator powers to change settings in the hardware.
|
||||
Refer to linkman:upsd.users[5] for information on defining
|
||||
users in `upsd`.
|
||||
upsrw requires administrator powers to change settings in the hardware.
|
||||
Refer to upsd.users(5) for information on defining users in upsd.
|
||||
|
||||
upscmd
|
||||
~~~~~~
|
||||
------
|
||||
|
||||
Some UPS hardware and drivers support the notion of an instant command -
|
||||
a feature such as starting a battery test, or powering off the load.
|
||||
You can use upscmd to list or invoke instant commands if your
|
||||
hardware/drivers support them.
|
||||
|
||||
Use the -l command to list them, like this:
|
||||
Use the -l command to list them, like this::
|
||||
|
||||
$ upscmd -l sparky@localhost
|
||||
Instant commands supported on UPS [sparky@localhost]:
|
||||
$ upscmd -l su700@localhost
|
||||
Instant commands supported on UPS [su700@localhost]:
|
||||
|
||||
load.on - Turn on the load immediately
|
||||
test.panel.start - Start testing the UPS panel
|
||||
calibrate.start - Start run time calibration
|
||||
calibrate.stop - Stop run time calibration
|
||||
...
|
||||
|
||||
`upscmd` requires administrator powers to start instant commands.
|
||||
To define users and passwords in `upsd`, see
|
||||
linkman:upsd.users[5].
|
||||
[ snip ]
|
||||
|
||||
upscmd requires administrator powers to start instant commands.
|
||||
To define users and passwords in upsd, see upsd.users(5).
|
||||
|
||||
============
|
||||
CGI Programs
|
||||
------------
|
||||
============
|
||||
|
||||
The CGI programs are clients that run through your web server. They
|
||||
allow you to see UPS status and perform certain administrative commands
|
||||
from any web browser. Javascript and cookies are not required.
|
||||
|
||||
These programs are not installed or compiled by default. To compile
|
||||
and install them, first run `configure --with-cgi`, then do `make` and
|
||||
`make install`. If you receive errors about "gd" during configure, go
|
||||
and install them, first run 'configure --with-cgi', then do 'make' and
|
||||
'make install'. If you receive errors about "gd" during configure, go
|
||||
get it and install it before continuing.
|
||||
|
||||
You can get the source here:
|
||||
|
||||
http://www.libgd.org/
|
||||
http://www.boutell.com/gd/
|
||||
|
||||
In the event that you need libpng or zlib in order to compile gd,
|
||||
they can be found at these URLs:
|
||||
|
@ -453,9 +429,8 @@ they can be found at these URLs:
|
|||
|
||||
http://www.gzip.org/zlib/
|
||||
|
||||
|
||||
Access Restrictions
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
-------------------
|
||||
|
||||
The CGI programs use hosts.conf to see if they are allowed to talk to a
|
||||
host. This keeps malicious visitors from creating queries from your web
|
||||
|
@ -465,62 +440,107 @@ If you get error messages that say "Access to that host is not
|
|||
authorized", you're probably missing an entry in your hosts.conf.
|
||||
|
||||
upsstats
|
||||
~~~~~~~~
|
||||
--------
|
||||
|
||||
`upsstats` generates web pages from HTML templates, and plugs in status
|
||||
upsstats generates web pages from HTML templates, and plugs in status
|
||||
information in the right places. It looks like a distant relative of
|
||||
APC's old Powerchute interface. You can use it to monitor several
|
||||
systems or just focus on one.
|
||||
|
||||
It also can generate IMG references to `upsimage`.
|
||||
It also can generate IMG references to upsimage.
|
||||
|
||||
upsimage
|
||||
~~~~~~~~
|
||||
--------
|
||||
|
||||
This is usually called by upsstats via IMG SRC tags to draw either the
|
||||
utility or outgoing voltage, battery charge percent, or load percent.
|
||||
|
||||
upsset
|
||||
~~~~~~
|
||||
------
|
||||
|
||||
`upsset` provides several useful administration functions through a web
|
||||
interface. You can use `upsset` to kick off instant commands on your UPS
|
||||
upsset provides several useful administration functions through a web
|
||||
interface. You can use upsset to kick off instant commands on your UPS
|
||||
hardware like running a battery test. You can also use it to change
|
||||
variables in your UPS that accept user-specified values.
|
||||
|
||||
Essentially, `upsset` provides the functions of `upsrw` and `upscmd`, but
|
||||
Essentially, upsset provides the functions of upsrw and upscmd, but
|
||||
with a happy pointy-clicky interface.
|
||||
|
||||
`upsset` will not run until you convince it that you have secured your
|
||||
upsset will not run until you convince it that you have secured your
|
||||
system. You *must* secure your CGI path so that random interlopers
|
||||
can't run this program remotely. See the `upsset.conf` file. Once you
|
||||
can't run this program remotely. See the upsset.conf file. Once you
|
||||
have secured the directory, you can enable this program in that
|
||||
configuration file. It is not active by default.
|
||||
|
||||
|
||||
=====================
|
||||
Support / Help / etc.
|
||||
=====================
|
||||
|
||||
The main URL:
|
||||
|
||||
http://www.networkupstools.org/
|
||||
|
||||
There is also a mailing list for general queries and discussion about
|
||||
this software called nut-upsuser. It typically moves around 50-100 messages
|
||||
per month at the time of this writing. To join, go to the below address and
|
||||
subscribe to the desired list.
|
||||
|
||||
Finally, there is a developer list called nut-upsdev. This is not
|
||||
an install help list, and any such mails probably will be ignored.
|
||||
|
||||
The mailing lists are archived on the web:
|
||||
|
||||
http://alioth.debian.org/mail/?group_id=30602
|
||||
|
||||
Try running some searches against the archives. Many times, problems have
|
||||
already been answered by someone else. Currently, there is no internal
|
||||
search engine, so you will have to try with a search engine like Google.
|
||||
|
||||
There is more documentation in the docs/ directory within the source
|
||||
tree. Be sure to read through the files in there (especially the
|
||||
FAQ) before mailing the list for help. Many times the questions have
|
||||
already been answered in the files which are right in front of you.
|
||||
|
||||
|
||||
===================================
|
||||
Making your own clients (upsclient)
|
||||
===================================
|
||||
|
||||
The upsclient.a library can be linked into other programs to give access
|
||||
to upsd and UPS status information. Clients like upsc are provided as
|
||||
examples of how to retrieve data using the upsclient functions. Other
|
||||
programs not included in this package may also use this library, as wmnut.
|
||||
|
||||
This library file and the associated header files are not installed by
|
||||
default. You must './configure --with-lib' to enable building and
|
||||
installing these files. The libraries can then be build and installed
|
||||
with 'make' and 'make install' as usual. This must be done before
|
||||
building other (non-NUT) programs which depend on them.
|
||||
|
||||
To obtain the right compilation and link flags, two helpers are provided:
|
||||
one for platform providing pkg-config, and the other (libupsclient-config)
|
||||
for platform not providing pkg-config.
|
||||
|
||||
|
||||
=================
|
||||
Version Numbering
|
||||
-----------------
|
||||
=================
|
||||
|
||||
The version numbers work like this: if the middle number is odd, it's a
|
||||
development tree, otherwise it is the stable tree.
|
||||
|
||||
The past stable trees were 1.0, 1.2, 1.4, 2.0, 2.2 and 2.4, with the
|
||||
latest stable tree designated 2.6. The development trees were 1.1, 1.3,
|
||||
1.5, 2.1 and 2.3. As of the 2.4 release, there is no real development
|
||||
branch anymore since the code is available through a revision control
|
||||
system (namely Subversion) and snapshots. Since 2.7 line of releases,
|
||||
sources are tracked in Git revision control system, with the project
|
||||
ecosystem being hosted on GitHub, and improvements or other contributions
|
||||
merged through common pull request approach and custom NUT CI testing
|
||||
on multiple platforms.
|
||||
The past stable trees were 1.0, 1.2, 1.4 and 2.0, with the latest stable tree
|
||||
designated 2.2. The development trees were 1.1, 1.3, 1.5 and 2.1.
|
||||
|
||||
Major release jumps are mostly due to large changes to the features
|
||||
list. There have also been a number of architectural changes which
|
||||
may not be noticeable to most users, but which can impact developers.
|
||||
The jump to 2.2 is mostly due to the large changes to the features list.
|
||||
There have also been a number of architectural changes which may not be
|
||||
noticeable to most users.
|
||||
|
||||
|
||||
====================================
|
||||
Backwards and Forwards Compatibility
|
||||
------------------------------------
|
||||
====================================
|
||||
|
||||
The old network code spans a range from about 0.41.1 when TCP support
|
||||
was introduced up to the recent 1.4 series. It used variable names
|
||||
|
@ -547,17 +567,21 @@ use the new names.
|
|||
|
||||
Here's a table to make it easier to visualize:
|
||||
|
||||
[options="header"]
|
||||
|=============================================
|
||||
| 4+| Server version
|
||||
| *Client version* | 1.0 | 1.2 | 1.4 | 2.0+
|
||||
| 1.0 | yes | yes | yes | no
|
||||
| 1.2 | yes | yes | yes | no
|
||||
| 1.4 | yes | yes | yes | yes
|
||||
| 2.0+ | no | no | yes | yes
|
||||
|=============================================
|
||||
+--------+------------------------+
|
||||
| | Server |
|
||||
+--------+-----+-----+-----+------+
|
||||
| Client | 1.0 | 1.2 | 1.4 | 2.0+ |
|
||||
+========+=====+=====+=====+======+
|
||||
| 1.0 | yes | yes | yes | no |
|
||||
+--------+-----+-----+-----+------+
|
||||
| 1.2 | yes | yes | yes | no |
|
||||
+--------+-----+-----+-----+------+
|
||||
| 1.4 | yes | yes | yes | yes |
|
||||
+--------+-----+-----+-----+------+
|
||||
| 2.0 | no | no | yes | yes |
|
||||
+--------+-----+-----+-----+------+
|
||||
|
||||
Version 2.0, and more recent, do not contain backwards compatibility for
|
||||
Version 2.0 (and more recent) does not contain backwards compatibility for
|
||||
the old protocol and variable/command names. As a result, 2.0 clients can't
|
||||
talk to anything older than a 1.4 server. If you ask a 2.0 client to
|
||||
fetch "STATUS", it will fail. You'll have to ask for "ups.status"
|
||||
|
@ -569,24 +593,67 @@ software can easily support both versions as long as they like. If upsd
|
|||
returns 'ERR UNKNOWN-COMMAND' to a GET request, you need to use REQ.
|
||||
|
||||
|
||||
Support / Help / etc.
|
||||
---------------------
|
||||
|
||||
If you are in need of help, refer to the
|
||||
<<Support_Request,Support instructions>> in the user manual.
|
||||
|
||||
|
||||
==========================
|
||||
Hacking / Development Info
|
||||
--------------------------
|
||||
==========================
|
||||
|
||||
Additional documentation can be found in:
|
||||
Additional documentation can be found in the docs subdirectory.
|
||||
|
||||
- the linkdoc:developer-guide[Developer Guide],
|
||||
- the linkdoc:packager-guide[Packager Guide].
|
||||
Information on creating new drivers can be found in new-drivers.txt.
|
||||
Also be sure to look at skel.c and main.c. All drivers are just
|
||||
collections of support functions built around a common core, so most of
|
||||
the dull housekeeping work has been handled for you.
|
||||
|
||||
Information on the NUT variables naming can be found in new-names.txt.
|
||||
Information on the architecture and how it all fits together is in the
|
||||
design.txt file. In short, there's a lot more documentation out there.
|
||||
|
||||
Also be sure to read developers.txt, as it explains a lot about the
|
||||
tree, including some of the functions that are provided for your use.
|
||||
|
||||
|
||||
================================
|
||||
Acknowledgements / Contributions
|
||||
--------------------------------
|
||||
================================
|
||||
|
||||
MGE UPS SYSTEMS provided extensive technical documents for their UPS product
|
||||
line, along with many units for development of NUT-related projects. The
|
||||
company also sponsored and later hired Arnaud Quette to further officially
|
||||
support these efforts.
|
||||
|
||||
Several drivers such as mge-utalk, mge-shut, snmp-ups, hidups, and usbhid-ups
|
||||
are the result of this collaboration, in addition to the WMNut, MGE HID Parser
|
||||
the libhid projects, .... The features page has improved artwork thanks to Luc
|
||||
and Arnaud of MGE. Other client projects such as KNutClient and ups-monitor
|
||||
have also received assistance.
|
||||
|
||||
The master NUT site and several related projects are hosted on MGE's equipment
|
||||
at no cost to the project.
|
||||
|
||||
More information on their open source support can be found on their web site:
|
||||
http://opensource.mgeups.com/contrib.htm
|
||||
|
||||
Fenton Technologies contributed a PowerPal 660 to the project. Their open
|
||||
stance and quick responses to technical inquiries are appreciated for
|
||||
making the development of the fentonups driver possible.
|
||||
|
||||
Bo Kersey of VirCIO (http://www.vircio.com) provided a Best Power
|
||||
Fortress 750 to facilitate the bestups driver.
|
||||
|
||||
Invensys Energy Systems provided the SOLA/Best "Phoenixtec" protocol
|
||||
document currently residing at the following URL:
|
||||
|
||||
http://random.networkupstools.org/protocols/sola.html
|
||||
|
||||
PowerKinetics technical support provided documentation on their MiniCOL
|
||||
protocol, which is archived in the NUT protocol library online:
|
||||
|
||||
http://random.networkupstools.org/protocols/minicol/
|
||||
|
||||
Cyber Power Systems contributed a 700AVR model for testing and driver
|
||||
development.
|
||||
|
||||
Liebert Corporation supplied serial test boxes and a UPStation GXT2
|
||||
with the Web/SNMP card for development of the liebert driver and
|
||||
expansion of the existing snmp-ups driver.
|
||||
|
||||
The many people who have participated in creating and improving NUT are
|
||||
listed in the user manual <<Acknowledgements,acknowledgements appendix>>.
|
||||
|
|
755
UPGRADING
755
UPGRADING
|
@ -1,432 +1,373 @@
|
|||
ifdef::txt[]
|
||||
Upgrading notes
|
||||
===============
|
||||
endif::txt[]
|
||||
|
||||
This file lists changes that affect users who installed older versions
|
||||
of this software. When upgrading from an older version, be sure to
|
||||
check this file to see if you need to make changes to your system.
|
||||
|
||||
Changes from 2.7.4 to 2.8.0
|
||||
---------------------------
|
||||
|
||||
- Note to distribution packagers: this version hopefully learns from many
|
||||
past mistakes, so many custom patches may be no longer needed. If some
|
||||
remain, please consider making pull requests for upstream NUT codebase
|
||||
to share the fixes consistently across the ecosystem. Also note that
|
||||
some new types of drivers (so package groups with unique dependencies)
|
||||
could have appeared since your packaging was written (e.g. with modbus),
|
||||
as well as new features in systemd integration (`nut-driver@instances`
|
||||
and the `nut-driver-enumerator` to manage their population), as well as
|
||||
updated Python 2 and Python 3 support (again, maybe dictating different
|
||||
package groups) as detailed below.
|
||||
|
||||
- Due to changes needed to resolve build warnings, mostly about mismatching
|
||||
data types for some variables, some structure definitions and API signatures
|
||||
of several routines had to be changed for argument types, return types,
|
||||
or both. Primarily this change concerns internal implementation details
|
||||
(may impact update of NUT forks with custom drivers using those), but a
|
||||
few changes also happened in header files installed for builds configured
|
||||
`--with-dev` and so may impact `upsclient` and `nutclient` (C++) consumers.
|
||||
At the very least, binaries for those consumers should be rebuilt to remain
|
||||
stable with NUT 2.8.0 and not mismatch int-type sizes and other arguments.
|
||||
|
||||
- libusb-1.0: NUT now defaults to building against libusb-1.0 API version
|
||||
if the configure script finds the development headers, falling back to
|
||||
libusb-0.1 if not. Please report any regressions.
|
||||
|
||||
- apcupsd-ups: When monitoring a remote apcupsd server, interpret "SHUTTING
|
||||
DOWN" as a NUT "LB" status. If you were relying on the previous behavior
|
||||
(for instance, in a monitor-only situation), please adjust your upsmon
|
||||
settings. Reference: https://github.com/networkupstools/nut/issues/460
|
||||
|
||||
- Packagers: the AsciiDoc detection has been reworked to allow NUT to be built
|
||||
from source without requiring asciidoc/a2x (using pre-built man pages from
|
||||
the distribution tarball, for instance). Please double-check that we did not
|
||||
break anything (see docs/configure.txt for options).
|
||||
|
||||
- Driver core: options added for standalone mode (scanning for devices without
|
||||
requiring ups.conf) - see docs/man/nutupsdrv.txt for details.
|
||||
|
||||
- oldmge-shut has been removed, and replaced by mge-shut.
|
||||
|
||||
- New drivers for devices with "Qx" (also known as "Megatec Q*") family of
|
||||
protocols should be developed as sub-drivers in the `nutdrv_qx` framework
|
||||
for USB and Serial connected devices, not as updates/clones of older e.g.
|
||||
`blazer` family and `bestups`. Sources, man pages and start-up messages
|
||||
of such older drivers were marked with "OBSOLETION WARNING".
|
||||
|
||||
- liebert-esp2: some multi-phase variable names have been updated to match the
|
||||
rest of NUT.
|
||||
|
||||
- netxml-ups: if you have old firmware, or were relying on values being off by
|
||||
a factor of 10, consider the `do_convert_deci` flag. See
|
||||
docs/man/netxml-ups.txt for details.
|
||||
|
||||
- snmp-ups: detection of Net-SNMP has been updated to use `pkg-config` by
|
||||
default (if present), rather than `net-snmp-config(-32|-64)` script(s) as
|
||||
the only option available previously. The scripts tend to specify a lot
|
||||
of options (sometimes platform-specific) in suggested `CFLAGS` and `LIBS`
|
||||
compared to the packaged `pkg-config` information which also works and is
|
||||
more portable. If this change bites your distribution, please bring it up
|
||||
in https://github.com/networkupstools/nut/issues or better yet, post a PR.
|
||||
Also note that `./configure --with-netsnmp-config(=yes)` should set up the
|
||||
preference of the detected script over `pkg-config` information, if both
|
||||
are available, and `--with-netsnmp-config=/path/name` would as well.
|
||||
|
||||
- snmp-ups: bit mask values for flags in earlier codebase were defined in a
|
||||
way that caused logically different items to have same numeric values.
|
||||
This was fixed to surely use different definitions (so changing numbers
|
||||
behind some of those macro symbols), and testing with UPS, ePDU and ATS
|
||||
hardware which was available did not expose any practical differences.
|
||||
|
||||
- usbhid-ups: numeric data conversion from wire protocol to CPU representation
|
||||
in GetValue() was completely reworked, aiming to be correct on all CPU types.
|
||||
That said, regressions are possible and feedback is welcome.
|
||||
|
||||
- nut-scanner: Packagers, take note of the changes to the library
|
||||
search code in common/common.c. Please file an issue if this does not work
|
||||
with your platform.
|
||||
|
||||
- dummy-ups can now specify `mode` as a driver argument, and separates the
|
||||
notion of `dummy-once` (new default for `*.dev` files that do not change)
|
||||
vs. `dummy-loop` (legacy default for `*.seq` and others) [issue #1385]
|
||||
|
||||
* Note this can break third-party test scripts which expected `*.dev`
|
||||
files to work as a looping sequence with a `TIMER` keywords to change
|
||||
values slowly; now such files should get processed to the end once.
|
||||
Specify `mode=dummy-loop` driver option or rename the data file used
|
||||
in the `port` option for legacy behavior.
|
||||
Use/Test-cases which modified such files content externally should
|
||||
not be impacted.
|
||||
|
||||
- Python: scripts have been updated to work with Python 3 as well as 2.
|
||||
|
||||
* PyNUT module (protocol binding) supports both Python generations.
|
||||
|
||||
* NUT-Monitor (desktop UI client) got separated into two projects:
|
||||
one with support for Python2 and GTK2, and another for Python3 and Qt5.
|
||||
On operating systems that serve both environments, either of these
|
||||
implementation should be usable. For distributions that deprecated
|
||||
and removed Python2 support, it is a point to consider in NUT packages
|
||||
and their build-time and installation dependencies.
|
||||
The historic filenames for desktop integration (`NUT-Monitor` script
|
||||
and `nut-monitor.desktop`) are still delivered, but now cover a wrapper
|
||||
script which detects the environment capabilities and launches the best
|
||||
suitable UI implementation (if both are available).
|
||||
|
||||
- apcsmart: updates to CS "hack" (see docs/man/apcsmart.txt for details)
|
||||
|
||||
- upsdebugx(): added `[D#]` prefix to log entries with level > 0
|
||||
so if any scripts or other tools relied on parsing those messages
|
||||
making some assumptions, they should be updated
|
||||
|
||||
- upsdebugx() and related methods are now macros, optionally calling similarly
|
||||
named implementations like s_upsdebugx() as a slight optimization; this may
|
||||
show up in linking of binaries for some customized build scenarios
|
||||
|
||||
- libraries, tools and protocol now support a `TRACKING` ID to be used with
|
||||
an `INSTCMD` or `SET VAR` requests; for details see docs/net-protocol.txt
|
||||
and docs/sock-protocol.txt
|
||||
|
||||
- upsrw: display the variable type beside ENUM / RANGE
|
||||
|
||||
- Augeas: new `--with-augeas-lenses-dir` configure option.
|
||||
|
||||
Changes from 2.7.3 to 2.7.4
|
||||
---------------------------
|
||||
|
||||
- scripts/systemd/nut-server.service.in: Restore systemd relationship since it
|
||||
was preventing upsd from starting whenever one or more drivers, among several,
|
||||
was failing to start
|
||||
|
||||
- Fix UPower device matching for recent kernels, since hiddev* devices now have
|
||||
class "usbmisc", rather than "usb"
|
||||
|
||||
- macosx-ups: the "port" driver option no longer has any effect
|
||||
|
||||
- Network protocol information: default to type NUMBER for variables that are
|
||||
not flagged as STRING . This point is subject to improvements or change in
|
||||
the next release 2.7.5. Refer to docs/net-protocol.txt for more information
|
||||
|
||||
Changes from 2.7.2 to 2.7.3
|
||||
---------------------------
|
||||
|
||||
- The linkman:nutdrv_qx[8] driver will eventually supersede linkman:bestups[8].
|
||||
It has been tested on a U-series Patriot Pro II. Please test the new driver
|
||||
on your hardware during your next maintenance window, and report any bugs.
|
||||
|
||||
- If you are upgrading from a new install of 2.7.1 or 2.7.2, double-check the
|
||||
value of POWERDOWNFLAG in $prefix/etc/upsmon.conf - it has been restored to
|
||||
/etc/killpower as in 2.6.5 and earlier.
|
||||
|
||||
- If you use upslog with a large sleep value, you may be interested in adding
|
||||
`killall -SIGUSR1 upslog` to any OB/OL script actions. This will force
|
||||
upslog to write a log entry to catch short power transients.
|
||||
|
||||
- Be sure that your SSL keys are readable by the NUT system user. The SSL
|
||||
subsystem is now initialized after `upsd` forks, to work around issues in the
|
||||
NSS library.
|
||||
|
||||
- The systemd nut-server.service does not Require nut-driver to be started
|
||||
successfully. This was previously preventing upsd startup, even for just
|
||||
one driver failure among many. This also matches the behavior of sysV
|
||||
initscripts.
|
||||
|
||||
Changes from 2.7.1 to 2.7.2
|
||||
---------------------------
|
||||
|
||||
- upsdrvctl is now installed to $prefix/sbin rather than $driverexec.
|
||||
This usually means moving from /bin to /sbin, apart from few exceptions.
|
||||
In all cases, please adapt your scripts.
|
||||
|
||||
- FreeDesktop Hardware Abstraction Layer (HAL) support was removed.
|
||||
Please adapt your packaging files, if you used to distribute the
|
||||
nut-hal-drivers package.
|
||||
|
||||
- This is a good time to point out that for stricter packaging systems, it may
|
||||
be beneficial to add "--enable-option-checking=fatal" to the ./configure
|
||||
command line, in order to quickly pick up any other removed option flags.
|
||||
|
||||
Changes from 2.6.5 to 2.7.1
|
||||
---------------------------
|
||||
|
||||
- The linkman:apcsmart[8] driver has been replaced by a new implementation. There is a new
|
||||
parameter, 'ttymode', which may help if you have a non-standard serial port,
|
||||
or Windows. In case of issues with this new version, users can revert to
|
||||
apcsmart-old.
|
||||
|
||||
- The linkman:nutdrv_qx[8] driver will eventually supersede blazer_ser and blazer_usb.
|
||||
Options are not exactly the same, but are documented in the nutdrv_qx man
|
||||
page.
|
||||
|
||||
- Mozilla NSS support has been added. The OpenSSL configuration options should
|
||||
be unchanged, but please refer to the linkman:upsd.conf[5] and
|
||||
linkman:upsmon.conf[5] documentation in case we missed something.
|
||||
|
||||
- linkman:upsrw[8] now prints out the maximum size of variables. Hopefully you
|
||||
are not parsing the output of upsrw - it would be easier to use one of the
|
||||
NUT libraries, or implement the network protocol yourself.
|
||||
|
||||
- The jNut source is now here: https://github.com/networkupstools/jNut
|
||||
|
||||
Changes from 2.6.4 to 2.6.5
|
||||
---------------------------
|
||||
|
||||
- users are encouraged to update to NUT 2.6.5, to fix a regression in
|
||||
upssched.
|
||||
- mge-shut driver has been replaced by a new implementation (newmge-shut).
|
||||
In case of issue with this new version, users can revert to oldmge-shut.
|
||||
|
||||
Changes from 2.6.3 to 2.6.4
|
||||
---------------------------
|
||||
|
||||
- users are encouraged to update to NUT 2.6.4, to fix upsd vulnerability
|
||||
(CVE-2012-2944: upsd can be remotely crashed).
|
||||
- users of the bestups driver are encouraged to switch to blazer_ser,
|
||||
since bestups will soon be deprecated.
|
||||
|
||||
Changes from 2.6.2 to 2.6.3
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
|
||||
Changes from 2.6.1 to 2.6.2
|
||||
---------------------------
|
||||
|
||||
- apcsmart driver has been replaced by a new implementation. In case of issue
|
||||
with this new version, users can revert to apcsmart-old.
|
||||
|
||||
Changes from 2.6.0 to 2.6.1
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
|
||||
Changes from 2.4.3 to 2.6.0
|
||||
---------------------------
|
||||
|
||||
- users of the megatec and megatec_usb drivers must respectively switch to
|
||||
blazer_ser and blazer_usb.
|
||||
- users of the liebertgxt2 driver are advised that the driver name has changed
|
||||
to liebert-esp2.
|
||||
|
||||
Changes from 2.4.2 to 2.4.3
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
|
||||
Changes from 2.4.1 to 2.4.2
|
||||
---------------------------
|
||||
|
||||
- The default subdriver for the blazer_usb driver USB id 06da:0003 has changed.
|
||||
If you use such a device and it is no longer working with this driver, override
|
||||
the 'subdriver' default in 'ups.conf' (see man 8 blazer).
|
||||
- NUT ACL and the allowfrom mechanism has been replaced in 2.4.0 by the LISTEN
|
||||
directive and tcp-wrappers respectively. This information was missing below, so
|
||||
a double note has been added.
|
||||
|
||||
Changes from 2.4.0 to 2.4.1
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
|
||||
Changes from 2.2.2 to 2.4.0
|
||||
---------------------------
|
||||
|
||||
- The nut.conf file has been introduced to standardize startup configuration
|
||||
across the various systems.
|
||||
- The cpsups and nitram drivers have been replaced by the powerpanel driver,
|
||||
and removed from the tree. The cyberpower driver may suffer the same in the
|
||||
future.
|
||||
- The al175 and energizerups drivers have been removed from the tree, since
|
||||
these were tagged broken for a long time.
|
||||
- Developers of external client application using libupsclient must rename
|
||||
their "UPSCONN" client structure to "UPSCONN_t".
|
||||
- The upsd server will now disconnect clients that remain silent for more than
|
||||
60 seconds.
|
||||
- The files under scripts/python/client are distributed under GPL 3+, whereas
|
||||
the rest of the files are distributed under GPL 2+. Refer to COPYING for more
|
||||
information.
|
||||
- The generated udev rules file has been renamed with dash only, no underscore
|
||||
anymore (ie 52-nut-usbups.rules instead of 52_nut-usbups.rules)
|
||||
|
||||
Changes from 2.2.1 to 2.2.2
|
||||
---------------------------
|
||||
|
||||
- The configure option "--with-lib" has been replaced by "--with-dev".
|
||||
This enable the additional build and distribution of the static
|
||||
version of libupsclient, along with the pkg-config helper and manual
|
||||
pages. The default configure option is to distribute only the shared
|
||||
version of libupsclient. This can be overridden by using the
|
||||
"--disable-shared" configure option (distribute static only binaries).
|
||||
- The UPS poweroff handling of the usbhid-ups driver has been reworked.
|
||||
Though regression is not expected, users of this driver are
|
||||
encouraged to test this feature by calling "upsmon -c fsd" and
|
||||
report any issue on the NUT mailing lists.
|
||||
|
||||
Changes from 2.2.0 to 2.2.1
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
(The below message is repeated due to previous omission)
|
||||
- Developers of external client application using libupsclient are
|
||||
encouraged to rename their "UPSCONN" client structure to "UPSCONN_t"
|
||||
since the former will disappear by the release of NUT 2.4.
|
||||
|
||||
Changes from 2.0.5 to 2.2.0
|
||||
---------------------------
|
||||
|
||||
- users of the newhidups driver are advised that the driver name has changed
|
||||
to usbhid-ups.
|
||||
- users of the hidups driver must switch to usbhid-ups.
|
||||
- users of the following drivers (powermust, blazer, fentonups, mustek,
|
||||
esupssmart, ippon, sms) must switch to megatec, which replaces
|
||||
all these drivers. Please refer to doc/megatec.txt for details.
|
||||
- users of the mge-shut driver are encouraged to test newmge-shut, which
|
||||
is an alternate driver scheduled to replace mge-shut,
|
||||
- users of the cpsups driver are encouraged to switch to powerpanel which
|
||||
is scheduled to replace cpsups,
|
||||
- packagers will have to rework the whole nut packaging due to the
|
||||
major changes in the build system (completely modified, and now using
|
||||
automake). Refer to packaging/debian/ for an example of migration.
|
||||
- specifying '-a <id>' is now mandatory when starting a driver manually,
|
||||
ie not using upsdrvctl.
|
||||
- Developers of external client application using libupsclient are
|
||||
encouraged to rename the "UPSCONN" client structure to "UPSCONN_t"
|
||||
since the former will disappear by the release of NUT 2.4.
|
||||
|
||||
Changes from 2.0.4 to 2.0.5
|
||||
---------------------------
|
||||
|
||||
- users of the newhidups driver: the driver is now more strict about
|
||||
refusing to connect to unknown devices. If your device was
|
||||
previously supported, but fails to be recognized now, add
|
||||
'productid=XXXX' to ups.conf. Please report the device to the NUT
|
||||
developer's mailing list.
|
||||
|
||||
Changes from 2.0.3 to 2.0.4
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
- users of the following drivers (powermust, blazer, fentonups, mustek,
|
||||
esupssmart, ippon, sms, masterguard) are encouraged to switch to megatec,
|
||||
which should replace all these drivers by nut 2.2. For more information,
|
||||
please refer to doc/megatec.txt
|
||||
|
||||
Changes from 2.0.2 to 2.0.3
|
||||
---------------------------
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
- hidups users are encouraged to switch to newhidups, as hidups will be
|
||||
removed by nut 2.2.
|
||||
|
||||
Changes from 2.0.1 to 2.0.2
|
||||
---------------------------
|
||||
|
||||
- The newhidups driver, which is the long run USB support approach,
|
||||
needs hotplug files installed to setup the right permissions on
|
||||
device file to operate. Check newhidups manual page for more information.
|
||||
|
||||
Changes from 2.0.0 to 2.0.1
|
||||
---------------------------
|
||||
|
||||
- The cyberpower1100 driver is now called cpsups since it supports
|
||||
more than just one model. If you use this driver, be sure to remove
|
||||
the old binary and update your ups.conf 'driver=' setting with the
|
||||
new name.
|
||||
|
||||
- The upsstats.html template page has been changed slightly to reflect
|
||||
better HTML compliance, so you may want to update your installed copy
|
||||
accordingly. If you've customized your file, don't just copy the new
|
||||
one over it, or your changes will be lost!
|
||||
|
||||
Changes from 1.4.0 to 2.0.0
|
||||
---------------------------
|
||||
|
||||
- The sample config files are no longer installed by default. If you
|
||||
want to install them, use 'make install-conf' for the main programs,
|
||||
and 'make install-cgi-conf' for the CGI programs.
|
||||
|
||||
- ACCESS is no longer supported in upsd.conf. Use ACCEPT and REJECT.
|
||||
Old way:
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.4.2 to 2.4.3:
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.4.1 to 2.4.2:
|
||||
|
||||
- The default subdriver for the blazer_usb driver USB id 06da:0003 has
|
||||
changed. If you use such a device and it is no longer working with this
|
||||
driver, override the 'subdriver' default in 'ups.conf' (see man 8 blazer).
|
||||
- NUT ACL and the allowfrom mechanism has been replaced in 2.4.0 by the LISTEN
|
||||
directive and tcp-wrappers respectively. This information was missing
|
||||
below, so a double note has been added.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.4.0 to 2.4.1:
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.2.2 to 2.4.0:
|
||||
|
||||
- The nut.conf file has been introduced to standardize startup configuration
|
||||
across the various systems.
|
||||
- The cpsups and nitram drivers have been replaced by the powerpanel driver,
|
||||
and removed from the tree. The cyberpower driver may suffer the same in the
|
||||
future.
|
||||
- The al175 and energizerups drivers have been removed from the tree, since
|
||||
these were tagged broken for a long time.
|
||||
- Developers of external client application using libupsclient must rename
|
||||
their "UPSCONN" client structure to "UPSCONN_t".
|
||||
- The upsd server will now disconnect clients that remain silent for more than
|
||||
60 seconds.
|
||||
- The files under scripts/python/client are distributed under GPL 3+, whereas
|
||||
the rest of the files are distributed under GPL 2+. Refer to COPYING for more
|
||||
information.
|
||||
- The generated udev rules file has been renamed with dash only, no underscore
|
||||
anymore (ie 52-nut-usbups.rules instead of 52_nut-usbups.rules)
|
||||
- (Note: this has been missed at release time): The NUT internal network access
|
||||
control (ACL using ACCEPT / REJECT in upsd.conf) has been replaced by
|
||||
the LISTEN directive. This can also be complemented by tcp-wrappers.
|
||||
Refer to upsd and upsd.conf manual pages for more information.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.2.1 to 2.2.2:
|
||||
|
||||
- The configure option "--with-lib" has been replaced by "--with-dev".
|
||||
This enable the additional build and distribution of the static
|
||||
version of libupsclient, along with the pkg-config helper and manual
|
||||
pages. The default configure option is to distribute only the shared
|
||||
version of libupsclient. This can be overriden by using the
|
||||
"--disable-shared" configure option (distribute static only binaries).
|
||||
- The UPS poweroff handling of the usbhid-ups driver has been reworked.
|
||||
Though regression is not expected, users of this driver are
|
||||
encouraged to test this feature by calling "upsmon -c fsd" and
|
||||
report any issue on the NUT mailing lists.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.2.0 to 2.2.1:
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
(The below message is repetead due to previous omission)
|
||||
- Developers of external client application using libupsclient are
|
||||
encouraged to rename their "UPSCONN" client structure to "UPSCONN_t"
|
||||
since the former will disappear by the release of NUT 2.4.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.0.5 to 2.2.0:
|
||||
|
||||
- users of the newhidups driver are advised that the driver name has changed
|
||||
to usbhid-ups.
|
||||
- users of the hidups driver must switch to usbhid-ups.
|
||||
- users of the following drivers (powermust, blazer, fentonups, mustek,
|
||||
esupssmart, ippon, sms) must switch to megatec, which replaces
|
||||
all these drivers. Please refer to doc/megatec.txt for details.
|
||||
- users of the mge-shut driver are encouraged to test newmge-shut, which
|
||||
is an alternate driver scheduled to replace mge-shut,
|
||||
- users of the cpsups driver are encouraged to switch to powerpanel which
|
||||
is scheduled to replace cpsups,
|
||||
- packagers will have to rework the whole nut packaging due to the
|
||||
major changes in the build system (completely modified, and now using
|
||||
automake). Refer to packaging/debian/ for an example of migration.
|
||||
- specifying '-a <id>' is now mandatory when starting a driver manually,
|
||||
ie not using upsdrvctl.
|
||||
- Developers of external client application using libupsclient are
|
||||
encouraged to rename the "UPSCONN" client structure to "UPSCONN_t"
|
||||
since the former will disapear by the release of NUT 2.4.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.0.4 to 2.0.5:
|
||||
|
||||
- users of the newhidups driver: the driver is now more strict about
|
||||
refusing to connect to unknown devices. If your device was
|
||||
previously supported, but fails to be recognized now, add
|
||||
'productid=XXXX' to ups.conf. Please report the device to the NUT
|
||||
developer's mailing list.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.0.3 to 2.0.4:
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
- users of the following drivers (powermust, blazer, fentonups, mustek,
|
||||
esupssmart, ippon, sms, masterguard) are encouraged to switch to megatec,
|
||||
which should replace all these drivers by nut 2.2. For more information,
|
||||
please refer to doc/megatec.txt
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.0.2 to 2.0.3:
|
||||
|
||||
- nothing that affects upgraded systems.
|
||||
- hidups users are encouraged to switch to newhidups, as hidups will be
|
||||
removed by nut 2.2.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.0.1 to 2.0.2:
|
||||
|
||||
- The newhidups driver, which is the long run USB support approach,
|
||||
needs hotplug files installed to setup the right permissions on
|
||||
device file to operate. Check newhidups manual page for more information.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 2.0.0 to 2.0.1:
|
||||
|
||||
- The cyberpower1100 driver is now called cpsups since it supports
|
||||
more than just one model. If you use this driver, be sure to remove
|
||||
the old binary and update your ups.conf 'driver=' setting with the
|
||||
new name.
|
||||
|
||||
- The upsstats.html template page has been changed slightly to reflect
|
||||
better HTML compliance, so you may want to update your installed copy
|
||||
accordingly. If you've customized your file, don't just copy the new
|
||||
one over it, or your changes will be lost!
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
Changes from 1.4.0 to 2.0.0:
|
||||
|
||||
- The sample config files are no longer installed by default. If you
|
||||
want to install them, use 'make install-conf' for the main programs,
|
||||
and 'make install-cgi-conf' for the CGI programs.
|
||||
|
||||
- ACCESS is no longer supported in upsd.conf. Use ACCEPT and REJECT.
|
||||
|
||||
Old way:
|
||||
|
||||
ACCESS grant all adminbox
|
||||
ACCESS grant all webserver
|
||||
ACCESS deny all all
|
||||
|
||||
New way:
|
||||
New way:
|
||||
|
||||
ACCEPT adminbox
|
||||
ACCEPT webserver
|
||||
REJECT all
|
||||
|
||||
Note that ACCEPT and REJECT can take multiple arguments, so this
|
||||
will also work:
|
||||
Note that ACCEPT and REJECT can take multiple arguments, so this
|
||||
will also work:
|
||||
|
||||
ACCEPT adminbox webserver
|
||||
REJECT all
|
||||
|
||||
- The drivers no longer support sddelay in ups.conf or -d on the
|
||||
command line. If you need a delay after calling 'upsdrvctl
|
||||
shutdown', add a call to sleep in your shutdown script.
|
||||
- The drivers no longer support sddelay in ups.conf or -d on the
|
||||
command line. If you need a delay after calling 'upsdrvctl
|
||||
shutdown', add a call to sleep in your shutdown script.
|
||||
|
||||
- The templates used by upsstats have changed considerably to reflect
|
||||
the new variable names. If you use upsstats, you will need to
|
||||
install new copies or edit your existing files to use the new names.
|
||||
- The templates used by upsstats have changed considerably to reflect
|
||||
the new variable names. If you use upsstats, you will need to
|
||||
install new copies or edit your existing files to use the new names.
|
||||
|
||||
- Nobody needed UDP mode, so it has been removed. The only users
|
||||
seemed to be a few people like me with ancient asapm-ups binaries.
|
||||
If you really want to run asapm-ups again, bug me for the new patch
|
||||
which makes it work with upsclient.
|
||||
- Nobody needed UDP mode, so it has been removed. The only users
|
||||
seemed to be a few people like me with ancient asapm-ups binaries.
|
||||
If you really want to run asapm-ups again, bug me for the new patch
|
||||
which makes it work with upsclient.
|
||||
|
||||
- 'make install-misc' is now 'make install-lib'. The misc directory
|
||||
has been gone for a long time, and the target was ambiguous.
|
||||
- 'make install-misc' is now 'make install-lib'. The misc directory
|
||||
has been gone for a long time, and the target was ambiguous.
|
||||
|
||||
- The newapc driver has been renamed to apcsmart. If you previously
|
||||
used newapc, make sure you delete the old binary and fix your
|
||||
ups.conf. Otherwise, you may run the old driver from 1.4.
|
||||
- The newapc driver has been renamed to apcsmart. If you previously
|
||||
used newapc, make sure you delete the old binary and fix your
|
||||
ups.conf. Otherwise, you may run the old driver from 1.4.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
*** File trimmed here on changes from 1.2.2 to 1.4.0 ***
|
||||
Changes from 1.2.2 to 1.4.0:
|
||||
|
||||
For information before this point, start with version 2.4.1 and work back.
|
||||
- The clients no longer support the notion of a "default UPS" when
|
||||
communicating with newer versions of upsd. If you leave off a UPS
|
||||
name, they will fall back on compatibility mode and will use the
|
||||
old variable and command names.
|
||||
|
||||
That is, "upsc localhost" will give you things like STATUS, and you
|
||||
have to do "upsc myups@localhost" to get the new ones like
|
||||
ups.status.
|
||||
|
||||
The old variable names and default UPS mode will be supported
|
||||
throughout the 1.4 series to allow users to convert to the new
|
||||
style. This support will be formally dropped in 2.0.
|
||||
|
||||
- upsmon is part of the "no default upsname" change. You must change
|
||||
the MONITOR directives in your upsmon.conf if you were using this
|
||||
technique before.
|
||||
|
||||
Old way:
|
||||
|
||||
MONITOR bigserver 1 monuser password master
|
||||
|
||||
New way:
|
||||
|
||||
MONITOR myups@bigserver 1 monuser password master
|
||||
|
||||
Just look at the top of ups.conf on 'bigserver' to figure out what
|
||||
the first UPS is called, and stick it and a @ on that MONITOR line.
|
||||
|
||||
- upsrw's appearance has changed to avoid wrapping when displaying
|
||||
the new longer variable names and descriptions. It still displays
|
||||
the old format when talking to an older upsd.
|
||||
|
||||
To see the difference, try "upsrw localhost" and then compare it to
|
||||
"upsrw myups@localhost", assuming a new version of upsd is running
|
||||
on localhost.
|
||||
|
||||
- upslog now uses the new variable names in the default format
|
||||
string. It will still monitor the old variable names for backwards
|
||||
compatibility, but you will have to specify the format string
|
||||
explicitly.
|
||||
|
||||
- 'make install' no longer creates the state path. Instructions for
|
||||
creating it properly have been added to the INSTALL file.
|
||||
|
||||
Technically, this only affects packagers, since this is the
|
||||
UPGRADING file and normal users should already have a state path.
|
||||
If you are a packager, you will need to add the right mkdir + chown +
|
||||
chmod magic to your install process to keep things working.
|
||||
|
||||
This also means that you no longer need any special permissions to
|
||||
bundle this software into a package. The installer no longer
|
||||
requires root now that the chown is gone.
|
||||
|
||||
- configure --with-group no longer does anything useful. The programs
|
||||
which will drop permissions support "-u <user>", and will pick up
|
||||
the group id based on the values in /etc/passwd for that user name.
|
||||
|
||||
configure --with-user still works as before, and provides the default
|
||||
value if you don't specify another one with -u.
|
||||
|
||||
- The "DROP" action in upsd.conf now behaves a little differently.
|
||||
|
||||
It still causes new TCP connections to be closed without reading
|
||||
from the socket, and still causes UDP datagrams to be ignored.
|
||||
|
||||
The only difference is that commands that are denied after the
|
||||
remote host connects will now generate an error message. Previously,
|
||||
upsd would just ignore them, and the clients could get out of sync.
|
||||
|
||||
DENY also has been changed slightly to silently ignore UDP packets.
|
||||
|
||||
Essentially, DROP and DENY are now the same thing. If you use DROP
|
||||
anywhere, you should change to DENY before it goes away in the future.
|
||||
|
||||
- upsmon now requires a username on the MONITOR lines. If you have an
|
||||
older installation from the 1.x era or earlier, you probably need
|
||||
to convert them.
|
||||
|
||||
Old way: MONITOR ups@mybox 1 mypass master
|
||||
New way: MONITOR ups@mybox 1 username mypass master
|
||||
|
||||
You will also have to add a [username] section to the upsd.users
|
||||
with a matching password, an allowfrom value, and "upsmon master" or
|
||||
"upsmon slave".
|
||||
|
||||
If upsmon says the login failed due to "username required" or fails to
|
||||
start, saying "Unable to use old-style MONITOR line without a username",
|
||||
then you're still using the old method.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Changes from 1.2.1 to 1.2.2:
|
||||
|
||||
- upssched.conf now requires the LOCKFN directive to prevent races when
|
||||
handling two events that happen at nearly the same time.
|
||||
|
||||
If you use upssched, you must add this to your upssched.conf or it
|
||||
will fail to run.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Changes from 1.0.0 to 1.2.0:
|
||||
|
||||
- upsct is gone. upsc now uses the new upsclient library which is
|
||||
TCP only, so there is no need for a separate client for TCP polling.
|
||||
|
||||
- upsct2 has been renamed to upsrw since the name was already
|
||||
ambiguous and it looked even more out of place with upsct gone.
|
||||
|
||||
- The multimon.cgi behavior has been absorbed into upsstats.cgi.
|
||||
|
||||
- Calling upsstats.cgi with no arguments will make it render
|
||||
the template file called upsstats.html in your confpath. The default
|
||||
version of this file looks a lot like multimon, but is flexible.
|
||||
You will have to copy this file from upsstats.html.sample to
|
||||
upsstats.html the first time you install this version.
|
||||
|
||||
- Calling upsstats.cgi with host= set will still render a single status
|
||||
page as before, but the markup for that page now comes from
|
||||
upsstats-single.html. This is also a template and may be
|
||||
reconfigured to suit your needs. It must also be copied over from
|
||||
the .sample filename the first time.
|
||||
|
||||
- upsmon can now send a username when authenticating to upsd. It is
|
||||
recommended that you change to this mode, as the old host-based
|
||||
authentication is clunky and eventually will be removed.
|
||||
|
||||
Old way:
|
||||
|
||||
MONITOR myups@bigserver 1 blah master
|
||||
|
||||
New way:
|
||||
|
||||
MONITOR myups@bigserver 1 monmaster blah master
|
||||
|
||||
Note that the username has been inserted between the power value and
|
||||
the password. When switching to this method, be sure to add a user
|
||||
to upsd.users, i.e.:
|
||||
|
||||
[monmaster]
|
||||
password = blah
|
||||
allowfrom = localhost
|
||||
upsmon master
|
||||
|
||||
You still need to give the upsmon host(s) at least "monitor" access,
|
||||
so don't delete those old ACCESS lines in your upsd.conf. Just
|
||||
lower the access level and remove the password.
|
||||
|
||||
Old way:
|
||||
|
||||
ACCESS grant master localhost blah
|
||||
|
||||
New way:
|
||||
|
||||
ACCESS grant monitor localhost
|
||||
|
||||
- The old upsfetch "library" (used loosely) has been replaced by
|
||||
upsclient. This will be installed if you do "make install-misc",
|
||||
but it goes into $(prefix)/lib and $(prefix)/include by default.
|
||||
|
||||
The upsclient interface is not compatible with upsfetch. Old
|
||||
accessory programs which linked to upsfetch will have to be updated
|
||||
to work with upsclient instead.
|
||||
|
||||
Existing binaries that were linked against upsfetch will still work
|
||||
since the network protocol used by upsd has not changed.
|
||||
|
||||
- SET and INSTCMD no longer work via host-level authentication. This
|
||||
is only a meaningful change if you are using very old versions of
|
||||
upscmd/upsct2/upsset.cgi, or if you're talking to upsd directly.
|
||||
|
||||
You must now set a USERNAME first, and authentication will occur
|
||||
through upsd.users as a result.
|
||||
|
||||
This means that the "manager" level in upsd.conf ACCESS directives
|
||||
is no longer meaningful, and you should remove them.
|
||||
|
||||
- INSTALLROOT is no longer available for redirecting 'make install' -
|
||||
use DESTDIR instead.
|
||||
|
||||
- Makefile targets have been reworked to allow fine-grained control
|
||||
over what happens at install-time. 'make install' and 'make
|
||||
install-cgi' still do everything, but you can call subsets instead
|
||||
if necessary. See ChangeLog.
|
||||
|
|
1167
aclocal.m4
vendored
1167
aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,21 +1,9 @@
|
|||
# Network UPS Tools: clients
|
||||
EXTRA_DIST =
|
||||
|
||||
# nutclient.cpp for some legacy reason (maybe initial detached development?)
|
||||
# optionally includes "common.h" with the NUT build setup - and this option
|
||||
# was never triggered in fact, not until pushed through command line like this:
|
||||
AM_CXXFLAGS = -DHAVE_NUTCOMMON=1 -I$(top_srcdir)/include
|
||||
|
||||
# Make sure out-of-dir dependencies exist (especially when dev-building parts):
|
||||
$(top_builddir)/common/libcommon.la \
|
||||
$(top_builddir)/common/libcommonclient.la \
|
||||
$(top_builddir)/common/libparseconf.la: dummy
|
||||
@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
|
||||
|
||||
# by default, link programs in this directory with libcommon.a
|
||||
LDADD = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS)
|
||||
LDADD = ../common/libcommon.a libupsclient.la $(NETLIBS)
|
||||
if WITH_SSL
|
||||
LDADD += $(LIBSSL_LIBS)
|
||||
LDADD += $(LIBSSL_LDFLAGS)
|
||||
endif
|
||||
|
||||
# Avoid per-target CFLAGS, because this will prevent re-use of object
|
||||
|
@ -33,12 +21,8 @@ bin_PROGRAMS = upsc upslog upsrw upscmd
|
|||
dist_bin_SCRIPTS = upssched-cmd
|
||||
sbin_PROGRAMS = upsmon upssched
|
||||
lib_LTLIBRARIES = libupsclient.la
|
||||
if HAVE_CXX11
|
||||
lib_LTLIBRARIES += libnutclient.la
|
||||
lib_LTLIBRARIES += libnutclientstub.la
|
||||
endif
|
||||
if WITH_DEV
|
||||
include_HEADERS = upsclient.h ../include/parseconf.h nutclient.h nutclientmem.h
|
||||
include_HEADERS = upsclient.h ../include/parseconf.h
|
||||
endif
|
||||
if WITH_CGI
|
||||
cgiexec_PROGRAMS = upsstats.cgi upsimage.cgi upsset.cgi
|
||||
|
@ -51,7 +35,7 @@ upslog_SOURCES = upslog.c upsclient.h upslog.h
|
|||
upsmon_SOURCES = upsmon.c upsmon.h upsclient.h
|
||||
|
||||
upssched_SOURCES = upssched.c upssched.h
|
||||
upssched_LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS)
|
||||
upssched_LDADD = ../common/libcommon.a ../common/libparseconf.la $(NETLIBS)
|
||||
|
||||
upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
|
||||
upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)
|
||||
|
@ -62,44 +46,8 @@ upsstats_cgi_SOURCES = upsstats.c upsclient.h status.h upsstats.h \
|
|||
|
||||
# not LDADD.
|
||||
libupsclient_la_SOURCES = upsclient.c upsclient.h
|
||||
libupsclient_la_LIBADD = $(top_builddir)/common/libcommonclient.la
|
||||
libupsclient_la_LIBADD = ../common/libparseconf.la
|
||||
if WITH_SSL
|
||||
libupsclient_la_LIBADD += $(LIBSSL_LIBS)
|
||||
libupsclient_la_LIBADD += $(LIBSSL_LDFLAGS)
|
||||
endif
|
||||
|
||||
# Below we set API versions of public libraries
|
||||
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||
# Note that changes here may have to be reflected in packaging (the shared
|
||||
# object .so names would differ)
|
||||
|
||||
# libupsclient version information
|
||||
libupsclient_la_LDFLAGS = -version-info 6:0:0 -export-symbols-regex ^upscli_
|
||||
|
||||
if HAVE_CXX11
|
||||
# libnutclient version information and build
|
||||
libnutclient_la_SOURCES = nutclient.h nutclient.cpp
|
||||
libnutclient_la_LDFLAGS = -version-info 2:0:0
|
||||
# Needed in not-standalone builds with -DHAVE_NUTCOMMON=1
|
||||
# which is defined for in-tree CXX builds above:
|
||||
libnutclient_la_LIBADD = $(top_builddir)/common/libcommonclient.la
|
||||
else
|
||||
EXTRA_DIST += nutclient.h nutclient.cpp
|
||||
endif
|
||||
|
||||
if HAVE_CXX11
|
||||
# libnutclientstub version information and build
|
||||
libnutclientstub_la_SOURCES = nutclientmem.h nutclientmem.cpp
|
||||
libnutclientstub_la_LDFLAGS = -version-info 1:0:0
|
||||
libnutclientstub_la_LIBADD = libnutclient.la
|
||||
else
|
||||
EXTRA_DIST += nutclientmem.h nutclientmem.cpp
|
||||
endif
|
||||
|
||||
dummy:
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
|
||||
# NOTE: Do not clean ".deps" in SUBDIRS of the main project,
|
||||
# the root Makefile.am takes care of that!
|
||||
#clean-local:
|
||||
# rm -rf $(builddir)/.deps
|
||||
libupsclient_la_LDFLAGS = -version-info 1:0:0
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -46,12 +46,9 @@ static char *unescape(char *buf)
|
|||
hex[1] = buf[++i];
|
||||
hex[2] = '\0';
|
||||
if (!isxdigit((unsigned char) hex[0])
|
||||
|| !isxdigit((unsigned char) hex[1]))
|
||||
|| !isxdigit((unsigned char) hex[0]))
|
||||
fatalx(EXIT_FAILURE, "bad escape char");
|
||||
long l = strtol(hex, NULL, 16);
|
||||
assert(l>=0);
|
||||
assert(l<=255);
|
||||
ch = (char)l; /* FIXME: Loophole about non-ASCII symbols in top 128 values, or negatives for signed char... */
|
||||
ch = strtol(hex, NULL, 16);
|
||||
|
||||
if ((ch == 10) || (ch == 13))
|
||||
ch = ' ';
|
||||
|
|
|
@ -17,15 +17,6 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef NUT_CGILIB_H_SEEN
|
||||
#define NUT_CGILIB_H_SEEN 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* other programs that link to this should provide parsearg() ... */
|
||||
void parsearg(char *var, char *value);
|
||||
|
||||
|
@ -38,10 +29,3 @@ void extractpostargs(void);
|
|||
/* see if a host is allowed per the hosts.conf */
|
||||
int checkhost(const char *host, char **desc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_CGILIB_H_SEEN */
|
||||
|
|
File diff suppressed because it is too large
Load diff
1072
clients/nutclient.h
1072
clients/nutclient.h
File diff suppressed because it is too large
Load diff
|
@ -1,252 +0,0 @@
|
|||
/* nutclientmem.cpp - nutclientmem C++ library implementation
|
||||
|
||||
Copyright (C) 2021 Eric Clappier <ericclappier@eaton.com>
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "nutclientmem.h"
|
||||
#include <common.h>
|
||||
|
||||
namespace nut
|
||||
{
|
||||
|
||||
/*
|
||||
*
|
||||
* Memory Client stub implementation
|
||||
*
|
||||
*/
|
||||
|
||||
Device MemClientStub::getDevice(const std::string& name)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(name);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
std::set<std::string> MemClientStub::getDeviceNames()
|
||||
{
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
std::string MemClientStub::getDeviceDescription(const std::string& name)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(name);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
std::set<std::string> MemClientStub::getDeviceVariableNames(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
std::set<std::string> MemClientStub::getDeviceRWVariableNames(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
std::string MemClientStub::getDeviceVariableDescription(const std::string& dev, const std::string& name)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
NUT_UNUSED_VARIABLE(name);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
ListValue MemClientStub::getDeviceVariableValue(const std::string& dev, const std::string& name)
|
||||
{
|
||||
ListValue res;
|
||||
auto it_dev = _values.find(dev);
|
||||
if (it_dev != _values.end())
|
||||
{
|
||||
auto map = it_dev->second;
|
||||
auto it_map = map.find(name);
|
||||
if (it_map != map.end())
|
||||
{
|
||||
res = it_map->second;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
ListObject MemClientStub::getDeviceVariableValues(const std::string& dev)
|
||||
{
|
||||
ListObject res;
|
||||
auto it_dev = _values.find(dev);
|
||||
if (it_dev != _values.end())
|
||||
{
|
||||
res = it_dev->second;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
ListDevice MemClientStub::getDevicesVariableValues(const std::set<std::string>& devs)
|
||||
{
|
||||
ListDevice res;
|
||||
for (auto itr = devs.begin(); itr != devs.end(); itr++)
|
||||
{
|
||||
std::string dev = *itr;
|
||||
auto it_dev = _values.find(dev);
|
||||
if (it_dev != _values.end())
|
||||
{
|
||||
res.insert(std::pair<std::string, ListObject>(dev, it_dev->second));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
TrackingID MemClientStub::setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value)
|
||||
{
|
||||
auto it_dev = _values.find(dev);
|
||||
if (it_dev == _values.end())
|
||||
{
|
||||
ListObject list;
|
||||
_values.emplace(dev, list);
|
||||
it_dev = _values.find(dev);
|
||||
}
|
||||
if (it_dev != _values.end())
|
||||
{
|
||||
auto map = &(it_dev->second);
|
||||
auto it_map = map->find(name);
|
||||
if (it_map != map->end())
|
||||
{
|
||||
it_map->second[0] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
ListValue list_value;
|
||||
list_value.push_back(value);
|
||||
map->emplace(name, list_value);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
TrackingID MemClientStub::setDeviceVariable(const std::string& dev, const std::string& name, const ListValue& values)
|
||||
{
|
||||
auto it_dev = _values.find(dev);
|
||||
if (it_dev != _values.end())
|
||||
{
|
||||
auto map = &(it_dev->second);
|
||||
auto it_map = map->find(name);
|
||||
if (it_map != map->end())
|
||||
{
|
||||
it_map->second = values;
|
||||
}
|
||||
else
|
||||
{
|
||||
map->emplace(name, values);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::set<std::string> MemClientStub::getDeviceCommandNames(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
std::string MemClientStub::getDeviceCommandDescription(const std::string& dev, const std::string& name)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
NUT_UNUSED_VARIABLE(name);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
TrackingID MemClientStub::executeDeviceCommand(const std::string& dev, const std::string& name, const std::string& param)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
NUT_UNUSED_VARIABLE(name);
|
||||
NUT_UNUSED_VARIABLE(param);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
void MemClientStub::deviceLogin(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
/* Note: "master" is deprecated, but supported
|
||||
* for mixing old/new client/server combos: */
|
||||
void MemClientStub::deviceMaster(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
void MemClientStub::devicePrimary(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
void MemClientStub::deviceForcedShutdown(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
int MemClientStub::deviceGetNumLogins(const std::string& dev)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(dev);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
TrackingResult MemClientStub::getTrackingResult(const TrackingID& id)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(id);
|
||||
throw NutException("Not implemented");
|
||||
//return TrackingResult::SUCCESS;
|
||||
}
|
||||
|
||||
bool MemClientStub::isFeatureEnabled(const Feature& feature)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(feature);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
void MemClientStub::setFeature(const Feature& feature, bool status)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(feature);
|
||||
NUT_UNUSED_VARIABLE(status);
|
||||
throw NutException("Not implemented");
|
||||
}
|
||||
|
||||
} /* namespace nut */
|
||||
|
||||
/**
|
||||
* C nutclient API.
|
||||
*/
|
||||
extern "C" {
|
||||
|
||||
NUTCLIENT_MEM_t nutclient_mem_create_client()
|
||||
{
|
||||
nut::MemClientStub* client = new nut::MemClientStub;
|
||||
try
|
||||
{
|
||||
return static_cast<NUTCLIENT_MEM_t>(client);
|
||||
}
|
||||
catch(nut::NutException& ex)
|
||||
{
|
||||
// TODO really catch it
|
||||
NUT_UNUSED_VARIABLE(ex);
|
||||
delete client;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
|
@ -1,118 +0,0 @@
|
|||
/* nutclientmem.h - definitions for nutclientmem C/C++ library
|
||||
|
||||
Copyright (C) 2021 Eric Clappier <ericclappier@eaton.com>
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef NUTCLIENTMEM_HPP_SEEN
|
||||
#define NUTCLIENTMEM_HPP_SEEN
|
||||
|
||||
/* Begin of C++ nutclient library declaration */
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "nutclient.h"
|
||||
|
||||
namespace nut
|
||||
{
|
||||
|
||||
typedef std::vector<std::string> ListValue;
|
||||
typedef std::map<std::string, ListValue> ListObject;
|
||||
typedef std::map<std::string, ListObject> ListDevice;
|
||||
|
||||
/**
|
||||
* Memory client stub.
|
||||
* Class to stub TCPClient for test (data store in local memory).
|
||||
*/
|
||||
class MemClientStub : public Client
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Construct a nut MemClientStub object.
|
||||
*/
|
||||
MemClientStub() {}
|
||||
~MemClientStub() override {}
|
||||
|
||||
virtual void authenticate(const std::string& user, const std::string& passwd) override {
|
||||
NUT_UNUSED_VARIABLE(user);
|
||||
NUT_UNUSED_VARIABLE(passwd);
|
||||
}
|
||||
virtual void logout() override {}
|
||||
|
||||
virtual Device getDevice(const std::string& name) override;
|
||||
virtual std::set<std::string> getDeviceNames() override;
|
||||
virtual std::string getDeviceDescription(const std::string& name) override;
|
||||
|
||||
virtual std::set<std::string> getDeviceVariableNames(const std::string& dev) override;
|
||||
virtual std::set<std::string> getDeviceRWVariableNames(const std::string& dev) override;
|
||||
virtual std::string getDeviceVariableDescription(const std::string& dev, const std::string& name) override;
|
||||
virtual ListValue getDeviceVariableValue(const std::string& dev, const std::string& name) override;
|
||||
virtual ListObject getDeviceVariableValues(const std::string& dev) override;
|
||||
virtual ListDevice getDevicesVariableValues(const std::set<std::string>& devs) override;
|
||||
virtual TrackingID setDeviceVariable(const std::string& dev, const std::string& name, const std::string& value) override;
|
||||
virtual TrackingID setDeviceVariable(const std::string& dev, const std::string& name, const ListValue& values) override;
|
||||
|
||||
virtual std::set<std::string> getDeviceCommandNames(const std::string& dev) override;
|
||||
virtual std::string getDeviceCommandDescription(const std::string& dev, const std::string& name) override;
|
||||
virtual TrackingID executeDeviceCommand(const std::string& dev, const std::string& name, const std::string& param="") override;
|
||||
|
||||
virtual void deviceLogin(const std::string& dev) override;
|
||||
/* Note: "master" is deprecated, but supported
|
||||
* for mixing old/new client/server combos: */
|
||||
virtual void deviceMaster(const std::string& dev) override;
|
||||
virtual void devicePrimary(const std::string& dev) override;
|
||||
virtual void deviceForcedShutdown(const std::string& dev) override;
|
||||
virtual int deviceGetNumLogins(const std::string& dev) override;
|
||||
|
||||
virtual TrackingResult getTrackingResult(const TrackingID& id) override;
|
||||
|
||||
virtual bool isFeatureEnabled(const Feature& feature) override;
|
||||
virtual void setFeature(const Feature& feature, bool status) override;
|
||||
|
||||
private:
|
||||
ListDevice _values;
|
||||
};
|
||||
|
||||
} /* namespace nut */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
/* End of C++ nutclient library declaration */
|
||||
|
||||
/* Begin of C nutclient library declaration */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/**
|
||||
* Nut MEM client dedicated types and functions
|
||||
*/
|
||||
/**
|
||||
* Hidden structure representing a MEM connection.
|
||||
* NUTCLIENT_MEM_t is back compatible to NUTCLIENT_t.
|
||||
*/
|
||||
typedef NUTCLIENT_t NUTCLIENT_MEM_t;
|
||||
|
||||
/**
|
||||
* Create a client to NUTD using memory.
|
||||
* \return New client or nullptr if failed.
|
||||
*/
|
||||
NUTCLIENT_MEM_t nutclient_mem_create_client();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
/* End of C nutclient library declaration */
|
||||
|
||||
#endif /* NUTCLIENTMOCK_HPP_SEEN */
|
|
@ -17,19 +17,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef NUT_STATUS_H_SEEN
|
||||
#define NUT_STATUS_H_SEEN 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* This is only used in upsstats.c, but might it also have external consumers?..
|
||||
* To move or not to move?..
|
||||
*/
|
||||
static struct {
|
||||
struct {
|
||||
char *name;
|
||||
char *desc;
|
||||
int severity;
|
||||
|
@ -47,11 +35,3 @@ static struct {
|
|||
{ "BYPASS", "BYPASS", 2 },
|
||||
{ NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_STATUS_H_SEEN */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* upsc - simple "client" to test communications
|
||||
|
||||
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
|
||||
Copyright (C) 2012 Arnaud Quette <arnaud.quette@free.fr>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -19,13 +18,11 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "nut_platform.h"
|
||||
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "nut_stdint.h"
|
||||
#include "upsclient.h"
|
||||
|
||||
static char *upsname = NULL, *hostname = NULL;
|
||||
|
@ -37,7 +34,6 @@ static void usage(const char *prog)
|
|||
|
||||
printf("usage: %s -l | -L [<hostname>[:port]]\n", prog);
|
||||
printf(" %s <ups> [<variable>]\n", prog);
|
||||
printf(" %s -c <ups>\n", prog);
|
||||
|
||||
printf("\nDemo program to display UPS variables.\n\n");
|
||||
|
||||
|
@ -50,16 +46,12 @@ static void usage(const char *prog)
|
|||
printf(" <ups> - upsd server, <upsname>[@<hostname>[:<port>]] form\n");
|
||||
printf(" <variable> - optional, display this variable only.\n");
|
||||
printf(" Default: list all variables for <host>\n");
|
||||
|
||||
printf("\nThird form (lists clients connected to a device):\n");
|
||||
printf(" -c - lists each client connected on <ups>, one per line.\n");
|
||||
printf(" <ups> - upsd server, <upsname>[@<hostname>[:<port>]] form\n");
|
||||
}
|
||||
|
||||
static void printvar(const char *var)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -87,7 +79,7 @@ static void printvar(const char *var)
|
|||
}
|
||||
|
||||
if (numa < numq) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least %zu)", numa, numq);
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least %d)", numa, numq);
|
||||
}
|
||||
|
||||
printf("%s\n", answer[3]);
|
||||
|
@ -96,7 +88,7 @@ static void printvar(const char *var)
|
|||
static void list_vars(void)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -120,7 +112,7 @@ static void list_vars(void)
|
|||
|
||||
/* VAR <upsname> <varname> <val> */
|
||||
if (numa < 4) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 4)", numa);
|
||||
}
|
||||
|
||||
printf("%s: %s\n", answer[2], answer[3]);
|
||||
|
@ -130,7 +122,7 @@ static void list_vars(void)
|
|||
static void list_upses(int verbose)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -152,7 +144,7 @@ static void list_upses(int verbose)
|
|||
|
||||
/* UPS <upsname> <description> */
|
||||
if (numa < 3) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 3)", numa);
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 3)", numa);
|
||||
}
|
||||
|
||||
if(verbose) {
|
||||
|
@ -163,39 +155,6 @@ static void list_upses(int verbose)
|
|||
}
|
||||
}
|
||||
|
||||
static void list_clients(const char *devname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
query[0] = "CLIENT";
|
||||
query[1] = devname;
|
||||
numq = 2;
|
||||
|
||||
ret = upscli_list_start(ups, numq, query);
|
||||
|
||||
if (ret < 0) {
|
||||
/* check for an old upsd */
|
||||
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
|
||||
fatalx(EXIT_FAILURE, "Error: upsd is too old to support this query");
|
||||
}
|
||||
|
||||
fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
while ((ret=upscli_list_next(ups, numq, query, &numa, &answer)) == 1) {
|
||||
|
||||
/* CLIENT <upsname> <address> */
|
||||
if (numa < 3) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 3)", numa);
|
||||
}
|
||||
|
||||
printf("%s\n", answer[2]);
|
||||
}
|
||||
}
|
||||
|
||||
static void clean_exit(void)
|
||||
{
|
||||
if (ups) {
|
||||
|
@ -209,31 +168,22 @@ static void clean_exit(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
uint16_t port;
|
||||
int varlist = 0, clientlist = 0, verbose = 0;
|
||||
int i, port;
|
||||
int varlist = 0, verbose = 0;
|
||||
const char *prog = xbasename(argv[0]);
|
||||
|
||||
while ((i = getopt(argc, argv, "+hlLcV")) != -1) {
|
||||
while ((i = getopt(argc, argv, "+hlLV")) != -1) {
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 'L':
|
||||
verbose = 1;
|
||||
goto fallthrough_case_l;
|
||||
case 'l':
|
||||
fallthrough_case_l:
|
||||
varlist = 1;
|
||||
break;
|
||||
case 'c':
|
||||
clientlist = 1;
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
fatalx(EXIT_SUCCESS, "Network UPS Tools upscmd %s", UPS_VERSION);
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_SUCCESS); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||
#endif
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
|
@ -269,11 +219,6 @@ int main(int argc, char **argv)
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (clientlist) {
|
||||
list_clients(upsname);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
printvar(argv[1]);
|
||||
} else {
|
||||
|
@ -282,11 +227,3 @@ int main(int argc, char **argv)
|
|||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/* Formal do_upsconf_args implementation to satisfy linker on AIX */
|
||||
#if (defined NUT_PLATFORM_AIX)
|
||||
void do_upsconf_args(char *upsname, char *var, char *val) {
|
||||
fatalx(EXIT_FAILURE, "INTERNAL ERROR: formal do_upsconf_args called");
|
||||
}
|
||||
#endif /* end of #if (defined NUT_PLATFORM_AIX) */
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -20,31 +20,13 @@
|
|||
#ifndef UPSCLIENT_H_SEEN
|
||||
#define UPSCLIENT_H_SEEN
|
||||
|
||||
#ifdef WITH_OPENSSL
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
#elif defined(WITH_NSS) /* WITH_OPENSSL */
|
||||
#include <nss.h>
|
||||
#include <ssl.h>
|
||||
#endif /* WITH_OPENSSL | WITH_NSS */
|
||||
|
||||
/* Not including nut_stdint.h because this is part of end-user API */
|
||||
#if defined HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if defined HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_SSL
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#define UPSCLI_ERRBUF_LEN 256
|
||||
|
@ -54,7 +36,7 @@ extern "C" {
|
|||
|
||||
typedef struct {
|
||||
char *host;
|
||||
uint16_t port;
|
||||
int port;
|
||||
int fd;
|
||||
int flags;
|
||||
int upserror;
|
||||
|
@ -65,13 +47,13 @@ typedef struct {
|
|||
|
||||
char errbuf[UPSCLI_ERRBUF_LEN];
|
||||
|
||||
#ifdef WITH_OPENSSL
|
||||
#ifdef HAVE_SSL
|
||||
SSL_CTX *ssl_ctx;
|
||||
SSL *ssl;
|
||||
#elif defined(WITH_NSS) /* WITH_OPENSSL */
|
||||
PRFileDesc *ssl;
|
||||
#else /* WITH_OPENSSL | WITH_NSS */
|
||||
#else
|
||||
void *ssl_ctx;
|
||||
void *ssl;
|
||||
#endif /* WITH_OPENSSL | WITH_NSS */
|
||||
#endif
|
||||
|
||||
char readbuf[64];
|
||||
size_t readlen;
|
||||
|
@ -81,34 +63,28 @@ typedef struct {
|
|||
|
||||
const char *upscli_strerror(UPSCONN_t *ups);
|
||||
|
||||
int upscli_init(int certverify, const char *certpath, const char *certname, const char *certpasswd);
|
||||
int upscli_cleanup(void);
|
||||
|
||||
int upscli_tryconnect(UPSCONN_t *ups, const char *host, uint16_t port, int flags, struct timeval *tv);
|
||||
int upscli_connect(UPSCONN_t *ups, const char *host, uint16_t port, int flags);
|
||||
|
||||
void upscli_add_host_cert(const char* hostname, const char* certname, int certverify, int forcessl);
|
||||
int upscli_connect(UPSCONN_t *ups, const char *host, int port, int flags);
|
||||
|
||||
/* --- functions that only use the new names --- */
|
||||
|
||||
int upscli_get(UPSCONN_t *ups, size_t numq, const char **query,
|
||||
size_t *numa, char ***answer);
|
||||
int upscli_get(UPSCONN_t *ups, unsigned int numq, const char **query,
|
||||
unsigned int *numa, char ***answer);
|
||||
|
||||
int upscli_list_start(UPSCONN_t *ups, size_t numq, const char **query);
|
||||
int upscli_list_start(UPSCONN_t *ups, unsigned int numq, const char **query);
|
||||
|
||||
int upscli_list_next(UPSCONN_t *ups, size_t numq, const char **query,
|
||||
size_t *numa, char ***answer);
|
||||
int upscli_list_next(UPSCONN_t *ups, unsigned int numq, const char **query,
|
||||
unsigned int *numa, char ***answer);
|
||||
|
||||
ssize_t upscli_sendline_timeout(UPSCONN_t *ups, const char *buf, size_t buflen, const time_t timeout);
|
||||
ssize_t upscli_sendline(UPSCONN_t *ups, const char *buf, size_t buflen);
|
||||
int upscli_sendline(UPSCONN_t *ups, const char *buf, size_t buflen);
|
||||
|
||||
ssize_t upscli_readline_timeout(UPSCONN_t *ups, char *buf, size_t buflen, const time_t timeout);
|
||||
ssize_t upscli_readline(UPSCONN_t *ups, char *buf, size_t buflen);
|
||||
int upscli_readline(UPSCONN_t *ups, char *buf, size_t buflen);
|
||||
|
||||
int upscli_splitname(const char *buf, char **upsname, char **hostname,
|
||||
uint16_t *port);
|
||||
int *port);
|
||||
|
||||
int upscli_splitaddr(const char *buf, char **hostname, uint16_t *port);
|
||||
int upscli_splitaddr(const char *buf, char **hostname, int *port);
|
||||
|
||||
int upscli_sslcert(UPSCONN_t *ups, const char *file, const char *path, int verify);
|
||||
|
||||
int upscli_disconnect(UPSCONN_t *ups);
|
||||
|
||||
|
@ -178,13 +154,13 @@ int upscli_ssl(UPSCONN_t *ups);
|
|||
|
||||
#define UPSCLI_CONN_TRYSSL 0x0001 /* try SSL, OK if not supported */
|
||||
#define UPSCLI_CONN_REQSSL 0x0002 /* try SSL, fail if not supported */
|
||||
#ifdef HAVE_IPV6
|
||||
#define UPSCLI_CONN_INET 0x0004 /* IPv4 only */
|
||||
#define UPSCLI_CONN_INET6 0x0008 /* IPv6 only */
|
||||
#define UPSCLI_CONN_CERTVERIF 0x0010 /* Verify certificates for SSL */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* UPSCLIENT_H_SEEN */
|
||||
|
|
160
clients/upscmd.c
160
clients/upscmd.c
|
@ -1,8 +1,6 @@
|
|||
/* upscmd - simple "client" to test instant commands via upsd
|
||||
|
||||
Copyright (C)
|
||||
2000 Russell Kroll <rkroll@exploits.org>
|
||||
2019 EATON (author: Arnaud Quette <ArnaudQuette@eaton.com>)
|
||||
Copyright (C) 2000 Russell Kroll <rkroll@exploits.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,7 +18,6 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "nut_platform.h"
|
||||
|
||||
#include <pwd.h>
|
||||
#include <netdb.h>
|
||||
|
@ -28,13 +25,10 @@
|
|||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "nut_stdint.h"
|
||||
#include "upsclient.h"
|
||||
|
||||
static char *upsname = NULL, *hostname = NULL;
|
||||
static UPSCONN_t *ups = NULL;
|
||||
static int tracking_enabled = 0;
|
||||
static unsigned int timeout = DEFAULT_TRACKING_TIMEOUT;
|
||||
|
||||
struct list_t {
|
||||
char *name;
|
||||
|
@ -46,16 +40,13 @@ static void usage(const char *prog)
|
|||
printf("Network UPS Tools upscmd %s\n\n", UPS_VERSION);
|
||||
printf("usage: %s [-h]\n", prog);
|
||||
printf(" %s [-l <ups>]\n", prog);
|
||||
printf(" %s [-u <username>] [-p <password>] [-w] [-t <timeout>] <ups> <command> [<value>]\n\n", prog);
|
||||
printf(" %s [-u <username>] [-p <password>] <ups> <command> [<value>]\n\n", prog);
|
||||
printf("Administration program to initiate instant commands on UPS hardware.\n");
|
||||
printf("\n");
|
||||
printf(" -h display this help text\n");
|
||||
printf(" -l <ups> show available commands on UPS <ups>\n");
|
||||
printf(" -u <username> set username for command authentication\n");
|
||||
printf(" -p <password> set password for command authentication\n");
|
||||
printf(" -w wait for the completion of command by the driver\n");
|
||||
printf(" and return its actual result from the device\n");
|
||||
printf(" -t <timeout> set a timeout when using -w (in seconds, default: %u)\n", DEFAULT_TRACKING_TIMEOUT);
|
||||
printf("\n");
|
||||
printf(" <ups> UPS identifier - <upsname>[@<hostname>[:<port>]]\n");
|
||||
printf(" <command> Valid instant command - test.panel.start, etc.\n");
|
||||
|
@ -65,7 +56,7 @@ static void usage(const char *prog)
|
|||
static void print_cmd(char *cmdname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -88,7 +79,7 @@ static void print_cmd(char *cmdname)
|
|||
static void listcmds(void)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
struct list_t *lhead = NULL, *llast = NULL, *ltmp, *lnext;
|
||||
|
@ -113,7 +104,7 @@ static void listcmds(void)
|
|||
|
||||
/* CMD <upsname> <cmdname> */
|
||||
if (numa < 3) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 3)", numa);
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 3)", numa);
|
||||
}
|
||||
|
||||
/* we must first read the entire list of commands,
|
||||
|
@ -144,21 +135,9 @@ static void listcmds(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_BESIDEFUNC) && (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS_BESIDEFUNC) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE_BESIDEFUNC) )
|
||||
# pragma GCC diagnostic push
|
||||
#endif
|
||||
#if (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS_BESIDEFUNC)
|
||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
#if (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE_BESIDEFUNC)
|
||||
# pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
|
||||
#endif
|
||||
static void do_cmd(char **argv, const int argc)
|
||||
{
|
||||
int cmd_complete = 0;
|
||||
char buf[SMALLBUF];
|
||||
char tracking_id[UUID4_LEN];
|
||||
time_t start, now;
|
||||
|
||||
if (argc > 1) {
|
||||
snprintf(buf, sizeof(buf), "INSTCMD %s %s %s\n", upsname, argv[0], argv[1]);
|
||||
|
@ -173,89 +152,7 @@ static void do_cmd(char **argv, const int argc)
|
|||
if (upscli_readline(ups, buf, sizeof(buf)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Instant command failed: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
/* verify answer */
|
||||
if (strncmp(buf, "OK", 2) != 0) {
|
||||
fatalx(EXIT_FAILURE, "Unexpected response from upsd: %s", buf);
|
||||
}
|
||||
|
||||
/* check for status tracking id */
|
||||
if (
|
||||
!tracking_enabled ||
|
||||
/* sanity check on the size: "OK TRACKING " + UUID4_LEN */
|
||||
strlen(buf) != (UUID4_LEN - 1 + strlen("OK TRACKING "))
|
||||
) {
|
||||
/* reply as usual */
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_TRUNCATION
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_TRUNCATION
|
||||
#pragma GCC diagnostic ignored "-Wformat-truncation"
|
||||
#endif
|
||||
/* From the check above, we know that we have exactly UUID4_LEN chars
|
||||
* (aka sizeof(tracking_id)) in the buf after "OK TRACKING " prefix,
|
||||
* plus the null-byte.
|
||||
*/
|
||||
assert (UUID4_LEN == 1 + snprintf(tracking_id, sizeof(tracking_id), "%s", buf + strlen("OK TRACKING ")));
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_TRUNCATION
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
time(&start);
|
||||
|
||||
/* send status tracking request, looping if status is PENDING */
|
||||
while (!cmd_complete) {
|
||||
|
||||
/* check for timeout */
|
||||
time(&now);
|
||||
if (difftime(now, start) >= timeout)
|
||||
fatalx(EXIT_FAILURE, "Can't receive status tracking information: timeout");
|
||||
|
||||
snprintf(buf, sizeof(buf), "GET TRACKING %s\n", tracking_id);
|
||||
|
||||
if (upscli_sendline(ups, buf, strlen(buf)) < 0)
|
||||
fatalx(EXIT_FAILURE, "Can't send status tracking request: %s", upscli_strerror(ups));
|
||||
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE) )
|
||||
/* Note for gating macros above: unsuffixed HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP
|
||||
* means support of contexts both inside and outside function body, so the push
|
||||
* above and pop below (outside this finction) are not used.
|
||||
*/
|
||||
# pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS
|
||||
/* Note that the individual warning pragmas for use inside function bodies
|
||||
* are named without a _INSIDEFUNC suffix, for simplicity and legacy reasons
|
||||
*/
|
||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE
|
||||
# pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
|
||||
#endif
|
||||
/* and get status tracking reply */
|
||||
assert(timeout < LONG_MAX);
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE) )
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if (upscli_readline_timeout(ups, buf, sizeof(buf), (long)timeout) < 0)
|
||||
fatalx(EXIT_FAILURE, "Can't receive status tracking information: %s", upscli_strerror(ups));
|
||||
|
||||
if (strncmp(buf, "PENDING", 7))
|
||||
cmd_complete = 1;
|
||||
else
|
||||
/* wait a second before retrying */
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
}
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_BESIDEFUNC) && (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS_BESIDEFUNC) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE_BESIDEFUNC) )
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
static void clean_exit(void)
|
||||
{
|
||||
|
@ -270,14 +167,12 @@ static void clean_exit(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
uint16_t port;
|
||||
ssize_t ret;
|
||||
int i, ret, port;
|
||||
int have_un = 0, have_pw = 0, cmdlist = 0;
|
||||
char buf[SMALLBUF * 2], username[SMALLBUF], password[SMALLBUF];
|
||||
char buf[SMALLBUF], username[SMALLBUF], password[SMALLBUF];
|
||||
const char *prog = xbasename(argv[0]);
|
||||
|
||||
while ((i = getopt(argc, argv, "+lhu:p:t:wV")) != -1) {
|
||||
while ((i = getopt(argc, argv, "+lhu:p:V")) != -1) {
|
||||
|
||||
switch (i)
|
||||
{
|
||||
|
@ -295,20 +190,8 @@ int main(int argc, char **argv)
|
|||
have_pw = 1;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
if (!str_to_uint(optarg, &timeout, 10))
|
||||
fatal_with_errno(EXIT_FAILURE, "Could not convert the provided value for timeout ('-t' option) to unsigned int");
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
tracking_enabled = 1;
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
fatalx(EXIT_SUCCESS, "Network UPS Tools upscmd %s", UPS_VERSION);
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_SUCCESS); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||
#endif
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
|
@ -422,34 +305,7 @@ int main(int argc, char **argv)
|
|||
fatalx(EXIT_FAILURE, "Set password failed: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
/* enable status tracking ID */
|
||||
if (tracking_enabled) {
|
||||
|
||||
snprintf(buf, sizeof(buf), "SET TRACKING ON\n");
|
||||
|
||||
if (upscli_sendline(ups, buf, strlen(buf)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Can't enable command status tracking: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
if (upscli_readline(ups, buf, sizeof(buf)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Enabling command status tracking failed: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
/* Verify the result */
|
||||
if (strncmp(buf, "OK", 2) != 0) {
|
||||
fatalx(EXIT_FAILURE, "Enabling command status tracking failed. upsd answered: %s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
do_cmd(&argv[1], argc - 1);
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/* Formal do_upsconf_args implementation to satisfy linker on AIX */
|
||||
#if (defined NUT_PLATFORM_AIX)
|
||||
void do_upsconf_args(char *upsname, char *var, char *val) {
|
||||
fatalx(EXIT_FAILURE, "INTERNAL ERROR: formal do_upsconf_args called");
|
||||
}
|
||||
#endif /* end of #if (defined NUT_PLATFORM_AIX) */
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "nut_stdint.h"
|
||||
#include "upsclient.h"
|
||||
#include "cgilib.h"
|
||||
#include <stdlib.h>
|
||||
|
@ -50,7 +49,7 @@
|
|||
|
||||
static char *monhost = NULL, *cmd = NULL;
|
||||
|
||||
static uint16_t port;
|
||||
static int port;
|
||||
static char *upsname, *hostname;
|
||||
static UPSCONN_t ups;
|
||||
|
||||
|
@ -61,7 +60,7 @@ static UPSCONN_t ups;
|
|||
|
||||
void parsearg(char *var, char *value)
|
||||
{
|
||||
long long i, v; /* Be big enough to fit all expected inputs; truncate later */
|
||||
int i, v;
|
||||
|
||||
/* avoid bogus junk from evil people */
|
||||
if ((strlen(var) > MAX_CGI_STRLEN) || (strlen(value) > MAX_CGI_STRLEN))
|
||||
|
@ -83,20 +82,17 @@ void parsearg(char *var, char *value)
|
|||
for (i = 0; imgarg[i].name != NULL; i++) {
|
||||
if (!strcmp(imgarg[i].name, var)) {
|
||||
if (!strncmp(value, "0x", 2))
|
||||
v = (long long)strtoul(value + 2, (char **)NULL, 16);
|
||||
v = strtoul(value + 2, (char **)NULL, 16);
|
||||
else
|
||||
v = (long long)atoi(value);
|
||||
v = atoi(value);
|
||||
|
||||
/* avoid false numbers from bad people */
|
||||
if (v < imgarg[i].min)
|
||||
imgarg[i].val = imgarg[i].min;
|
||||
else if (v > imgarg[i].max)
|
||||
imgarg[i].val = imgarg[i].max;
|
||||
else {
|
||||
assert (v < INT_MAX);
|
||||
assert (v > INT_MIN);
|
||||
imgarg[i].val = (int)v;
|
||||
}
|
||||
else
|
||||
imgarg[i].val = v;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -115,9 +111,6 @@ static int get_imgarg(const char *name)
|
|||
}
|
||||
|
||||
/* write the HTML header then have gd dump the image */
|
||||
static void drawimage(gdImagePtr im)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void drawimage(gdImagePtr im)
|
||||
{
|
||||
printf("Pragma: no-cache\n");
|
||||
|
@ -207,25 +200,13 @@ static void drawscale(
|
|||
if (level % step10 == 0) {
|
||||
y = scale_height * (lvlhi - level) / range;
|
||||
snprintf(lbltxt, sizeof(lbltxt), "%d", level);
|
||||
gdImageString(im, gdFontMediumBold,
|
||||
width - (int)(strlen(lbltxt)) * gdFontMediumBold->w,
|
||||
y, (unsigned char *) lbltxt, scale_num_color);
|
||||
gdImageString(im, gdFontMediumBold, width - strlen(lbltxt)*gdFontMediumBold->w, y,
|
||||
(unsigned char *) lbltxt, scale_num_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* draws the bar style indicator */
|
||||
static void drawbar(
|
||||
int lvllo, int lvlhi, /* min and max numbers on the scale */
|
||||
int step, int step5, int step10, /* steps for minor, submajor and major dashes */
|
||||
int redlo1, int redhi1, /* first red zone start and end */
|
||||
int redlo2, int redhi2, /* second red zone start and end */
|
||||
int grnlo, int grnhi, /* green zone start and end */
|
||||
double value, /* UPS variable value to draw */
|
||||
const char *format /* printf style format to be used when rendering summary text */
|
||||
)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void drawbar(
|
||||
int lvllo, int lvlhi, /* min and max numbers on the scale */
|
||||
int step, int step5, int step10, /* steps for minor, submajor and major dashes */
|
||||
|
@ -259,7 +240,7 @@ static void drawbar(
|
|||
summary_color = color_alloc(im, get_imgarg("summary_col"));
|
||||
|
||||
/* rescale UPS value to fit in the scale */
|
||||
bar_y = (int)((1.0 - (value - lvllo) / (lvlhi - lvllo)) * scale_height);
|
||||
bar_y = (1 - (value - lvllo) / (lvlhi - lvllo)) * scale_height;
|
||||
|
||||
/* sanity checks: */
|
||||
|
||||
|
@ -276,21 +257,9 @@ static void drawbar(
|
|||
bar_color);
|
||||
|
||||
/* stick the text version of the value at the bottom center */
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
snprintf(text, sizeof(text), format, value);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
gdImageString(im, gdFontMediumBold,
|
||||
(width - (int)(strlen(text))*gdFontMediumBold->w)/2,
|
||||
(width - strlen(text)*gdFontMediumBold->w)/2,
|
||||
height - gdFontMediumBold->h,
|
||||
(unsigned char *) text, summary_color);
|
||||
|
||||
|
@ -300,9 +269,6 @@ static void drawbar(
|
|||
}
|
||||
|
||||
/* draws the error image */
|
||||
static void noimage(const char *fmt, ...)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void noimage(const char *fmt, ...)
|
||||
{
|
||||
gdImagePtr im;
|
||||
|
@ -312,19 +278,7 @@ static void noimage(const char *fmt, ...)
|
|||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(ap);
|
||||
|
||||
width = get_imgarg("width");
|
||||
|
@ -339,23 +293,17 @@ static void noimage(const char *fmt, ...)
|
|||
|
||||
if (width > height)
|
||||
gdImageString(im, gdFontMediumBold,
|
||||
(width - (int)(strlen(msg))*gdFontMediumBold->w)/2,
|
||||
(width - strlen(msg)*gdFontMediumBold->w)/2,
|
||||
(height - gdFontMediumBold->h)/2,
|
||||
(unsigned char *) msg, summary_color);
|
||||
else
|
||||
gdImageStringUp(im, gdFontMediumBold,
|
||||
(width - gdFontMediumBold->h)/2,
|
||||
(height + (int)(strlen(msg))*gdFontMediumBold->w)/2,
|
||||
(height + strlen(msg)*gdFontMediumBold->w)/2,
|
||||
(unsigned char *) msg, summary_color);
|
||||
|
||||
drawimage(im);
|
||||
|
||||
/* NOTE: Earlier code called noimage() and then exit(EXIT_FAILURE);
|
||||
* to signal an error via process exit code. Now that drawimage()
|
||||
* always ends with exit(EXIT_SUCCESS) - which might make webserver
|
||||
* feel good - the command-line use if any suffers no error returns.
|
||||
*/
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
|
@ -363,10 +311,6 @@ static void noimage(const char *fmt, ...)
|
|||
UPS variable can be determined.
|
||||
deviation < 0 means that values below nom should be grey instead of
|
||||
green */
|
||||
static void drawgeneralbar(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void drawgeneralbar(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
|
@ -426,10 +370,6 @@ static void drawgeneralbar(double var, int min, int nom, int max,
|
|||
}
|
||||
|
||||
/* draws input and output voltage bar style indicators */
|
||||
static void draw_utility(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void draw_utility(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
|
@ -465,7 +405,7 @@ static void draw_utility(double var, int min, int nom, int max,
|
|||
|
||||
/* Acceptable range of voltage is 85%-110% of nominal voltage
|
||||
* in EU at least. Be conservative and say +-10% */
|
||||
deviation = (int)(nom * 0.1);
|
||||
deviation = nom*0.1;
|
||||
|
||||
drawgeneralbar(var, min, nom, max, deviation, format);
|
||||
|
||||
|
@ -473,17 +413,9 @@ static void draw_utility(double var, int min, int nom, int max,
|
|||
}
|
||||
|
||||
/* draws battery.percent bar style indicator */
|
||||
static void draw_battpct(double var, int min, int nom,
|
||||
int max, int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void draw_battpct(double var, int min, int nom,
|
||||
int max, int deviation, const char *format)
|
||||
static void draw_battpct(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(nom);
|
||||
NUT_UNUSED_VARIABLE(max);
|
||||
NUT_UNUSED_VARIABLE(deviation);
|
||||
|
||||
if (min < 0) {
|
||||
min = 50;
|
||||
}
|
||||
|
@ -492,10 +424,6 @@ static void draw_battpct(double var, int min, int nom,
|
|||
}
|
||||
|
||||
/* draws battery.voltage bar style indicator */
|
||||
static void draw_battvolt(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void draw_battvolt(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
|
@ -522,17 +450,18 @@ static void draw_battvolt(double var, int min, int nom, int max,
|
|||
}
|
||||
|
||||
if(min == -1) {
|
||||
min = (int)(nom/2*1.6+1); /* Assume a 2V cell is dead at 1.6V */
|
||||
min = nom/2*1.6+1; /* Assume a 2V cell is dead at 1.6V */
|
||||
}
|
||||
|
||||
if(max == -1) {
|
||||
max = (int)(nom/2*2.3+1); /* Assume 2.3V float charge voltage */
|
||||
max = nom/2*2.3+1; /* Assume 2.3V float charge voltage */
|
||||
}
|
||||
|
||||
if (nom < min || nom > max)
|
||||
nom = -1;
|
||||
|
||||
deviation = (int)(-nom*0.05); /* 5% deviation from nominal voltage */
|
||||
|
||||
deviation = -(nom*0.05); /* 5% deviation from nominal voltage */
|
||||
if(deviation==0) {
|
||||
deviation = -1;
|
||||
}
|
||||
|
@ -541,57 +470,33 @@ static void draw_battvolt(double var, int min, int nom, int max,
|
|||
}
|
||||
|
||||
/* draws ups.load bar style indicator */
|
||||
static void draw_upsload(double var, int min,
|
||||
int nom, int max,
|
||||
int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void draw_upsload(double var, int min,
|
||||
int nom, int max,
|
||||
static void draw_upsload(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(min);
|
||||
NUT_UNUSED_VARIABLE(nom);
|
||||
NUT_UNUSED_VARIABLE(max);
|
||||
NUT_UNUSED_VARIABLE(deviation);
|
||||
|
||||
drawbar(0, 125, 5, 5, 25, 100, 125, -1, -1, 0, 50, var, format);
|
||||
}
|
||||
|
||||
/* draws temperature bar style indicator */
|
||||
static void draw_temperature(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void draw_temperature(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
int hi = get_imgarg("tempmax");
|
||||
int lo = get_imgarg("tempmin");
|
||||
NUT_UNUSED_VARIABLE(nom);
|
||||
NUT_UNUSED_VARIABLE(deviation);
|
||||
|
||||
drawbar(lo, hi, 1, 5, 10, lo, min, max, hi, -1, -1, var, format);
|
||||
}
|
||||
|
||||
/* draws humidity bar style indicator */
|
||||
static void draw_humidity(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void draw_humidity(double var, int min, int nom, int max,
|
||||
int deviation, const char *format)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(nom);
|
||||
NUT_UNUSED_VARIABLE(deviation);
|
||||
|
||||
drawbar(0, 100, 2, 10, 20, 0, min, max, 100, -1, -1, var, format);
|
||||
}
|
||||
|
||||
static int get_var(const char *var, char *buf, size_t buflen)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -618,8 +523,6 @@ int main(int argc, char **argv)
|
|||
char str[SMALLBUF];
|
||||
int i, min, nom, max;
|
||||
double var = 0;
|
||||
NUT_UNUSED_VARIABLE(argc);
|
||||
NUT_UNUSED_VARIABLE(argv);
|
||||
|
||||
extractcgiargs();
|
||||
|
||||
|
@ -634,17 +537,13 @@ int main(int argc, char **argv)
|
|||
|
||||
if (upscli_splitname(monhost, &upsname, &hostname, &port) != 0) {
|
||||
noimage("Invalid UPS definition (upsname[@hostname[:port]])\n");
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (upscli_connect(&ups, hostname, port, 0) < 0) {
|
||||
noimage("Can't connect to server:\n%s\n",
|
||||
upscli_strerror(&ups));
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (i = 0; imgvar[i].name; i++)
|
||||
|
@ -654,9 +553,7 @@ int main(int argc, char **argv)
|
|||
registered with this variable */
|
||||
if (!imgvar[i].drawfunc) {
|
||||
noimage("Draw function N/A");
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* get the variable value */
|
||||
|
@ -667,9 +564,7 @@ int main(int argc, char **argv)
|
|||
snprintf(str, sizeof(str), "%s N/A",
|
||||
imgvar[i].name);
|
||||
noimage(str);
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* when getting minimum, nominal and maximum values,
|
||||
|
@ -722,12 +617,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
noimage("Unknown display");
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
exit(EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
||||
imgvar_t imgvar[] = {
|
||||
struct imgvar_t imgvar[] = {
|
||||
{ "input.voltage", "input.transfer.low", "input.voltage.nominal",
|
||||
"input.transfer.high", 0,
|
||||
"%.1f VAC", draw_utility },
|
||||
|
|
|
@ -17,20 +17,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef NUT_UPSIMAGEARG_H_SEEN
|
||||
#define NUT_UPSIMAGEARG_H_SEEN 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* This is used in upsstats.c and in upsimage.c, but compiler complains about
|
||||
* non-extern definition if this is not "static". To move or not to move?..
|
||||
* Do we have cases of building binaries refering to only one of those objects?
|
||||
*/
|
||||
static struct {
|
||||
struct {
|
||||
char *name;
|
||||
int val; /* hex digits, ala HTML */
|
||||
int min; /* minimum reasonable value */
|
||||
|
@ -57,7 +44,7 @@ static struct {
|
|||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct imgvar_t {
|
||||
char *name; /* name of the UPS variable */
|
||||
char *minimum; /* name of minimum value UPS variable
|
||||
or variable in imgarg table */
|
||||
|
@ -68,14 +55,6 @@ typedef struct {
|
|||
|
||||
/* pointer to drawing function */
|
||||
void (*drawfunc)(double, int, int, int, int, const char*);
|
||||
} imgvar_t;
|
||||
};
|
||||
|
||||
extern imgvar_t imgvar[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_UPSIMAGEARG_H_SEEN */
|
||||
extern struct imgvar_t imgvar[];
|
||||
|
|
|
@ -32,16 +32,13 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "nut_platform.h"
|
||||
#include "upsclient.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "timehead.h"
|
||||
#include "nut_stdint.h"
|
||||
#include "upslog.h"
|
||||
|
||||
static int reopen_flag = 0, exit_flag = 0;
|
||||
static uint16_t port;
|
||||
static int port, reopen_flag = 0, exit_flag = 0;
|
||||
static char *upsname, *hostname;
|
||||
static UPSCONN_t ups;
|
||||
|
||||
|
@ -50,7 +47,7 @@
|
|||
static sigset_t nut_upslog_sigmask;
|
||||
static char logbuffer[LARGEBUF], *logformat;
|
||||
|
||||
static flist_t *fhead = NULL;
|
||||
static struct flist_t *fhead = NULL;
|
||||
|
||||
#define DEFAULT_LOGFORMAT "%TIME @Y@m@d @H@M@S% %VAR battery.charge% " \
|
||||
"%VAR input.voltage% %VAR ups.load% [%VAR ups.status%] " \
|
||||
|
@ -79,13 +76,6 @@ static void set_exit_flag(int sig)
|
|||
exit_flag = sig;
|
||||
}
|
||||
|
||||
static void set_print_now_flag(int sig)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(sig);
|
||||
|
||||
/* no need to do anything, the signal will cause sleep to be interrupted */
|
||||
}
|
||||
|
||||
/* handlers: reload on HUP, exit on INT/QUIT/TERM */
|
||||
static void setup_signals(void)
|
||||
{
|
||||
|
@ -106,15 +96,8 @@ static void setup_signals(void)
|
|||
fatal_with_errno(EXIT_FAILURE, "Can't install SIGQUIT handler");
|
||||
if (sigaction(SIGTERM, &sa, NULL) < 0)
|
||||
fatal_with_errno(EXIT_FAILURE, "Can't install SIGTERM handler");
|
||||
|
||||
sa.sa_handler = set_print_now_flag;
|
||||
if (sigaction(SIGUSR1, &sa, NULL) < 0)
|
||||
fatal_with_errno(EXIT_FAILURE, "Can't install SIGUSR1 handler");
|
||||
}
|
||||
|
||||
static void help(const char *prog)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void help(const char *prog)
|
||||
{
|
||||
printf("UPS status logger.\n");
|
||||
|
@ -125,10 +108,8 @@ static void help(const char *prog)
|
|||
printf(" -f <format> - Log format. See below for details.\n");
|
||||
printf(" - Use -f \"<format>\" so your shell doesn't break it up.\n");
|
||||
printf(" -i <interval> - Time between updates, in seconds\n");
|
||||
printf(" -l <logfile> - Log file name, or - for stdout (foreground by default)\n");
|
||||
printf(" -F - stay foregrounded even if logging into a file\n");
|
||||
printf(" -B - stay backgrounded even if logging to stdout\n");
|
||||
printf(" -p <pidbase> - Base name for PID file (defaults to \"%s\")\n", prog);
|
||||
printf(" -l <logfile> - Log file name, or - for stdout\n");
|
||||
printf(" -p <pidbase> - Base name for PID file (defaults to \"upslog\")\n");
|
||||
printf(" -s <ups> - Monitor UPS <ups> - <upsname>@<host>[:<port>]\n");
|
||||
printf(" - Example: -s myups@server\n");
|
||||
printf(" -u <user> - Switch to <user> if started as root\n");
|
||||
|
@ -155,7 +136,6 @@ static void do_host(const char *arg)
|
|||
{
|
||||
int ret;
|
||||
char hn[LARGEBUF];
|
||||
NUT_UNUSED_VARIABLE(arg);
|
||||
|
||||
ret = gethostname(hn, sizeof(hn));
|
||||
|
||||
|
@ -169,15 +149,11 @@ static void do_host(const char *arg)
|
|||
|
||||
static void do_upshost(const char *arg)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(arg);
|
||||
|
||||
snprintfcat(logbuffer, sizeof(logbuffer), "%s", monhost);
|
||||
}
|
||||
|
||||
static void do_pid(const char *arg)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(arg);
|
||||
|
||||
snprintfcat(logbuffer, sizeof(logbuffer), "%ld", (long)getpid());
|
||||
}
|
||||
|
||||
|
@ -186,7 +162,6 @@ static void do_time(const char *arg)
|
|||
unsigned int i;
|
||||
char timebuf[SMALLBUF], *format;
|
||||
time_t tod;
|
||||
struct tm tmbuf;
|
||||
|
||||
format = xstrdup(arg);
|
||||
|
||||
|
@ -196,7 +171,7 @@ static void do_time(const char *arg)
|
|||
format[i] = '%';
|
||||
|
||||
time(&tod);
|
||||
strftime(timebuf, sizeof(timebuf), format, localtime_r(&tod, &tmbuf));
|
||||
strftime(timebuf, sizeof(timebuf), format, localtime(&tod));
|
||||
|
||||
snprintfcat(logbuffer, sizeof(logbuffer), "%s", timebuf);
|
||||
|
||||
|
@ -206,7 +181,7 @@ static void do_time(const char *arg)
|
|||
static void getvar(const char *var)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -250,7 +225,6 @@ static void do_var(const char *arg)
|
|||
static void do_etime(const char *arg)
|
||||
{
|
||||
time_t tod;
|
||||
NUT_UNUSED_VARIABLE(arg);
|
||||
|
||||
time(&tod);
|
||||
snprintfcat(logbuffer, sizeof(logbuffer), "%ld", (unsigned long) tod);
|
||||
|
@ -264,7 +238,7 @@ static void print_literal(const char *arg)
|
|||
/* register another parsing function to be called later */
|
||||
static void add_call(void (*fptr)(const char *arg), const char *arg)
|
||||
{
|
||||
flist_t *tmp, *last;
|
||||
struct flist_t *tmp, *last;
|
||||
|
||||
tmp = last = fhead;
|
||||
|
||||
|
@ -273,7 +247,7 @@ static void add_call(void (*fptr)(const char *arg), const char *arg)
|
|||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
tmp = xmalloc(sizeof(flist_t));
|
||||
tmp = xmalloc(sizeof(struct flist_t));
|
||||
|
||||
tmp->fptr = fptr;
|
||||
|
||||
|
@ -293,9 +267,8 @@ static void add_call(void (*fptr)(const char *arg), const char *arg)
|
|||
/* turn the format string into a list of function calls with args */
|
||||
static void compile_format(void)
|
||||
{
|
||||
size_t i;
|
||||
int j, found;
|
||||
size_t ofs;
|
||||
unsigned int i;
|
||||
int j, found, ofs;
|
||||
char *cmd, *arg, *ptr;
|
||||
|
||||
for (i = 0; i < strlen(logformat); i++) {
|
||||
|
@ -370,7 +343,7 @@ static void compile_format(void)
|
|||
/* go through the list of functions and call them in order */
|
||||
static void run_flist(void)
|
||||
{
|
||||
flist_t *tmp;
|
||||
struct flist_t *tmp;
|
||||
|
||||
tmp = fhead;
|
||||
|
||||
|
@ -395,25 +368,25 @@ static void run_flist(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int interval = 30, i, foreground = -1;
|
||||
const char *prog = xbasename(argv[0]);
|
||||
int interval = 30, i;
|
||||
char *prog = NULL;
|
||||
time_t now, nextpoll = 0;
|
||||
const char *user = NULL;
|
||||
struct passwd *new_uid = NULL;
|
||||
const char *pidfilebase = prog;
|
||||
const char *pidfilebase = "upslog";
|
||||
|
||||
logformat = DEFAULT_LOGFORMAT;
|
||||
user = RUN_AS_USER;
|
||||
|
||||
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
|
||||
printf("Network UPS Tools upslog %s\n", UPS_VERSION);
|
||||
|
||||
while ((i = getopt(argc, argv, "+hs:l:i:f:u:Vp:FB")) != -1) {
|
||||
prog = argv[0];
|
||||
|
||||
while ((i = getopt(argc, argv, "+hs:l:i:f:u:Vp:")) != -1) {
|
||||
switch(i) {
|
||||
case 'h':
|
||||
help(prog);
|
||||
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 's':
|
||||
monhost = optarg;
|
||||
|
@ -441,14 +414,6 @@ int main(int argc, char **argv)
|
|||
case 'p':
|
||||
pidfilebase = optarg;
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
foreground = 1;
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
foreground = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -511,19 +476,10 @@ int main(int argc, char **argv)
|
|||
/* now drop root if we have it */
|
||||
new_uid = get_user_pwent(user);
|
||||
|
||||
open_syslog(prog);
|
||||
openlog("upslog", LOG_PID, LOG_FACILITY);
|
||||
|
||||
if (foreground < 0) {
|
||||
if (logfile == stdout) {
|
||||
foreground = 1;
|
||||
} else {
|
||||
foreground = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foreground) {
|
||||
if (logfile != stdout)
|
||||
background();
|
||||
}
|
||||
|
||||
setup_signals();
|
||||
|
||||
|
@ -538,7 +494,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (nextpoll > now) {
|
||||
/* there is still time left, so sleep it off */
|
||||
sleep((unsigned int)(difftime(nextpoll, now)));
|
||||
sleep(difftime(nextpoll, now));
|
||||
nextpoll += interval;
|
||||
} else {
|
||||
/* we spent more time in polling than the interval allows */
|
||||
|
@ -574,11 +530,3 @@ int main(int argc, char **argv)
|
|||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/* Formal do_upsconf_args implementation to satisfy linker on AIX */
|
||||
#if (defined NUT_PLATFORM_AIX)
|
||||
void do_upsconf_args(char *upsname, char *var, char *val) {
|
||||
fatalx(EXIT_FAILURE, "INTERNAL ERROR: formal do_upsconf_args called");
|
||||
}
|
||||
#endif /* end of #if (defined NUT_PLATFORM_AIX) */
|
||||
|
|
|
@ -1,20 +1,11 @@
|
|||
/* upslog.h - table of functions for handling various logging functions */
|
||||
|
||||
#ifndef NUT_UPSLOG_H_SEEN
|
||||
#define NUT_UPSLOG_H_SEEN 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* function list */
|
||||
typedef struct flist_s {
|
||||
struct flist_t {
|
||||
void (*fptr)(const char *arg);
|
||||
const char *arg;
|
||||
struct flist_s *next;
|
||||
} flist_t;
|
||||
struct flist_t *next;
|
||||
};
|
||||
|
||||
static void do_host(const char *arg);
|
||||
static void do_upshost(const char *arg);
|
||||
|
@ -23,10 +14,7 @@ static void do_time(const char *arg);
|
|||
static void do_var(const char *arg);
|
||||
static void do_etime(const char *arg);
|
||||
|
||||
/* This is only used in upslog.c, but refers to routines declared here...
|
||||
* To move or not to move?..
|
||||
*/
|
||||
static struct {
|
||||
struct {
|
||||
const char *name;
|
||||
void (*func)(const char *arg);
|
||||
} logcmds[] =
|
||||
|
@ -37,13 +25,5 @@ static struct {
|
|||
{ "TIME", do_time },
|
||||
{ "VAR", do_var },
|
||||
{ "ETIME", do_etime },
|
||||
{ NULL, (void(*)(const char*))(NULL) }
|
||||
{ NULL, (void(*)())(NULL) }
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_UPSLOG_H_SEEN */
|
||||
|
|
675
clients/upsmon.c
675
clients/upsmon.c
File diff suppressed because it is too large
Load diff
|
@ -17,30 +17,21 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef NUT_UPSMON_H_SEEN
|
||||
#define NUT_UPSMON_H_SEEN 1
|
||||
|
||||
/* flags for ups->status */
|
||||
|
||||
#define ST_ONLINE (1 << 0) /* UPS is on line (OL) */
|
||||
#define ST_ONBATT (1 << 1) /* UPS is on battery (OB) */
|
||||
#define ST_LOWBATT (1 << 2) /* UPS has a low battery (LB) */
|
||||
#define ST_FSD (1 << 3) /* primary has set forced shutdown flag */
|
||||
#define ST_PRIMARY (1 << 4) /* we are the primary (manager) of this UPS */
|
||||
#define ST_MASTER ST_PRIMARY /* legacy alias */
|
||||
#define ST_LOGIN (1 << 5) /* we are logged into this UPS */
|
||||
#define ST_CONNECTED (1 << 6) /* upscli_connect returned OK */
|
||||
#define ST_CAL (1 << 7) /* UPS calibration in progress (CAL) */
|
||||
#define ST_ONLINE 0x001 /* UPS is on line (OL) */
|
||||
#define ST_ONBATT 0x002 /* UPS is on battery (OB) */
|
||||
#define ST_LOWBATT 0x004 /* UPS has a low battery (LB) */
|
||||
#define ST_FSD 0x008 /* master has set forced shutdown flag */
|
||||
#define ST_MASTER 0x010 /* we are the master on this UPS */
|
||||
/* was ST_ALIVE 0x020 */
|
||||
#define ST_LOGIN 0x040 /* we are logged into this UPS */
|
||||
/* was ST_FIRST 0x080 */
|
||||
#define ST_CONNECTED 0x100 /* upscli_connect returned OK */
|
||||
|
||||
/* required contents of flag file */
|
||||
#define SDMAGIC "upsmon-shutdown-file"
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* UPS tracking structure */
|
||||
|
||||
typedef struct {
|
||||
|
@ -49,9 +40,9 @@ typedef struct {
|
|||
char *sys; /* raw system name from .conf */
|
||||
char *upsname; /* just upsname */
|
||||
char *hostname; /* just hostname */
|
||||
uint16_t port; /* just the port */
|
||||
int port; /* just the port */
|
||||
|
||||
unsigned int pv; /* power value from conf */
|
||||
int pv; /* power value from conf */
|
||||
char *un; /* username (optional for now) */
|
||||
char *pw; /* password from conf */
|
||||
int status; /* status (see flags above) */
|
||||
|
@ -73,29 +64,25 @@ typedef struct {
|
|||
#define NOTIFY_ONLINE 0 /* UPS went on-line */
|
||||
#define NOTIFY_ONBATT 1 /* UPS went on battery */
|
||||
#define NOTIFY_LOWBATT 2 /* UPS went to low battery */
|
||||
#define NOTIFY_FSD 3 /* Primary upsmon set FSD flag */
|
||||
#define NOTIFY_FSD 3 /* Master upsmon set FSD flag */
|
||||
#define NOTIFY_COMMOK 4 /* Communication established */
|
||||
#define NOTIFY_COMMBAD 5 /* Communication lost */
|
||||
#define NOTIFY_SHUTDOWN 6 /* System shutdown in progress */
|
||||
#define NOTIFY_REPLBATT 7 /* UPS battery needs to be replaced */
|
||||
#define NOTIFY_NOCOMM 8 /* UPS hasn't been contacted in a while */
|
||||
#define NOTIFY_NOCOMM 8 /* UPS hasn't been contacted in awhile */
|
||||
#define NOTIFY_NOPARENT 9 /* privileged parent process died */
|
||||
#define NOTIFY_CAL 10 /* UPS is performing calibration */
|
||||
|
||||
/* notify flag values */
|
||||
|
||||
#define NOTIFY_IGNORE (1 << 0) /* don't do anything */
|
||||
#define NOTIFY_SYSLOG (1 << 1) /* send the msg to the syslog */
|
||||
#define NOTIFY_WALL (1 << 2) /* send the msg to all users */
|
||||
#define NOTIFY_EXEC (1 << 3) /* send the msg to NOTIFYCMD script */
|
||||
#define NOTIFY_IGNORE 1 /* don't do anything */
|
||||
#define NOTIFY_SYSLOG 2 /* send the msg to the syslog */
|
||||
#define NOTIFY_WALL 4 /* send the msg to all users */
|
||||
#define NOTIFY_EXEC 8 /* send the msg to NOTIFYCMD script */
|
||||
|
||||
/* flags are set to NOTIFY_SYSLOG | NOTIFY_WALL at program init */
|
||||
/* the user can override with NOTIFYFLAGS in the upsmon.conf */
|
||||
|
||||
/* This is only used in upsmon.c, but might it also have external consumers?..
|
||||
* To move or not to move?..
|
||||
*/
|
||||
static struct {
|
||||
struct {
|
||||
int type;
|
||||
const char *name;
|
||||
char *msg; /* NULL until overridden */
|
||||
|
@ -113,7 +100,6 @@ static struct {
|
|||
{ NOTIFY_REPLBATT, "REPLBATT", NULL, "UPS %s battery needs to be replaced", NOTIFY_SYSLOG | NOTIFY_WALL },
|
||||
{ NOTIFY_NOCOMM, "NOCOMM", NULL, "UPS %s is unavailable", NOTIFY_SYSLOG | NOTIFY_WALL },
|
||||
{ NOTIFY_NOPARENT, "NOPARENT", NULL, "upsmon parent process died - shutdown impossible", NOTIFY_SYSLOG | NOTIFY_WALL },
|
||||
{ NOTIFY_CAL, "CAL", NULL, "UPS %s: calibration in progress", NOTIFY_SYSLOG },
|
||||
{ 0, NULL, NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
|
@ -126,11 +112,3 @@ static struct {
|
|||
/* various constants */
|
||||
|
||||
#define NET_TIMEOUT 10 /* wait 10 seconds max for upsd to respond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_UPSMON_H_SEEN */
|
||||
|
|
505
clients/upsrw.c
505
clients/upsrw.c
|
@ -1,8 +1,6 @@
|
|||
/* upsrw - simple client for read/write variable access (formerly upsct2)
|
||||
|
||||
Copyright (C)
|
||||
1999 Russell Kroll <rkroll@exploits.org>
|
||||
2019 EATON (author: Arnaud Quette <ArnaudQuette@eaton.com>)
|
||||
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,21 +18,13 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "nut_platform.h"
|
||||
|
||||
#include <pwd.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "nut_stdint.h"
|
||||
#include "upsclient.h"
|
||||
#include "extstate.h"
|
||||
|
||||
static char *upsname = NULL, *hostname = NULL;
|
||||
static UPSCONN_t *ups = NULL;
|
||||
static int tracking_enabled = 0;
|
||||
static unsigned int timeout = DEFAULT_TRACKING_TIMEOUT;
|
||||
|
||||
struct list_t {
|
||||
char *name;
|
||||
|
@ -43,149 +33,69 @@ struct list_t {
|
|||
|
||||
static void usage(const char *prog)
|
||||
{
|
||||
printf("Network UPS Tools %s %s\n\n", prog, UPS_VERSION);
|
||||
printf("Network UPS Tools upsrw %s\n\n", UPS_VERSION);
|
||||
printf("usage: %s [-h]\n", prog);
|
||||
printf(" %s [-s <variable>] [-u <username>] [-p <password>] [-w] [-t <timeout>] <ups>\n\n", prog);
|
||||
printf(" %s [-s <variable>] [-u <username>] [-p <password>] <ups>\n\n", prog);
|
||||
printf("Demo program to set variables within UPS hardware.\n");
|
||||
printf("\n");
|
||||
printf(" -h display this help text\n");
|
||||
printf(" -s <variable> specify variable to be changed\n");
|
||||
printf(" use -s VAR=VALUE to avoid prompting for value\n");
|
||||
printf(" -l show all possible read/write variables.\n");
|
||||
printf(" -u <username> set username for command authentication\n");
|
||||
printf(" -p <password> set password for command authentication\n");
|
||||
printf(" -w wait for the completion of setting by the driver\n");
|
||||
printf(" and return its actual result from the device\n");
|
||||
printf(" -t <timeout> set a timeout when using -w (in seconds, default: %u)\n", DEFAULT_TRACKING_TIMEOUT);
|
||||
printf("\n");
|
||||
printf(" <ups> UPS identifier - <upsname>[@<hostname>[:<port>]]\n");
|
||||
printf("\n");
|
||||
printf("Call without -s to show all possible read/write variables (same as -l).\n");
|
||||
printf("Call without -s to show all possible read/write variables.\n");
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
static void clean_exit(void)
|
||||
static void clean_exit(UPSCONN_t *ups, char *upsname, char *hostname, int code)
|
||||
{
|
||||
if (ups) {
|
||||
upscli_disconnect(ups);
|
||||
}
|
||||
|
||||
free(upsname);
|
||||
free(hostname);
|
||||
free(ups);
|
||||
|
||||
upscli_disconnect(ups);
|
||||
|
||||
exit(code);
|
||||
}
|
||||
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_BESIDEFUNC) && (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS_BESIDEFUNC) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE_BESIDEFUNC) )
|
||||
# pragma GCC diagnostic push
|
||||
#endif
|
||||
#if (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS_BESIDEFUNC)
|
||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
#if (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE_BESIDEFUNC)
|
||||
# pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
|
||||
#endif
|
||||
static void do_set(const char *varname, const char *newval)
|
||||
static int do_set(UPSCONN_t *ups, const char *upsname, const char *varname,
|
||||
const char *newval)
|
||||
{
|
||||
int cmd_complete = 0;
|
||||
char buf[SMALLBUF], enc[SMALLBUF];
|
||||
char tracking_id[UUID4_LEN];
|
||||
time_t start, now;
|
||||
|
||||
snprintf(buf, sizeof(buf), "SET VAR %s %s \"%s\"\n", upsname, varname, pconf_encode(newval, enc, sizeof(enc)));
|
||||
snprintf(buf, sizeof(buf), "SET VAR %s %s \"%s\"\n",
|
||||
upsname, varname, pconf_encode(newval, enc, sizeof(enc)));
|
||||
|
||||
if (upscli_sendline(ups, buf, strlen(buf)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Can't set variable: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Can't set variable: %s\n",
|
||||
upscli_strerror(ups));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (upscli_readline(ups, buf, sizeof(buf)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Set variable failed: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Set variable failed: %s\n",
|
||||
upscli_strerror(ups));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* verify answer */
|
||||
/* FUTURE: status cookies will tie in here */
|
||||
if (strncmp(buf, "OK", 2) != 0) {
|
||||
fatalx(EXIT_FAILURE, "Unexpected response from upsd: %s", buf);
|
||||
printf("Unexpected response from upsd: %s\n", buf);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* check for status tracking id */
|
||||
if (
|
||||
!tracking_enabled ||
|
||||
/* sanity check on the size: "OK TRACKING " + UUID4_LEN */
|
||||
strlen(buf) != (UUID4_LEN - 1 + strlen("OK TRACKING "))
|
||||
) {
|
||||
/* reply as usual */
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_TRUNCATION
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_TRUNCATION
|
||||
#pragma GCC diagnostic ignored "-Wformat-truncation"
|
||||
#endif
|
||||
/* From the check above, we know that we have exactly UUID4_LEN chars
|
||||
* (aka sizeof(tracking_id)) in the buf after "OK TRACKING " prefix,
|
||||
* plus the null-byte.
|
||||
*/
|
||||
assert (UUID4_LEN == 1 + snprintf(tracking_id, sizeof(tracking_id), "%s", buf + strlen("OK TRACKING ")));
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_TRUNCATION
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
time(&start);
|
||||
|
||||
/* send status tracking request, looping if status is PENDING */
|
||||
while (!cmd_complete) {
|
||||
|
||||
/* check for timeout */
|
||||
time(&now);
|
||||
if (difftime(now, start) >= timeout)
|
||||
fatalx(EXIT_FAILURE, "Can't receive status tracking information: timeout");
|
||||
|
||||
snprintf(buf, sizeof(buf), "GET TRACKING %s\n", tracking_id);
|
||||
|
||||
if (upscli_sendline(ups, buf, strlen(buf)) < 0)
|
||||
fatalx(EXIT_FAILURE, "Can't send status tracking request: %s", upscli_strerror(ups));
|
||||
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE) )
|
||||
/* Note for gating macros above: unsuffixed HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP
|
||||
* means support of contexts both inside and outside function body, so the push
|
||||
* above and pop below (outside this finction) are not used.
|
||||
*/
|
||||
# pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS
|
||||
/* Note that the individual warning pragmas for use inside function bodies
|
||||
* are named without a _INSIDEFUNC suffix, for simplicity and legacy reasons
|
||||
*/
|
||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE
|
||||
# pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
|
||||
#endif
|
||||
/* and get status tracking reply */
|
||||
assert(timeout < LONG_MAX);
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE) )
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if (upscli_readline_timeout(ups, buf, sizeof(buf), (long)timeout) < 0)
|
||||
fatalx(EXIT_FAILURE, "Can't receive status tracking information: %s", upscli_strerror(ups));
|
||||
|
||||
if (strncmp(buf, "PENDING", 7))
|
||||
cmd_complete = 1;
|
||||
else
|
||||
/* wait a second before retrying */
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_BESIDEFUNC) && (!defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP_INSIDEFUNC) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TYPE_LIMITS_BESIDEFUNC) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE_BESIDEFUNC) )
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
static void do_setvar(const char *varname, char *uin, const char *pass)
|
||||
static int do_setvar(UPSCONN_t *ups, const char *varname, char *uin,
|
||||
const char *pass, char *upsname, char *hostname)
|
||||
{
|
||||
char newval[SMALLBUF], temp[SMALLBUF * 2], user[SMALLBUF], *ptr;
|
||||
char newval[SMALLBUF], temp[SMALLBUF], user[SMALLBUF], *ptr;
|
||||
struct passwd *pw;
|
||||
|
||||
if (uin) {
|
||||
|
@ -195,23 +105,21 @@ static void do_setvar(const char *varname, char *uin, const char *pass)
|
|||
|
||||
pw = getpwuid(getuid());
|
||||
|
||||
if (pw) {
|
||||
if (pw)
|
||||
printf("Username (%s): ", pw->pw_name);
|
||||
} else {
|
||||
else
|
||||
printf("Username: ");
|
||||
}
|
||||
|
||||
if (fgets(user, sizeof(user), stdin) == NULL) {
|
||||
upsdebug_with_errno(LOG_INFO, "%s", __func__);
|
||||
}
|
||||
|
||||
/* deal with that pesky newline */
|
||||
if (strlen(user) > 1) {
|
||||
if (strlen(user) > 1)
|
||||
user[strlen(user) - 1] = '\0';
|
||||
} else {
|
||||
if (!pw) {
|
||||
else {
|
||||
if (!pw)
|
||||
fatalx(EXIT_FAILURE, "No username available - even tried getpwuid");
|
||||
}
|
||||
|
||||
snprintf(user, sizeof(user), "%s", pw->pw_name);
|
||||
}
|
||||
|
@ -222,7 +130,10 @@ static void do_setvar(const char *varname, char *uin, const char *pass)
|
|||
pass = GETPASS("Password: " );
|
||||
|
||||
if (!pass) {
|
||||
fatal_with_errno(EXIT_FAILURE, "getpass failed");
|
||||
fprintf(stderr, "getpass failed: %s\n",
|
||||
strerror(errno));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,133 +153,116 @@ static void do_setvar(const char *varname, char *uin, const char *pass)
|
|||
snprintf(temp, sizeof(temp), "USERNAME %s\n", user);
|
||||
|
||||
if (upscli_sendline(ups, temp, strlen(temp)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Can't set username: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Can't set username: %s\n",
|
||||
upscli_strerror(ups));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (upscli_readline(ups, temp, sizeof(temp)) < 0) {
|
||||
|
||||
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
|
||||
fatalx(EXIT_FAILURE, "Set username failed due to an unknown command. You probably need to upgrade upsd.");
|
||||
fprintf(stderr, "Set username failed due to an "
|
||||
"unknown command.\n");
|
||||
|
||||
fprintf(stderr, "You probably need to upgrade upsd.\n");
|
||||
|
||||
clean_exit(ups, upsname, hostname, EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fatalx(EXIT_FAILURE, "Set username failed: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Set username failed: %s\n",
|
||||
upscli_strerror(ups));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
snprintf(temp, sizeof(temp), "PASSWORD %s\n", pass);
|
||||
|
||||
if (upscli_sendline(ups, temp, strlen(temp)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Can't set password: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Can't set password: %s\n",
|
||||
upscli_strerror(ups));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (upscli_readline(ups, temp, sizeof(temp)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Set password failed: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Set password failed: %s\n",
|
||||
upscli_strerror(ups));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* no upsname means die */
|
||||
if (!upsname) {
|
||||
fatalx(EXIT_FAILURE, "Error: a UPS name must be specified (upsname[@hostname[:port]])");
|
||||
fprintf(stderr, "Error: a UPS name must be specified (upsname[@hostname[:port]])\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* old variable names are no longer supported */
|
||||
if (!strchr(varname, '.')) {
|
||||
fatalx(EXIT_FAILURE, "Error: old variable names are not supported");
|
||||
fprintf(stderr, "Error: old variable names are not supported\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* enable status tracking ID */
|
||||
if (tracking_enabled) {
|
||||
|
||||
snprintf(temp, sizeof(temp), "SET TRACKING ON\n");
|
||||
|
||||
if (upscli_sendline(ups, temp, strlen(temp)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Can't enable set variable status tracking: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
if (upscli_readline(ups, temp, sizeof(temp)) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Enabling set variable status tracking failed: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
/* Verify the result */
|
||||
if (strncmp(temp, "OK", 2) != 0) {
|
||||
fatalx(EXIT_FAILURE, "Enabling set variable status tracking failed. upsd answered: %s", temp);
|
||||
}
|
||||
}
|
||||
|
||||
do_set(varname, newval);
|
||||
return do_set(ups, upsname, varname, newval);
|
||||
}
|
||||
|
||||
static const char *get_data(const char *type, const char *varname)
|
||||
static const char *get_data(const char *type, UPSCONN_t *ups,
|
||||
const char *upsname, const char *varname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
char **answer;
|
||||
const char *query[4];
|
||||
|
||||
query[0] = type;
|
||||
query[1] = upsname;
|
||||
query[2] = varname;
|
||||
|
||||
numq = 3;
|
||||
|
||||
ret = upscli_get(ups, numq, query, &numa, &answer);
|
||||
|
||||
if ((ret < 0) || (numa < numq)) {
|
||||
if ((ret < 0) || (numa < numq))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* <type> <upsname> <varname> <desc> */
|
||||
return answer[3];
|
||||
}
|
||||
|
||||
static void do_string(const char *varname, const long len)
|
||||
static void do_string(UPSCONN_t *ups, const char *upsname, const char *varname)
|
||||
{
|
||||
const char *val;
|
||||
|
||||
val = get_data("VAR", varname);
|
||||
val = get_data("VAR", ups, upsname, varname);
|
||||
|
||||
if (!val) {
|
||||
fatalx(EXIT_FAILURE, "do_string: can't get current value of %s", varname);
|
||||
fprintf(stderr, "do_string: can't get current value of %s\n",
|
||||
varname);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Type: STRING\n");
|
||||
printf("Maximum length: %ld\n", len);
|
||||
printf("Value: %s\n", val);
|
||||
}
|
||||
|
||||
static void do_number(const char *varname)
|
||||
{
|
||||
const char *val;
|
||||
|
||||
val = get_data("VAR", varname);
|
||||
|
||||
if (!val) {
|
||||
fatalx(EXIT_FAILURE, "do_number: can't get current value of %s", varname);
|
||||
}
|
||||
|
||||
printf("Type: NUMBER\n");
|
||||
printf("Value: %s\n", val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display ENUM information
|
||||
* @param varname the name of the NUT variable
|
||||
* @param vartype the type of the NUT variable (ST_FLAG_STRING, ST_FLAG_NUMBER
|
||||
* @param len the length of the NUT variable, if type == ST_FLAG_STRING
|
||||
*/
|
||||
static void do_enum(const char *varname, const int vartype, const long len)
|
||||
static void do_enum(UPSCONN_t *ups, const char *upsname, const char *varname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
char **answer, buf[SMALLBUF];
|
||||
const char *query[4], *val;
|
||||
unsigned int numq, numa;
|
||||
char **answer, *val;
|
||||
const char *query[4], *tmp;
|
||||
|
||||
/* get current value */
|
||||
val = get_data("VAR", varname);
|
||||
tmp = get_data("VAR", ups, upsname, varname);
|
||||
|
||||
if (!val) {
|
||||
fatalx(EXIT_FAILURE, "do_enum: can't get current value of %s", varname);
|
||||
if (!tmp) {
|
||||
fprintf(stderr, "do_enum: can't get current value of %s\n",
|
||||
varname);
|
||||
return;
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s", val);
|
||||
/* tmp is a pointer into answer - have to save it somewhere else */
|
||||
val = xstrdup(tmp);
|
||||
|
||||
query[0] = "ENUM";
|
||||
query[1] = upsname;
|
||||
|
@ -378,101 +272,43 @@ static void do_enum(const char *varname, const int vartype, const long len)
|
|||
ret = upscli_list_start(ups, numq, query);
|
||||
|
||||
if (ret < 0) {
|
||||
fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Error: %s\n", upscli_strerror(ups));
|
||||
return;
|
||||
}
|
||||
|
||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||
|
||||
/* Fallback for older upsd versions */
|
||||
if (vartype != ST_FLAG_NONE)
|
||||
printf("Type: ENUM %s\n", (vartype == ST_FLAG_STRING)?"STRING":"NUMBER");
|
||||
else
|
||||
printf("Type: ENUM\n");
|
||||
|
||||
if (vartype == ST_FLAG_STRING)
|
||||
printf("Maximum length: %ld\n", len);
|
||||
|
||||
while (ret == 1) {
|
||||
|
||||
/* ENUM <upsname> <varname> <value> */
|
||||
|
||||
if (numa < 4) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||
fprintf(stderr, "Error: insufficient data "
|
||||
"(got %d args, need at least 4)\n", numa);
|
||||
|
||||
free(val);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Option: \"%s\"", answer[3]);
|
||||
|
||||
if (!strcmp(answer[3], buf)) {
|
||||
if (!strcmp(answer[3], val))
|
||||
printf(" SELECTED");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||
}
|
||||
|
||||
free(val);
|
||||
}
|
||||
|
||||
static void do_range(const char *varname)
|
||||
static void do_type(UPSCONN_t *ups, const char *upsname, const char *varname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
char **answer;
|
||||
const char *query[4], *val;
|
||||
int ival, min, max;
|
||||
|
||||
/* get current value */
|
||||
val = get_data("VAR", varname);
|
||||
|
||||
if (!val) {
|
||||
fatalx(EXIT_FAILURE, "do_range: can't get current value of %s", varname);
|
||||
}
|
||||
|
||||
ival = atoi(val);
|
||||
|
||||
query[0] = "RANGE";
|
||||
query[1] = upsname;
|
||||
query[2] = varname;
|
||||
numq = 3;
|
||||
|
||||
ret = upscli_list_start(ups, numq, query);
|
||||
|
||||
if (ret < 0) {
|
||||
fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups));
|
||||
}
|
||||
|
||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||
|
||||
/* Ranges implies a type "NUMBER" */
|
||||
printf("Type: RANGE NUMBER\n");
|
||||
|
||||
while (ret == 1) {
|
||||
|
||||
/* RANGE <upsname> <varname> <min> <max> */
|
||||
|
||||
if (numa < 5) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||
}
|
||||
|
||||
min = atoi(answer[3]);
|
||||
max = atoi(answer[4]);
|
||||
|
||||
printf("Option: \"%i-%i\"", min, max);
|
||||
|
||||
if ((ival >= min) && (ival <= max)) {
|
||||
printf(" SELECTED");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||
}
|
||||
}
|
||||
|
||||
static void do_type(const char *varname)
|
||||
{
|
||||
int ret;
|
||||
int is_enum = 0; /* 1 if ENUM; FIXME: add a boolean type in common.h */
|
||||
size_t i, numq, numa;
|
||||
unsigned int i, numq, numa;
|
||||
char **answer;
|
||||
const char *query[4];
|
||||
|
||||
|
@ -491,82 +327,55 @@ static void do_type(const char *varname)
|
|||
/* TYPE <upsname> <varname> <type>... */
|
||||
for (i = 3; i < numa; i++) {
|
||||
|
||||
/* ENUM can be NUMBER or STRING
|
||||
* just flag it for latter processing */
|
||||
if (!strcasecmp(answer[i], "ENUM")) {
|
||||
is_enum = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!strcasecmp(answer[i], "RANGE")) {
|
||||
do_range(varname);
|
||||
do_enum(ups, upsname, varname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncasecmp(answer[i], "STRING:", 7)) {
|
||||
|
||||
char *len = answer[i] + 7;
|
||||
long length = strtol(len, NULL, 10);
|
||||
|
||||
if (is_enum == 1)
|
||||
do_enum(varname, ST_FLAG_STRING, length);
|
||||
else
|
||||
do_string(varname, length);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (!strcasecmp(answer[i], "NUMBER")) {
|
||||
if (is_enum == 1)
|
||||
do_enum(varname, ST_FLAG_NUMBER, 0);
|
||||
else
|
||||
do_number(varname);
|
||||
do_string(ups, upsname, varname);
|
||||
return;
|
||||
}
|
||||
|
||||
/* ignore this one */
|
||||
if (!strcasecmp(answer[i], "RW")) {
|
||||
if (!strcasecmp(answer[i], "RW"))
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("Type: %s (unrecognized)\n", answer[i]);
|
||||
}
|
||||
/* Fallback for older upsd versions, where STRING|NUMBER is not
|
||||
* appended to ENUM */
|
||||
if (is_enum == 1)
|
||||
do_enum(varname, ST_FLAG_NONE, 0);
|
||||
|
||||
}
|
||||
|
||||
static void print_rw(const char *varname)
|
||||
static void print_rw(UPSCONN_t *ups, const char *upsname, const char *varname)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
printf("[%s]\n", varname);
|
||||
|
||||
tmp = get_data("DESC", varname);
|
||||
tmp = get_data("DESC", ups, upsname, varname);
|
||||
|
||||
if (tmp) {
|
||||
if (tmp)
|
||||
printf("%s\n", tmp);
|
||||
} else {
|
||||
else
|
||||
printf("Description unavailable\n");
|
||||
}
|
||||
|
||||
do_type(varname);
|
||||
do_type(ups, upsname, varname);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void print_rwlist(void)
|
||||
static int print_rwlist(UPSCONN_t *ups, const char *upsname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[2];
|
||||
char **answer;
|
||||
struct list_t *lhead, *llast, *ltmp, *lnext;
|
||||
|
||||
/* the upsname is now required */
|
||||
if (!upsname) {
|
||||
fatalx(EXIT_FAILURE, "Error: a UPS name must be specified (upsname[@hostname[:port]])");
|
||||
fprintf(stderr, "Error: a UPS name must be specified (upsname[@hostname[:port]])\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
llast = lhead = NULL;
|
||||
|
@ -581,10 +390,12 @@ static void print_rwlist(void)
|
|||
|
||||
/* old upsd --> fall back on old LISTRW technique */
|
||||
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
|
||||
fatalx(EXIT_FAILURE, "Error: upsd is too old to support this query");
|
||||
fprintf(stderr, "Error: upsd is too old to support this query\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups));
|
||||
fprintf(stderr, "Error: %s\n", upscli_strerror(ups));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||
|
@ -593,7 +404,9 @@ static void print_rwlist(void)
|
|||
|
||||
/* RW <upsname> <varname> <value> */
|
||||
if (numa < 4) {
|
||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||
fprintf(stderr, "Error: insufficient data "
|
||||
"(got %d args, need at least 4)\n", numa);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* sock this entry away for later */
|
||||
|
@ -602,11 +415,10 @@ static void print_rwlist(void)
|
|||
ltmp->name = xstrdup(answer[2]);
|
||||
ltmp->next = NULL;
|
||||
|
||||
if (llast) {
|
||||
if (llast)
|
||||
llast->next = ltmp;
|
||||
} else {
|
||||
else
|
||||
lhead = ltmp;
|
||||
}
|
||||
|
||||
llast = ltmp;
|
||||
|
||||
|
@ -620,92 +432,77 @@ static void print_rwlist(void)
|
|||
while (ltmp) {
|
||||
lnext = ltmp->next;
|
||||
|
||||
print_rw(ltmp->name);
|
||||
print_rw(ups, upsname, ltmp->name);
|
||||
|
||||
free(ltmp->name);
|
||||
free(ltmp);
|
||||
ltmp = lnext;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
uint16_t port;
|
||||
const char *prog = xbasename(argv[0]);
|
||||
char *password = NULL, *username = NULL, *setvar = NULL;
|
||||
int i, port, ret;
|
||||
char *upsname, *hostname, *setvar, *prog;
|
||||
char *password = NULL, *username = NULL;
|
||||
UPSCONN_t ups;
|
||||
|
||||
while ((i = getopt(argc, argv, "+hls:p:t:u:wV")) != -1) {
|
||||
switch (i)
|
||||
{
|
||||
setvar = username = NULL;
|
||||
prog = argv[0];
|
||||
|
||||
while ((i = getopt(argc, argv, "+s:p:u:V")) != -1) {
|
||||
switch (i) {
|
||||
case 's':
|
||||
setvar = optarg;
|
||||
break;
|
||||
case 'l':
|
||||
if (setvar) {
|
||||
upslogx(LOG_WARNING, "Listing mode requested, overriding setvar specified earlier!");
|
||||
setvar = NULL;
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
password = optarg;
|
||||
break;
|
||||
case 't':
|
||||
if (!str_to_uint(optarg, &timeout, 10))
|
||||
fatal_with_errno(EXIT_FAILURE, "Could not convert the provided value for timeout ('-t' option) to unsigned int");
|
||||
break;
|
||||
case 'u':
|
||||
username = optarg;
|
||||
break;
|
||||
case 'w':
|
||||
tracking_enabled = 1;
|
||||
break;
|
||||
case 'V':
|
||||
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
|
||||
printf("Network UPS Tools upsrw %s\n", UPS_VERSION);
|
||||
exit(EXIT_SUCCESS);
|
||||
case 'h':
|
||||
default:
|
||||
usage(prog);
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc < 1) {
|
||||
if (argc < 1)
|
||||
usage(prog);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* be a good little client that cleans up after itself */
|
||||
atexit(clean_exit);
|
||||
upsname = hostname = NULL;
|
||||
|
||||
if (upscli_splitname(argv[0], &upsname, &hostname, &port) != 0) {
|
||||
fatalx(EXIT_FAILURE, "Error: invalid UPS definition. Required format: upsname[@hostname[:port]]");
|
||||
fprintf(stderr, "Error: invalid UPS definition. Required format: upsname[@hostname[:port]]\n");
|
||||
clean_exit(&ups, upsname, hostname, EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ups = xcalloc(1, sizeof(*ups));
|
||||
|
||||
if (upscli_connect(ups, hostname, port, 0) < 0) {
|
||||
fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups));
|
||||
if (upscli_connect(&ups, hostname, port, 0) < 0) {
|
||||
fprintf(stderr, "Can't connect: %s\n", upscli_strerror(&ups));
|
||||
clean_exit(&ups, upsname, hostname, EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* setting a variable? */
|
||||
if (setvar) {
|
||||
/* setting a variable */
|
||||
do_setvar(setvar, username, password);
|
||||
} else {
|
||||
/* if not, get the list of supported read/write variables */
|
||||
print_rwlist();
|
||||
ret = do_setvar(&ups, setvar, username, password, upsname,
|
||||
hostname);
|
||||
|
||||
clean_exit(&ups, upsname, hostname, ret);
|
||||
}
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
/* if not, get the list of supported read/write variables */
|
||||
ret = print_rwlist(&ups, upsname);
|
||||
|
||||
clean_exit(&ups, upsname, hostname, ret);
|
||||
|
||||
/* Formal do_upsconf_args implementation to satisfy linker on AIX */
|
||||
#if (defined NUT_PLATFORM_AIX)
|
||||
void do_upsconf_args(char *upsname, char *var, char *val) {
|
||||
fatalx(EXIT_FAILURE, "INTERNAL ERROR: formal do_upsconf_args called");
|
||||
/* NOTREACHED */
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif /* end of #if (defined NUT_PLATFORM_AIX) */
|
||||
|
|
|
@ -11,19 +11,8 @@
|
|||
# from your AT lines.
|
||||
|
||||
case $1 in
|
||||
onbattwarn)
|
||||
# Send a notification mail
|
||||
echo "The UPS has been on battery for awhile" \
|
||||
| mail -s"UPS monitor" bofh@pager.example.com
|
||||
# Create a flag-file on the filesystem, for your own processing
|
||||
/usr/bin/touch /some/path/ups-on-battery
|
||||
;;
|
||||
ups-back-on-power)
|
||||
# Delete the flag-file on the filesystem
|
||||
/bin/rm -f /some/path/ups-on-battery
|
||||
;;
|
||||
upsgone)
|
||||
logger -t upssched-cmd "The communication with UPS has been gone for awhile"
|
||||
logger -t upssched-cmd "The UPS has been gone for awhile"
|
||||
;;
|
||||
*)
|
||||
logger -t upssched-cmd "Unrecognized command: $1"
|
||||
|
|
|
@ -46,26 +46,24 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "upssched.h"
|
||||
#include "timehead.h"
|
||||
#include "nut_stdint.h"
|
||||
|
||||
typedef struct ttype_s {
|
||||
typedef struct {
|
||||
char *name;
|
||||
time_t etime;
|
||||
struct ttype_s *next;
|
||||
void *next;
|
||||
} ttype_t;
|
||||
|
||||
static ttype_t *thead = NULL;
|
||||
static conn_t *connhead = NULL;
|
||||
static char *cmdscript = NULL, *pipefn = NULL, *lockfn = NULL;
|
||||
static int verbose = 0; /* use for debugging */
|
||||
ttype_t *thead = NULL;
|
||||
static struct conn_t *connhead = NULL;
|
||||
char *cmdscript = NULL, *pipefn = NULL, *lockfn = NULL;
|
||||
int verbose = 0; /* use for debugging */
|
||||
|
||||
/* ups name and notify type (string) as received from upsmon */
|
||||
static const char *upsname, *notify_type;
|
||||
|
||||
/* ups name and notify type (string) as received from upsmon */
|
||||
const char *upsname, *notify_type;
|
||||
|
||||
#define PARENT_STARTED -2
|
||||
#define PARENT_UNNECESSARY -3
|
||||
|
@ -181,7 +179,7 @@ static void checktimers(void)
|
|||
static void start_timer(const char *name, const char *ofsstr)
|
||||
{
|
||||
time_t now;
|
||||
long ofs;
|
||||
int ofs;
|
||||
ttype_t *tmp, *last;
|
||||
|
||||
/* get the time */
|
||||
|
@ -196,7 +194,7 @@ static void start_timer(const char *name, const char *ofsstr)
|
|||
}
|
||||
|
||||
if (verbose)
|
||||
upslogx(LOG_INFO, "New timer: %s (%ld seconds)", name, ofs);
|
||||
upslogx(LOG_INFO, "New timer: %s (%d seconds)", name, ofs);
|
||||
|
||||
/* now add to the queue */
|
||||
tmp = last = thead;
|
||||
|
@ -242,7 +240,7 @@ static void cancel_timer(const char *name, const char *cname)
|
|||
static void us_serialize(int op)
|
||||
{
|
||||
static int pipefd[2];
|
||||
ssize_t ret;
|
||||
int ret;
|
||||
char ch;
|
||||
|
||||
switch(op) {
|
||||
|
@ -272,7 +270,6 @@ static int open_sock(void)
|
|||
int ret, fd;
|
||||
struct sockaddr_un ssaddr;
|
||||
|
||||
check_unix_socket_filename(pipefn);
|
||||
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
if (fd < 0)
|
||||
|
@ -300,15 +297,12 @@ static int open_sock(void)
|
|||
if (ret < 0)
|
||||
fatal_with_errno(EXIT_FAILURE, "listen(%d, %d) failed", fd, US_LISTEN_BACKLOG);
|
||||
|
||||
/* don't leak socket to CMDSCRIPT */
|
||||
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
static void conn_del(conn_t *target)
|
||||
static void conn_del(struct conn_t *target)
|
||||
{
|
||||
conn_t *tmp, *last = NULL;
|
||||
struct conn_t *tmp, *last = NULL;
|
||||
|
||||
tmp = connhead;
|
||||
|
||||
|
@ -333,42 +327,19 @@ static void conn_del(conn_t *target)
|
|||
upslogx(LOG_ERR, "Tried to delete a bogus state connection");
|
||||
}
|
||||
|
||||
static int send_to_one(conn_t *conn, const char *fmt, ...)
|
||||
static int send_to_one(struct conn_t *conn, const char *fmt, ...)
|
||||
{
|
||||
ssize_t ret;
|
||||
size_t buflen;
|
||||
int ret;
|
||||
va_list ap;
|
||||
char buf[US_SOCK_BUF_LEN];
|
||||
|
||||
va_start(ap, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(ap);
|
||||
|
||||
buflen = strlen(buf);
|
||||
if (buflen >= SSIZE_MAX) {
|
||||
/* Can't compare buflen to ret */
|
||||
upsdebugx(2, "send_to_one(): buffered message too large");
|
||||
ret = write(conn->fd, buf, strlen(buf));
|
||||
|
||||
close(conn->fd);
|
||||
conn_del(conn);
|
||||
|
||||
return 0; /* failed */
|
||||
}
|
||||
ret = write(conn->fd, buf, buflen);
|
||||
|
||||
if ((ret < 1) || (ret != (ssize_t) buflen)) {
|
||||
if ((ret < 1) || (ret != (int) strlen(buf))) {
|
||||
upsdebugx(2, "write to fd %d failed", conn->fd);
|
||||
|
||||
close(conn->fd);
|
||||
|
@ -383,13 +354,9 @@ static int send_to_one(conn_t *conn, const char *fmt, ...)
|
|||
static void conn_add(int sockfd)
|
||||
{
|
||||
int acc, ret;
|
||||
conn_t *tmp, *last;
|
||||
struct conn_t *tmp, *last;
|
||||
struct sockaddr_un saddr;
|
||||
#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
|
||||
int salen;
|
||||
#else
|
||||
socklen_t salen;
|
||||
#endif
|
||||
|
||||
salen = sizeof(saddr);
|
||||
acc = accept(sockfd, (struct sockaddr *) &saddr, &salen);
|
||||
|
@ -399,9 +366,6 @@ static void conn_add(int sockfd)
|
|||
return;
|
||||
}
|
||||
|
||||
/* don't leak connection to CMDSCRIPT */
|
||||
fcntl(acc, F_SETFD, FD_CLOEXEC);
|
||||
|
||||
/* enable nonblocking I/O */
|
||||
|
||||
ret = fcntl(acc, F_GETFL, 0);
|
||||
|
@ -427,7 +391,7 @@ static void conn_add(int sockfd)
|
|||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
tmp = xmalloc(sizeof(conn_t));
|
||||
tmp = xmalloc(sizeof(struct conn_t));
|
||||
tmp->fd = acc;
|
||||
tmp->next = NULL;
|
||||
|
||||
|
@ -441,7 +405,7 @@ static void conn_add(int sockfd)
|
|||
pconf_init(&tmp->ctx, NULL);
|
||||
}
|
||||
|
||||
static int sock_arg(conn_t *conn)
|
||||
static int sock_arg(struct conn_t *conn)
|
||||
{
|
||||
if (conn->ctx.numargs < 1)
|
||||
return 0;
|
||||
|
@ -472,20 +436,19 @@ static int sock_arg(conn_t *conn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void log_unknown(size_t numarg, char **arg)
|
||||
static void log_unknown(int numarg, char **arg)
|
||||
{
|
||||
size_t i;
|
||||
int i;
|
||||
|
||||
upslogx(LOG_INFO, "Unknown command on socket: ");
|
||||
|
||||
for (i = 0; i < numarg; i++)
|
||||
upslogx(LOG_INFO, "arg %zu: %s", i, arg[i]);
|
||||
upslogx(LOG_INFO, "arg %d: %s", i, arg[i]);
|
||||
}
|
||||
|
||||
static int sock_read(conn_t *conn)
|
||||
static int sock_read(struct conn_t *conn)
|
||||
{
|
||||
int i;
|
||||
ssize_t ret;
|
||||
int i, ret;
|
||||
char ch;
|
||||
|
||||
for (i = 0; i < US_MAX_READ; i++) {
|
||||
|
@ -498,12 +461,6 @@ static int sock_read(conn_t *conn)
|
|||
if ((ret == -1) && (errno == EAGAIN))
|
||||
return 0;
|
||||
|
||||
/* O_NDELAY with zero bytes means nothing to read but
|
||||
* since read() follows a succesful select() with
|
||||
* ready file descriptor, ret shouldn't be 0. */
|
||||
if (ret == 0)
|
||||
continue;
|
||||
|
||||
/* some other problem */
|
||||
return -1; /* error */
|
||||
}
|
||||
|
@ -537,7 +494,10 @@ static void start_daemon(int lockfd)
|
|||
int maxfd, pid, pipefd, ret;
|
||||
struct timeval tv;
|
||||
fd_set rfds;
|
||||
conn_t *tmp, *tmpnext;
|
||||
struct conn_t *tmp, *tmpnext;
|
||||
socklen_t fromlen;
|
||||
|
||||
fromlen = sizeof(struct sockaddr);
|
||||
|
||||
us_serialize(SERIALIZE_INIT);
|
||||
|
||||
|
@ -633,8 +593,6 @@ static int try_connect(void)
|
|||
int pipefd, ret;
|
||||
struct sockaddr_un saddr;
|
||||
|
||||
check_unix_socket_filename(pipefn);
|
||||
|
||||
memset(&saddr, '\0', sizeof(saddr));
|
||||
saddr.sun_family = AF_UNIX;
|
||||
snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s", pipefn);
|
||||
|
@ -700,15 +658,28 @@ static int check_parent(const char *cmd, const char *arg2)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void read_timeout(int sig)
|
||||
{
|
||||
/* ignore this */
|
||||
return;
|
||||
}
|
||||
|
||||
static void setup_sigalrm(void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
sigset_t nut_upssched_sigmask;
|
||||
|
||||
sigemptyset(&nut_upssched_sigmask);
|
||||
sa.sa_mask = nut_upssched_sigmask;
|
||||
sa.sa_flags = 0;
|
||||
sa.sa_handler = read_timeout;
|
||||
sigaction(SIGALRM, &sa, NULL);
|
||||
}
|
||||
|
||||
static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
||||
{
|
||||
int i, pipefd;
|
||||
ssize_t ret;
|
||||
size_t enclen, buflen;
|
||||
char buf[SMALLBUF], enc[SMALLBUF + 8];
|
||||
int ret_s;
|
||||
struct timeval tv;
|
||||
fd_set fdread;
|
||||
int i, pipefd, ret;
|
||||
char buf[SMALLBUF], enc[SMALLBUF];
|
||||
|
||||
/* insanity */
|
||||
if (!arg1)
|
||||
|
@ -722,15 +693,7 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
|||
snprintfcat(buf, sizeof(buf), " \"%s\"",
|
||||
pconf_encode(arg2, enc, sizeof(enc)));
|
||||
|
||||
snprintf(enc, sizeof(enc), "%s\n", buf);
|
||||
|
||||
/* Sanity checks, for static analyzers to sleep well */
|
||||
enclen = strlen(enc);
|
||||
buflen = strlen(buf);
|
||||
if (enclen >= SSIZE_MAX || buflen >= SSIZE_MAX) {
|
||||
/* Can't compare enclen to ret below */
|
||||
fatalx(EXIT_FAILURE, "Unable to connect to daemon: buffered message too large");
|
||||
}
|
||||
snprintfcat(buf, sizeof(buf), "\n");
|
||||
|
||||
/* see if the parent needs to be started (and maybe start it) */
|
||||
|
||||
|
@ -739,6 +702,7 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
|||
pipefd = check_parent(cmd, arg2);
|
||||
|
||||
if (pipefd == PARENT_STARTED) {
|
||||
|
||||
/* loop back and try to connect now */
|
||||
usleep(250000);
|
||||
continue;
|
||||
|
@ -750,41 +714,23 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
|||
|
||||
/* we're connected now */
|
||||
|
||||
ret = write(pipefd, enc, enclen);
|
||||
ret = write(pipefd, buf, strlen(buf));
|
||||
|
||||
/* if we can't send the whole thing, loop back and try again */
|
||||
if ((ret < 1) || (ret != (ssize_t)enclen)) {
|
||||
if ((ret < 1) || (ret != (int) strlen(buf))) {
|
||||
upslogx(LOG_ERR, "write failed, trying again");
|
||||
close(pipefd);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* select on child's pipe fd */
|
||||
do {
|
||||
/* set timeout every time before call select() */
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
/* ugh - probably should use select here... */
|
||||
setup_sigalrm();
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_SET(pipefd, &fdread);
|
||||
|
||||
ret_s = select(pipefd + 1, &fdread, NULL, NULL, &tv);
|
||||
switch(ret_s) {
|
||||
/* select error */
|
||||
case -1:
|
||||
upslogx(LOG_DEBUG, "parent select error: %s", strerror(errno));
|
||||
break;
|
||||
|
||||
/* nothing to read */
|
||||
case 0:
|
||||
break;
|
||||
|
||||
/* available data to read */
|
||||
default:
|
||||
alarm(2);
|
||||
ret = read(pipefd, buf, sizeof(buf));
|
||||
break;
|
||||
}
|
||||
} while (ret_s <= 0);
|
||||
alarm(0);
|
||||
|
||||
signal(SIGALRM, SIG_IGN);
|
||||
|
||||
close(pipefd);
|
||||
|
||||
|
@ -800,7 +746,7 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
|||
upslogx(LOG_ERR, "read confirmation got [%s]", buf);
|
||||
|
||||
/* try again ... */
|
||||
} /* loop until MAX_TRIES if no success above */
|
||||
}
|
||||
|
||||
fatalx(EXIT_FAILURE, "Unable to connect to daemon and unable to start daemon");
|
||||
}
|
||||
|
@ -847,7 +793,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd,
|
|||
}
|
||||
|
||||
if (!strcmp(cmd, "EXECUTE")) {
|
||||
if (ca1[0] == '\0') {
|
||||
if (ca1 == '\0') {
|
||||
upslogx(LOG_ERR, "Empty EXECUTE command argument");
|
||||
return;
|
||||
}
|
||||
|
@ -862,7 +808,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd,
|
|||
upslogx(LOG_ERR, "Invalid command: %s", cmd);
|
||||
}
|
||||
|
||||
static int conf_arg(size_t numargs, char **arg)
|
||||
static int conf_arg(int numargs, char **arg)
|
||||
{
|
||||
if (numargs < 2)
|
||||
return 0;
|
||||
|
@ -953,18 +899,10 @@ static void checkconf(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *prog = NULL;
|
||||
/* More a use for argc to avoid warnings than a real need: */
|
||||
if (argc > 0) {
|
||||
xbasename(argv[0]);
|
||||
} else {
|
||||
xbasename("upssched");
|
||||
}
|
||||
|
||||
verbose = 1; /* TODO: remove when done testing, or add -D */
|
||||
verbose = 1; /* TODO: remove when done testing */
|
||||
|
||||
/* normally we don't have stderr, so get this going to syslog early */
|
||||
open_syslog(prog);
|
||||
openlog("upssched", LOG_PID, LOG_DAEMON);
|
||||
syslogbit_set();
|
||||
|
||||
upsname = getenv("UPSNAME");
|
||||
|
|
|
@ -1,31 +1,14 @@
|
|||
/* upssched.h - supporting structures */
|
||||
|
||||
#ifndef NUT_UPSSCHED_H_SEEN
|
||||
#define NUT_UPSSCHED_H_SEEN 1
|
||||
|
||||
#include <parseconf.h>
|
||||
|
||||
#define SERIALIZE_INIT 1
|
||||
#define SERIALIZE_SET 2
|
||||
#define SERIALIZE_WAIT 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/* track client connections */
|
||||
typedef struct conn_s {
|
||||
struct conn_t {
|
||||
int fd;
|
||||
PCONF_CTX_t ctx;
|
||||
struct conn_s *next;
|
||||
} conn_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_UPSSCHED_H_SEEN */
|
||||
void *next;
|
||||
};
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "nut_stdint.h"
|
||||
#include "upsclient.h"
|
||||
#include "cgilib.h"
|
||||
#include "parseconf.h"
|
||||
|
@ -40,12 +39,12 @@ struct list_t {
|
|||
#define HARD_UPSVAR_LIMIT_NUM 64
|
||||
#define HARD_UPSVAR_LIMIT_LEN 256
|
||||
|
||||
static char *monups, *username, *password, *function, *upscommand;
|
||||
char *monups, *username, *password, *function, *upscommand;
|
||||
|
||||
/* set once the MAGIC_ENABLE_STRING is found in the upsset.conf */
|
||||
static int magic_string_set = 0;
|
||||
/* set once the MAGIC_ENABLE_STRING is found in the upsset.conf */
|
||||
int magic_string_set = 0;
|
||||
|
||||
static uint16_t port;
|
||||
static int port;
|
||||
static char *upsname, *hostname;
|
||||
static UPSCONN_t ups;
|
||||
|
||||
|
@ -55,7 +54,7 @@ typedef struct {
|
|||
void *next;
|
||||
} uvtype_t;
|
||||
|
||||
static uvtype_t *firstuv = NULL;
|
||||
uvtype_t *firstuv = NULL;
|
||||
|
||||
void parsearg(char *var, char *value)
|
||||
{
|
||||
|
@ -164,7 +163,7 @@ static void do_hidden(const char *next)
|
|||
}
|
||||
|
||||
/* generate SELECT chooser from hosts.conf entries */
|
||||
static void upslist_arg(size_t numargs, char **arg)
|
||||
static void upslist_arg(int numargs, char **arg)
|
||||
{
|
||||
if (numargs < 3)
|
||||
return;
|
||||
|
@ -254,10 +253,6 @@ static void do_pickups(const char *currfunc)
|
|||
printf("</FORM>\n");
|
||||
}
|
||||
|
||||
static void error_page(const char *next, const char *title,
|
||||
const char *fmt, ...)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void error_page(const char *next, const char *title,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
|
@ -265,19 +260,7 @@ static void error_page(const char *next, const char *title,
|
|||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(ap);
|
||||
|
||||
do_header(title);
|
||||
|
@ -299,9 +282,6 @@ static void error_page(const char *next, const char *title,
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
static void loginscreen(void)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void loginscreen(void)
|
||||
{
|
||||
do_header("Login");
|
||||
|
@ -351,7 +331,7 @@ static void upsd_connect(void)
|
|||
static void print_cmd(const char *cmd)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
char **answer;
|
||||
const char *query[4];
|
||||
|
||||
|
@ -374,7 +354,7 @@ static void print_cmd(const char *cmd)
|
|||
static void showcmds(void)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[2];
|
||||
char **answer;
|
||||
struct list_t *lhead, *llast, *ltmp, *lnext;
|
||||
|
@ -411,7 +391,7 @@ static void showcmds(void)
|
|||
/* CMD upsname cmdname */
|
||||
if (numa < 3) {
|
||||
fprintf(stderr, "Error: insufficient data "
|
||||
"(got %zu args, need at least 3)\n", numa);
|
||||
"(got %d args, need at least 3)\n", numa);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -526,9 +506,6 @@ static void send_auth(const char *next)
|
|||
"Password set failed: %s", upscli_strerror(&ups));
|
||||
}
|
||||
|
||||
static void docmd(void)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void docmd(void)
|
||||
{
|
||||
char buf[SMALLBUF], *desc;
|
||||
|
@ -618,7 +595,7 @@ static void docmd(void)
|
|||
static const char *get_data(const char *type, const char *varname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
char **answer;
|
||||
const char *query[4];
|
||||
|
||||
|
@ -656,7 +633,7 @@ static void do_string(const char *varname, int maxlen)
|
|||
static void do_enum(const char *varname)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
char **answer, *val;
|
||||
const char *query[4], *tmp;
|
||||
|
||||
|
@ -684,7 +661,6 @@ static void do_enum(const char *varname)
|
|||
printf("Unavailable\n");
|
||||
fprintf(stderr, "Error doing ENUM %s %s: %s\n",
|
||||
upsname, varname, upscli_strerror(&ups));
|
||||
free(val);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -698,7 +674,7 @@ static void do_enum(const char *varname)
|
|||
|
||||
if (numa < 4) {
|
||||
fprintf(stderr, "Error: insufficient data "
|
||||
"(got %zu args, need at least 4)\n", numa);
|
||||
"(got %d args, need at least 4)\n", numa);
|
||||
|
||||
free(val);
|
||||
return;
|
||||
|
@ -721,7 +697,7 @@ static void do_enum(const char *varname)
|
|||
static void do_type(const char *varname)
|
||||
{
|
||||
int ret;
|
||||
size_t i, numq, numa;
|
||||
unsigned int i, numq, numa;
|
||||
char **answer;
|
||||
const char *query[4];
|
||||
|
||||
|
@ -751,9 +727,7 @@ static void do_type(const char *varname)
|
|||
/* split out the :<len> data */
|
||||
ptr = strchr(answer[i], ':');
|
||||
*ptr++ = '\0';
|
||||
long l = strtol(ptr, (char **) NULL, 10);
|
||||
assert(l <= 127); /* FIXME: Loophole about longer numbers? Why are we limited to char at all here? */
|
||||
len = (char)l;
|
||||
len = strtol(ptr, (char **) NULL, 10);
|
||||
|
||||
do_string(varname, len);
|
||||
return;
|
||||
|
@ -767,12 +741,10 @@ static void do_type(const char *varname)
|
|||
}
|
||||
}
|
||||
|
||||
static void print_rw(const char *arg_upsname, const char *varname)
|
||||
static void print_rw(const char *upsname, const char *varname)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
printf("<!-- <TR><TD>Device</TD><TD>%s</TD></TR> -->\n", arg_upsname);
|
||||
|
||||
printf("<TR BGCOLOR=\"#60B0B0\" ALIGN=\"CENTER\">\n");
|
||||
|
||||
printf("<TD>");
|
||||
|
@ -793,13 +765,10 @@ static void print_rw(const char *arg_upsname, const char *varname)
|
|||
printf("</TR>\n");
|
||||
}
|
||||
|
||||
static void showsettings(void)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void showsettings(void)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[2];
|
||||
char **answer, *desc = NULL;
|
||||
struct list_t *lhead, *llast, *ltmp, *lnext;
|
||||
|
@ -938,9 +907,6 @@ static int setvar(const char *var, const char *val)
|
|||
}
|
||||
|
||||
/* turn a form submission of settings into SET commands for upsd */
|
||||
static void savesettings(void)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void savesettings(void)
|
||||
{
|
||||
int changed = 0;
|
||||
|
@ -987,9 +953,6 @@ static void savesettings(void)
|
|||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
static void initial_pickups(void)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void initial_pickups(void)
|
||||
{
|
||||
do_header("Select a UPS");
|
||||
|
@ -1068,8 +1031,6 @@ static void check_conf(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(argc);
|
||||
NUT_UNUSED_VARIABLE(argv);
|
||||
username = password = function = monups = NULL;
|
||||
|
||||
printf("Content-type: text/html\n\n");
|
||||
|
@ -1086,7 +1047,6 @@ int main(int argc, char **argv)
|
|||
FD_SET(STDIN_FILENO, &fds);
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 250000; /* wait for up to 250ms for a POST response */
|
||||
|
||||
if ((select(STDIN_FILENO+1, &fds, 0, 0, &tv)) > 0)
|
||||
extractpostargs();
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "nut_stdint.h"
|
||||
#include "timehead.h"
|
||||
#include "upsclient.h"
|
||||
#include "status.h"
|
||||
#include "cgilib.h"
|
||||
#include "parseconf.h"
|
||||
#include "timehead.h"
|
||||
#include "upsstats.h"
|
||||
#include "upsimagearg.h"
|
||||
|
||||
|
@ -37,7 +36,7 @@ static int use_celsius = 1, refreshdelay = -1, treemode = 0;
|
|||
/* from cgilib's checkhost() */
|
||||
static char *monhostdesc = NULL;
|
||||
|
||||
static uint16_t port;
|
||||
static int port;
|
||||
static char *upsname, *hostname;
|
||||
static char *upsimgpath="upsimage.cgi", *upsstatpath="upsstats.cgi";
|
||||
static UPSCONN_t ups;
|
||||
|
@ -104,7 +103,7 @@ static int check_ups_fd(int do_report)
|
|||
static int get_var(const char *var, char *buf, size_t buflen, int verbose)
|
||||
{
|
||||
int ret;
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -196,10 +195,9 @@ static int do_date(const char *buf)
|
|||
{
|
||||
char datebuf[SMALLBUF];
|
||||
time_t tod;
|
||||
struct tm tmbuf;
|
||||
|
||||
time(&tod);
|
||||
if (strftime(datebuf, sizeof(datebuf), buf, localtime_r(&tod, &tmbuf))) {
|
||||
if (strftime(datebuf, sizeof(datebuf), buf, localtime(&tod))) {
|
||||
printf("%s", datebuf);
|
||||
return 1;
|
||||
}
|
||||
|
@ -351,7 +349,7 @@ static void ups_connect(void)
|
|||
{
|
||||
static ulist_t *lastups = NULL;
|
||||
char *newups, *newhost;
|
||||
uint16_t newport;
|
||||
int newport;
|
||||
|
||||
/* try to minimize reconnects */
|
||||
if (lastups) {
|
||||
|
@ -566,7 +564,7 @@ static void do_upsimgpath(const char *s) {
|
|||
static void do_temp(const char *var)
|
||||
{
|
||||
char tempc[SMALLBUF];
|
||||
double tempf;
|
||||
float tempf;
|
||||
|
||||
if (!get_var(var, tempc, sizeof(tempc), 1))
|
||||
return;
|
||||
|
@ -809,8 +807,7 @@ static int do_command(char *cmd)
|
|||
static void parse_line(const char *buf)
|
||||
{
|
||||
char cmd[SMALLBUF];
|
||||
size_t i, len;
|
||||
char do_cmd = 0;
|
||||
int i, len, do_cmd = 0;
|
||||
|
||||
for (i = 0; buf[i]; i += len) {
|
||||
|
||||
|
@ -827,10 +824,9 @@ static void parse_line(const char *buf)
|
|||
i++; /* skip over the '@' character */
|
||||
continue;
|
||||
}
|
||||
assert (len < INT_MAX);
|
||||
|
||||
if (do_cmd) {
|
||||
snprintf(cmd, sizeof(cmd), "%.*s", (int)len, &buf[i]);
|
||||
snprintf(cmd, sizeof(cmd), "%.*s", len, &buf[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -840,7 +836,7 @@ static void parse_line(const char *buf)
|
|||
}
|
||||
|
||||
/* pass it trough */
|
||||
printf("%.*s", (int)len, &buf[i]);
|
||||
printf("%.*s", len, &buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -869,7 +865,7 @@ static void display_template(const char *tfn)
|
|||
|
||||
static void display_tree(int verbose)
|
||||
{
|
||||
size_t numq, numa;
|
||||
unsigned int numq, numa;
|
||||
const char *query[4];
|
||||
char **answer;
|
||||
|
||||
|
@ -1045,9 +1041,6 @@ static void display_single(void)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
NUT_UNUSED_VARIABLE(argc);
|
||||
NUT_UNUSED_VARIABLE(argv);
|
||||
|
||||
extractcgiargs();
|
||||
|
||||
printf("Content-type: text/html\n");
|
||||
|
|
|
@ -17,25 +17,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef NUT_UPSSTATS_H_SEEN
|
||||
#define NUT_UPSSTATS_H_SEEN 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *sys;
|
||||
char *desc;
|
||||
void *next;
|
||||
} ulist_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif /* NUT_UPSSTATS_H_SEEN */
|
||||
|
|
|
@ -2,48 +2,14 @@
|
|||
|
||||
AM_CFLAGS = -I$(top_srcdir)/include
|
||||
|
||||
noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la
|
||||
noinst_LIBRARIES = libcommon.a
|
||||
libcommon_a_SOURCES = common.c state.c upsconf.c ../include/nut_version.h
|
||||
libcommon_a_LIBADD = libparseconf.la
|
||||
|
||||
../include/nut_version.h: FORCE
|
||||
(cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h)
|
||||
|
||||
FORCE:
|
||||
|
||||
noinst_LTLIBRARIES = libparseconf.la
|
||||
libparseconf_la_SOURCES = parseconf.c
|
||||
|
||||
# do not hard depend on '../include/nut_version.h', since it blocks
|
||||
# 'dist', and is only required for actual build, in which case
|
||||
# BUILT_SOURCES (in ../include) will ensure nut_version.h will
|
||||
# be built before anything else... but do depend on its build area:
|
||||
if BUILDING_IN_TREE
|
||||
# No need for symlink hack
|
||||
common.c: $(top_builddir)/include/nut_version.h
|
||||
else
|
||||
# Surprisingly, for some "make" implementations this dependency means
|
||||
# that the "common.c" required for builds below will be seeked in the
|
||||
# current directory. So for out-of-tree builds like distcheck, we have
|
||||
# to symlink the "real" source to build area:
|
||||
common.c: $(top_builddir)/include/nut_version.h $(srcdir)/common.c
|
||||
test -s "$@" || ln -s -f "$(top_srcdir)/common/common.c" "$@"
|
||||
endif
|
||||
|
||||
$(top_builddir)/include/nut_version.h:
|
||||
@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
|
||||
|
||||
libcommon_la_SOURCES = state.c str.c upsconf.c
|
||||
libcommonclient_la_SOURCES = state.c str.c
|
||||
if BUILDING_IN_TREE
|
||||
libcommon_la_SOURCES += common.c
|
||||
libcommonclient_la_SOURCES += common.c
|
||||
else
|
||||
nodist_libcommon_la_SOURCES = common.c
|
||||
nodist_libcommonclient_la_SOURCES = common.c
|
||||
CLEANFILES = $(top_builddir)/common/common.c
|
||||
BUILT_SOURCES = common.c
|
||||
endif
|
||||
|
||||
# ensure inclusion of local implementation of missing systems functions
|
||||
# using LTLIBOBJS. Refer to configure.in/.ac -> AC_REPLACE_FUNCS
|
||||
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
||||
libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
|
||||
# NOTE: Do not clean ".deps" in SUBDIRS of the main project,
|
||||
# the root Makefile.am takes care of that!
|
||||
#clean-local:
|
||||
# rm -rf $(builddir)/.deps
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -16,62 +17,8 @@
|
|||
|
||||
# Network UPS Tools: common
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -91,152 +38,65 @@ POST_UNINSTALL = :
|
|||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@BUILDING_IN_TREE_TRUE@am__append_1 = common.c
|
||||
@BUILDING_IN_TREE_TRUE@am__append_2 = common.c
|
||||
subdir = common
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_c_pragmas.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/ax_run_or_link_ifelse.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_asciidoc.m4 \
|
||||
$(top_srcdir)/m4/nut_check_cppcheck.m4 \
|
||||
$(top_srcdir)/m4/nut_check_headers_windows.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_ipv6.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_check_pkgconfig.m4 \
|
||||
$(top_srcdir)/m4/nut_check_python.m4 \
|
||||
$(top_srcdir)/m4/nut_compiler_family.m4 \
|
||||
$(top_srcdir)/m4/nut_func_getnameinfo_argtypes.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libcommon_a_AR = $(AR) $(ARFLAGS)
|
||||
libcommon_a_DEPENDENCIES = libparseconf.la
|
||||
am_libcommon_a_OBJECTS = common.$(OBJEXT) state.$(OBJEXT) \
|
||||
upsconf.$(OBJEXT)
|
||||
libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS)
|
||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||
libcommon_la_DEPENDENCIES = libparseconf.la @LTLIBOBJS@
|
||||
am__libcommon_la_SOURCES_DIST = state.c str.c upsconf.c common.c
|
||||
@BUILDING_IN_TREE_TRUE@am__objects_1 = common.lo
|
||||
am_libcommon_la_OBJECTS = state.lo str.lo upsconf.lo $(am__objects_1)
|
||||
@BUILDING_IN_TREE_FALSE@nodist_libcommon_la_OBJECTS = common.lo
|
||||
libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) \
|
||||
$(nodist_libcommon_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
libcommonclient_la_DEPENDENCIES = libparseconf.la @LTLIBOBJS@
|
||||
am__libcommonclient_la_SOURCES_DIST = state.c str.c common.c
|
||||
am_libcommonclient_la_OBJECTS = state.lo str.lo $(am__objects_1)
|
||||
@BUILDING_IN_TREE_FALSE@nodist_libcommonclient_la_OBJECTS = common.lo
|
||||
libcommonclient_la_OBJECTS = $(am_libcommonclient_la_OBJECTS) \
|
||||
$(nodist_libcommonclient_la_OBJECTS)
|
||||
libparseconf_la_LIBADD =
|
||||
am_libparseconf_la_OBJECTS = parseconf.lo
|
||||
libparseconf_la_OBJECTS = $(am_libparseconf_la_OBJECTS)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = $(DEPDIR)/atexit.Plo $(DEPDIR)/setenv.Plo \
|
||||
$(DEPDIR)/snprintf.Plo $(DEPDIR)/strerror.Plo \
|
||||
./$(DEPDIR)/common.Plo ./$(DEPDIR)/parseconf.Plo \
|
||||
./$(DEPDIR)/state.Plo ./$(DEPDIR)/str.Plo \
|
||||
./$(DEPDIR)/upsconf.Plo
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libcommon_la_SOURCES) $(nodist_libcommon_la_SOURCES) \
|
||||
$(libcommonclient_la_SOURCES) \
|
||||
$(nodist_libcommonclient_la_SOURCES) \
|
||||
$(libparseconf_la_SOURCES)
|
||||
DIST_SOURCES = $(am__libcommon_la_SOURCES_DIST) \
|
||||
$(am__libcommonclient_la_SOURCES_DIST) \
|
||||
$(libparseconf_la_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libcommon_a_SOURCES) $(libparseconf_la_SOURCES)
|
||||
DIST_SOURCES = $(libcommon_a_SOURCES) $(libparseconf_la_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp atexit.c \
|
||||
setenv.c snprintf.c strerror.c
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUGPARSE = @AUGPARSE@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -247,25 +107,13 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPCHECK = @CPPCHECK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBLATEX = @DBLATEX@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DRVPATH = @DRVPATH@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
|
@ -274,8 +122,12 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||
GREP = @GREP@
|
||||
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
|
||||
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
|
||||
HAL_FDI_PATH = @HAL_FDI_PATH@
|
||||
HAL_USER = @HAL_USER@
|
||||
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -283,51 +135,34 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LIBS = @LIBNETSNMP_LIBS@
|
||||
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
|
||||
LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LN_S_R = @LN_S_R@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NUT_DATADIR = @NUT_DATADIR@
|
||||
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||
NUT_NETVERSION = @NUT_NETVERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_NAME = @OS_NAME@
|
||||
|
@ -341,46 +176,29 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PIDPATH = @PIDPATH@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
SBINDIR = @SBINDIR@
|
||||
SED = @SED@
|
||||
SERLIBS = @SERLIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||
STATEPATH = @STATEPATH@
|
||||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
TREE_VERSION = @TREE_VERSION@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
XMLLINT = @XMLLINT@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
auglensdir = @auglensdir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -391,12 +209,8 @@ builddir = @builddir@
|
|||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dummy_PKG_CONFIG = @dummy_PKG_CONFIG@
|
||||
dummy_PKG_CONFIG_CFLAGS = @dummy_PKG_CONFIG_CFLAGS@
|
||||
dummy_PKG_CONFIG_LIBS = @dummy_PKG_CONFIG_LIBS@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
|
@ -413,23 +227,19 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
now = @now@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdshutdowndir = @systemdshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
|
@ -440,22 +250,12 @@ top_builddir = @top_builddir@
|
|||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
AM_CFLAGS = -I$(top_srcdir)/include
|
||||
noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la
|
||||
noinst_LIBRARIES = libcommon.a
|
||||
libcommon_a_SOURCES = common.c state.c upsconf.c ../include/nut_version.h
|
||||
libcommon_a_LIBADD = libparseconf.la
|
||||
noinst_LTLIBRARIES = libparseconf.la
|
||||
libparseconf_la_SOURCES = parseconf.c
|
||||
libcommon_la_SOURCES = state.c str.c upsconf.c $(am__append_1)
|
||||
libcommonclient_la_SOURCES = state.c str.c $(am__append_2)
|
||||
@BUILDING_IN_TREE_FALSE@nodist_libcommon_la_SOURCES = common.c
|
||||
@BUILDING_IN_TREE_FALSE@nodist_libcommonclient_la_SOURCES = common.c
|
||||
@BUILDING_IN_TREE_FALSE@CLEANFILES = $(top_builddir)/common/common.c
|
||||
@BUILDING_IN_TREE_FALSE@BUILT_SOURCES = common.c
|
||||
|
||||
# ensure inclusion of local implementation of missing systems functions
|
||||
# using LTLIBOBJS. Refer to configure.in/.ac -> AC_REPLACE_FUNCS
|
||||
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
||||
libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
all: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
|
@ -471,13 +271,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu common/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -489,25 +290,23 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
|||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libcommon.a: $(libcommon_a_OBJECTS) $(libcommon_a_DEPENDENCIES)
|
||||
-rm -f libcommon.a
|
||||
$(libcommon_a_AR) libcommon.a $(libcommon_a_OBJECTS) $(libcommon_a_LIBADD)
|
||||
$(RANLIB) libcommon.a
|
||||
|
||||
clean-noinstLTLIBRARIES:
|
||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||
@list='$(noinst_LTLIBRARIES)'; \
|
||||
locs=`for p in $$list; do echo $$p; done | \
|
||||
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||
sort -u`; \
|
||||
test -z "$$locs" || { \
|
||||
echo rm -f $${locs}; \
|
||||
rm -f $${locs}; \
|
||||
}
|
||||
|
||||
libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS)
|
||||
|
||||
libcommonclient.la: $(libcommonclient_la_OBJECTS) $(libcommonclient_la_DEPENDENCIES) $(EXTRA_libcommonclient_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(LINK) $(libcommonclient_la_OBJECTS) $(libcommonclient_la_LIBADD) $(LIBS)
|
||||
|
||||
libparseconf.la: $(libparseconf_la_OBJECTS) $(libparseconf_la_DEPENDENCIES) $(EXTRA_libparseconf_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(LINK) $(libparseconf_la_OBJECTS) $(libparseconf_la_LIBADD) $(LIBS)
|
||||
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libparseconf.la: $(libparseconf_la_OBJECTS) $(libparseconf_la_DEPENDENCIES)
|
||||
$(LINK) $(libparseconf_la_OBJECTS) $(libparseconf_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
@ -515,45 +314,31 @@ mostlyclean-compile:
|
|||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/atexit.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/setenv.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseconf.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str.Plo@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upsconf.Plo@am__quote@ # am--include-marker
|
||||
|
||||
$(am__depfiles_remade):
|
||||
@$(MKDIR_P) $(@D)
|
||||
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
|
||||
|
||||
am--depfiles: $(am__depfiles_remade)
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseconf.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upsconf.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
@ -561,15 +346,26 @@ mostlyclean-libtool:
|
|||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
@ -581,11 +377,15 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
@ -594,29 +394,11 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
@ -647,14 +429,11 @@ distdir-am: $(DISTFILES)
|
|||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES) $(LTLIBRARIES)
|
||||
installdirs:
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||
install-exec: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-exec-am
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
|
@ -663,19 +442,13 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
@ -684,23 +457,13 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||
mostlyclean-am
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
clean-noinstLTLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(DEPDIR)/atexit.Plo
|
||||
-rm -f $(DEPDIR)/setenv.Plo
|
||||
-rm -f $(DEPDIR)/snprintf.Plo
|
||||
-rm -f $(DEPDIR)/strerror.Plo
|
||||
-rm -f ./$(DEPDIR)/common.Plo
|
||||
-rm -f ./$(DEPDIR)/parseconf.Plo
|
||||
-rm -f ./$(DEPDIR)/state.Plo
|
||||
-rm -f ./$(DEPDIR)/str.Plo
|
||||
-rm -f ./$(DEPDIR)/upsconf.Plo
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
@ -746,15 +509,7 @@ install-ps-am:
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f $(DEPDIR)/atexit.Plo
|
||||
-rm -f $(DEPDIR)/setenv.Plo
|
||||
-rm -f $(DEPDIR)/snprintf.Plo
|
||||
-rm -f $(DEPDIR)/strerror.Plo
|
||||
-rm -f ./$(DEPDIR)/common.Plo
|
||||
-rm -f ./$(DEPDIR)/parseconf.Plo
|
||||
-rm -f ./$(DEPDIR)/state.Plo
|
||||
-rm -f ./$(DEPDIR)/str.Plo
|
||||
-rm -f ./$(DEPDIR)/upsconf.Plo
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
|
@ -773,45 +528,27 @@ ps-am:
|
|||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: all check install install-am install-exec install-strip
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||
cscopelist-am ctags ctags-am distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
|
||||
ctags distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
tags uninstall uninstall-am
|
||||
|
||||
|
||||
# do not hard depend on '../include/nut_version.h', since it blocks
|
||||
# 'dist', and is only required for actual build, in which case
|
||||
# BUILT_SOURCES (in ../include) will ensure nut_version.h will
|
||||
# be built before anything else... but do depend on its build area:
|
||||
# No need for symlink hack
|
||||
@BUILDING_IN_TREE_TRUE@common.c: $(top_builddir)/include/nut_version.h
|
||||
# Surprisingly, for some "make" implementations this dependency means
|
||||
# that the "common.c" required for builds below will be seeked in the
|
||||
# current directory. So for out-of-tree builds like distcheck, we have
|
||||
# to symlink the "real" source to build area:
|
||||
@BUILDING_IN_TREE_FALSE@common.c: $(top_builddir)/include/nut_version.h $(srcdir)/common.c
|
||||
@BUILDING_IN_TREE_FALSE@ test -s "$@" || ln -s -f "$(top_srcdir)/common/common.c" "$@"
|
||||
../include/nut_version.h: FORCE
|
||||
(cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h)
|
||||
|
||||
$(top_builddir)/include/nut_version.h:
|
||||
@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F)
|
||||
|
||||
# NOTE: Do not clean ".deps" in SUBDIRS of the main project,
|
||||
# the root Makefile.am takes care of that!
|
||||
#clean-local:
|
||||
# rm -rf $(builddir)/.deps
|
||||
FORCE:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/* atexit() Mark Powell <medp@primagraphics.co.uk> */
|
||||
/* Implemented in terms of on_exit() for old BSD-style systems, like SunOS4 */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef HAVE_ATEXIT
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
int atexit(fn)
|
||||
void (*fn)();
|
||||
{
|
||||
#ifdef HAVE_ON_EXIT
|
||||
return on_exit(fn, 0);
|
||||
#else
|
||||
/* Choose some errno thats likely to exist on lots of systems */
|
||||
errno = EPERM;
|
||||
return (-1);
|
||||
#endif /* HAVE_ON_EXIT */
|
||||
}
|
||||
|
||||
#endif /* HAVE_ATEXIT */
|
645
common/common.c
645
common/common.c
|
@ -1,7 +1,6 @@
|
|||
/* common.c - common useful functions
|
||||
|
||||
Copyright (C) 2000 Russell Kroll <rkroll@exploits.org>
|
||||
Copyright (C) 2021-2022 Jim Klimov <jimklimov+nut@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -22,11 +21,8 @@
|
|||
|
||||
#include <ctype.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
/* the reason we define UPS_VERSION as a static string, rather than a
|
||||
macro, is to make dependency tracking easier (only common.o depends
|
||||
|
@ -36,64 +32,17 @@
|
|||
#include "nut_version.h"
|
||||
const char *UPS_VERSION = NUT_VERSION_MACRO;
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Know which bitness we were built for,
|
||||
* to adjust the search paths for get_libname() */
|
||||
#include "nut_stdint.h"
|
||||
#if UINTPTR_MAX == 0xffffffffffffffffULL
|
||||
# define BUILD_64 1
|
||||
#else
|
||||
# ifdef BUILD_64
|
||||
# undef BUILD_64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* https://stackoverflow.com/a/12844426/4715872 */
|
||||
#include <sys/types.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
pid_t get_max_pid_t()
|
||||
{
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code"
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunreachable-code"
|
||||
#endif
|
||||
if (sizeof(pid_t) == sizeof(short)) return (pid_t)SHRT_MAX;
|
||||
if (sizeof(pid_t) == sizeof(int)) return (pid_t)INT_MAX;
|
||||
if (sizeof(pid_t) == sizeof(long)) return (pid_t)LONG_MAX;
|
||||
#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || (defined _STDC_C99) || (defined __C99FEATURES__) /* C99+ build mode */
|
||||
# if defined(LLONG_MAX) /* since C99 */
|
||||
if (sizeof(pid_t) == sizeof(long long)) return (pid_t)LLONG_MAX;
|
||||
# endif
|
||||
#endif
|
||||
abort();
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
int nut_debug_level = 0;
|
||||
int nut_log_level = 0;
|
||||
static int upslog_flags = UPSLOG_STDERR;
|
||||
|
||||
static void xbit_set(int *val, int flag)
|
||||
{
|
||||
*val |= flag;
|
||||
*val = (*val |= flag);
|
||||
}
|
||||
|
||||
static void xbit_clear(int *val, int flag)
|
||||
{
|
||||
*val ^= (*val & flag);
|
||||
*val = (*val ^= (*val & flag));
|
||||
}
|
||||
|
||||
static int xbit_test(int val, int flag)
|
||||
|
@ -121,44 +70,6 @@ void open_syslog(const char *progname)
|
|||
#endif
|
||||
|
||||
openlog(progname, opt, LOG_FACILITY);
|
||||
|
||||
switch (nut_log_level)
|
||||
{
|
||||
#if HAVE_SETLOGMASK && HAVE_DECL_LOG_UPTO
|
||||
case 7:
|
||||
setlogmask(LOG_UPTO(LOG_EMERG)); /* system is unusable */
|
||||
break;
|
||||
case 6:
|
||||
setlogmask(LOG_UPTO(LOG_ALERT)); /* action must be taken immediately */
|
||||
break;
|
||||
case 5:
|
||||
setlogmask(LOG_UPTO(LOG_CRIT)); /* critical conditions */
|
||||
break;
|
||||
case 4:
|
||||
setlogmask(LOG_UPTO(LOG_ERR)); /* error conditions */
|
||||
break;
|
||||
case 3:
|
||||
setlogmask(LOG_UPTO(LOG_WARNING)); /* warning conditions */
|
||||
break;
|
||||
case 2:
|
||||
setlogmask(LOG_UPTO(LOG_NOTICE)); /* normal but significant condition */
|
||||
break;
|
||||
case 1:
|
||||
setlogmask(LOG_UPTO(LOG_INFO)); /* informational */
|
||||
break;
|
||||
case 0:
|
||||
setlogmask(LOG_UPTO(LOG_DEBUG)); /* debug-level messages */
|
||||
break;
|
||||
default:
|
||||
fatalx(EXIT_FAILURE, "Invalid log level threshold");
|
||||
#else
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
upslogx(LOG_INFO, "Changing log level threshold not possible");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* close ttys and become a daemon */
|
||||
|
@ -214,31 +125,7 @@ struct passwd *get_user_pwent(const char *name)
|
|||
else
|
||||
fatal_with_errno(EXIT_FAILURE, "getpwnam(%s)", name);
|
||||
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) || (defined HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE_RETURN) )
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE_RETURN
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code-return"
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunreachable-code"
|
||||
# ifdef HAVE_PRAGMA_CLANG_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE_RETURN
|
||||
# pragma clang diagnostic ignored "-Wunreachable-code-return"
|
||||
# endif
|
||||
#endif
|
||||
/* Oh joy, adding unreachable "return" to make one compiler happy,
|
||||
* and pragmas around to make other compilers happy, all at once! */
|
||||
return NULL;
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) || (defined HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE_RETURN) )
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
return NULL; /* to make the compiler happy */
|
||||
}
|
||||
|
||||
/* change to the user defined in the struct */
|
||||
|
@ -282,7 +169,7 @@ void writepid(const char *name)
|
|||
{
|
||||
char fn[SMALLBUF];
|
||||
FILE *pidf;
|
||||
mode_t mask;
|
||||
int mask;
|
||||
|
||||
/* use full path if present, else build filename in PIDPATH */
|
||||
if (*name == '/')
|
||||
|
@ -294,9 +181,7 @@ void writepid(const char *name)
|
|||
pidf = fopen(fn, "w");
|
||||
|
||||
if (pidf) {
|
||||
intmax_t pid = (intmax_t)getpid();
|
||||
upsdebugx(1, "Saving PID %jd into %s", pid, fn);
|
||||
fprintf(pidf, "%jd\n", pid);
|
||||
fprintf(pidf, "%d\n", (int) getpid());
|
||||
fclose(pidf);
|
||||
} else {
|
||||
upslog_with_errno(LOG_NOTICE, "writepid: fopen %s", fn);
|
||||
|
@ -305,17 +190,28 @@ void writepid(const char *name)
|
|||
umask(mask);
|
||||
}
|
||||
|
||||
/* send sig to pid, returns -1 for error, or
|
||||
* zero for a successfully sent signal
|
||||
*/
|
||||
int sendsignalpid(pid_t pid, int sig)
|
||||
/* open pidfn, get the pid, then send it sig */
|
||||
int sendsignalfn(const char *pidfn, int sig)
|
||||
{
|
||||
int ret;
|
||||
char buf[SMALLBUF];
|
||||
FILE *pidf;
|
||||
int pid, ret;
|
||||
|
||||
if (pid < 2 || pid > get_max_pid_t()) {
|
||||
upslogx(LOG_NOTICE,
|
||||
"Ignoring invalid pid number %" PRIdMAX,
|
||||
(intmax_t) pid);
|
||||
pidf = fopen(pidfn, "r");
|
||||
if (!pidf) {
|
||||
upslog_with_errno(LOG_NOTICE, "fopen %s", pidfn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fgets(buf, sizeof(buf), pidf) == NULL) {
|
||||
upslogx(LOG_NOTICE, "Failed to read pid from %s", pidfn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pid = strtol(buf, (char **)NULL, 10);
|
||||
|
||||
if (pid < 2) {
|
||||
upslogx(LOG_NOTICE, "Ignoring invalid pid number %d", pid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -327,7 +223,6 @@ int sendsignalpid(pid_t pid, int sig)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (sig != 0) {
|
||||
/* now actually send it */
|
||||
ret = kill(pid, sig);
|
||||
|
||||
|
@ -335,69 +230,10 @@ int sendsignalpid(pid_t pid, int sig)
|
|||
perror("kill");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* parses string buffer into a pid_t if it passes
|
||||
* a few sanity checks; returns -1 on error
|
||||
*/
|
||||
pid_t parsepid(const char *buf)
|
||||
{
|
||||
pid_t pid = -1;
|
||||
|
||||
/* assuming 10 digits for a long */
|
||||
intmax_t _pid = strtol(buf, (char **)NULL, 10);
|
||||
if (_pid <= get_max_pid_t()) {
|
||||
pid = (pid_t)_pid;
|
||||
} else {
|
||||
upslogx(LOG_NOTICE, "Received a pid number too big for a pid_t: %" PRIdMAX, _pid);
|
||||
}
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
||||
/* open pidfn, get the pid, then send it sig
|
||||
* returns negative codes for errors, or
|
||||
* zero for a successfully sent signal
|
||||
*/
|
||||
int sendsignalfn(const char *pidfn, int sig)
|
||||
{
|
||||
char buf[SMALLBUF];
|
||||
FILE *pidf;
|
||||
pid_t pid = -1;
|
||||
int ret = -1;
|
||||
|
||||
pidf = fopen(pidfn, "r");
|
||||
if (!pidf) {
|
||||
upslog_with_errno(LOG_NOTICE, "fopen %s", pidfn);
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (fgets(buf, sizeof(buf), pidf) == NULL) {
|
||||
upslogx(LOG_NOTICE, "Failed to read pid from %s", pidfn);
|
||||
fclose(pidf);
|
||||
return -2;
|
||||
}
|
||||
/* TOTHINK: Original code only closed pidf before
|
||||
* exiting the method, on error or "normally".
|
||||
* Why not here? Do we want an (exclusive?) hold
|
||||
* on it while being active in the method?
|
||||
*/
|
||||
|
||||
/* this method actively reports errors, if any */
|
||||
pid = parsepid(buf);
|
||||
|
||||
if (pid >= 0) {
|
||||
/* this method actively reports errors, if any */
|
||||
ret = sendsignalpid(pid, sig);
|
||||
}
|
||||
|
||||
fclose(pidf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int snprintfcat(char *dst, size_t size, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -405,46 +241,14 @@ int snprintfcat(char *dst, size_t size, const char *fmt, ...)
|
|||
int ret;
|
||||
|
||||
size--;
|
||||
if (len > size) {
|
||||
/* Do not truncate existing string */
|
||||
errno = ERANGE;
|
||||
return -1;
|
||||
}
|
||||
assert(len <= size);
|
||||
|
||||
va_start(ap, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
/* Note: this code intentionally uses a caller-provided format string */
|
||||
ret = vsnprintf(dst + len, size - len, fmt, ap);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(ap);
|
||||
|
||||
dst[size] = '\0';
|
||||
|
||||
/* Note: there is a standards loophole here: strlen() must return size_t
|
||||
* and printf() family returns a signed int with negatives for errors.
|
||||
* In theory it can overflow a 64-vs-32 bit range, or signed-vs-unsigned.
|
||||
* In practice we hope to not have gigabytes-long config strings.
|
||||
*/
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
#ifdef INT_MAX
|
||||
if ( ( (unsigned long long)len + (unsigned long long)ret ) >= (unsigned long long)INT_MAX ) {
|
||||
errno = ERANGE;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return (int)len + ret;
|
||||
return len + ret;
|
||||
}
|
||||
|
||||
/* lazy way to send a signal if the program uses the PIDPATH */
|
||||
|
@ -471,27 +275,7 @@ static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
|
|||
int ret;
|
||||
char buf[LARGEBUF];
|
||||
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wformat-nonliteral"
|
||||
#pragma clang diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
ret = vsnprintf(buf, sizeof(buf), fmt, va);
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
if ((ret < 0) || (ret >= (int) sizeof(buf)))
|
||||
syslog(LOG_WARNING, "vupslog: vsnprintf needed more than %d bytes",
|
||||
|
@ -501,7 +285,7 @@ static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
|
|||
snprintfcat(buf, sizeof(buf), ": %s", strerror(errno));
|
||||
|
||||
if (nut_debug_level > 0) {
|
||||
static struct timeval start = { 0, 0 };
|
||||
static struct timeval start = { 0 };
|
||||
struct timeval now;
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
|
@ -540,78 +324,29 @@ const char * dflt_statepath(void)
|
|||
{
|
||||
const char * path;
|
||||
|
||||
path = getenv("NUT_STATEPATH");
|
||||
if ( (path == NULL) || (*path == '\0') )
|
||||
if ((path = getenv("NUT_STATEPATH")) == NULL)
|
||||
path = STATEPATH;
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
/* Return the alternate path for pid files, for processes running as non-root
|
||||
* Per documentation and configure script, the fallback value is the
|
||||
* state-file path as the daemon and drivers can write there too.
|
||||
* Note that this differs from PIDPATH that higher-privileged daemons, such
|
||||
* as upsmon, tend to use.
|
||||
*/
|
||||
/* Return the alternate path for pid files */
|
||||
const char * altpidpath(void)
|
||||
{
|
||||
const char * path;
|
||||
|
||||
path = getenv("NUT_ALTPIDPATH");
|
||||
if ( (path == NULL) || (*path == '\0') )
|
||||
path = getenv("NUT_STATEPATH");
|
||||
|
||||
if ( (path != NULL) && (*path != '\0') )
|
||||
return path;
|
||||
|
||||
#ifdef ALTPIDPATH
|
||||
return ALTPIDPATH;
|
||||
#else
|
||||
/* We assume, here and elsewhere, that at least STATEPATH is always defined */
|
||||
return STATEPATH;
|
||||
return dflt_statepath();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Die with a standard message if socket filename is too long */
|
||||
void check_unix_socket_filename(const char *fn) {
|
||||
struct sockaddr_un ssaddr;
|
||||
if (strlen(fn) < sizeof(ssaddr.sun_path))
|
||||
return;
|
||||
|
||||
/* Avoid useless truncated pathnames that
|
||||
* other driver instances would conflict
|
||||
* with, and upsd can not discover.
|
||||
* Note this is quite short on many OSes
|
||||
* varying 104-108 bytes (UNIX_PATH_MAX)
|
||||
* as opposed to PATH_MAX or MAXPATHLEN
|
||||
* typically of a kilobyte range.
|
||||
*/
|
||||
fatalx(EXIT_FAILURE,
|
||||
"Can't create a unix domain socket: pathname '%s' "
|
||||
"is too long (%zu) for 'struct sockaddr_un->sun_path' "
|
||||
"on this system (%zu)",
|
||||
fn, strlen(fn), sizeof(ssaddr.sun_path));
|
||||
}
|
||||
|
||||
/* logs the formatted string to any configured logging devices + the output of strerror(errno) */
|
||||
void upslog_with_errno(int priority, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
|
||||
va_start(va, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vupslog(priority, fmt, va, 1);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
|
@ -621,115 +356,44 @@ void upslogx(int priority, const char *fmt, ...)
|
|||
va_list va;
|
||||
|
||||
va_start(va, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vupslog(priority, fmt, va, 0);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
void s_upsdebug_with_errno(int level, const char *fmt, ...)
|
||||
void upsdebug_with_errno(int level, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
char fmt2[LARGEBUF];
|
||||
|
||||
/* Note: Thanks to macro wrapping, we do not quite need this
|
||||
* test now, but we still need the "level" value to report
|
||||
* below - when it is not zero.
|
||||
*/
|
||||
if (nut_debug_level < level)
|
||||
return;
|
||||
|
||||
/* For debugging output, we want to prepend the debug level so the user can
|
||||
* e.g. lower the level (less -D's on command line) to retain just the amount
|
||||
* of logging info he needs to see at the moment. Using '-DDDDD' all the time
|
||||
* is too brutal and needed high-level overview can be lost. This [D#] prefix
|
||||
* can help limit this debug stream quicker, than experimentally picking ;) */
|
||||
if (level > 0) {
|
||||
int ret;
|
||||
ret = snprintf(fmt2, sizeof(fmt2), "[D%d] %s", level, fmt);
|
||||
if ((ret < 0) || (ret >= (int) sizeof(fmt2))) {
|
||||
syslog(LOG_WARNING, "upsdebug_with_errno: snprintf needed more than %d bytes",
|
||||
LARGEBUF);
|
||||
} else {
|
||||
fmt = (const char *)fmt2;
|
||||
}
|
||||
}
|
||||
|
||||
va_start(va, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vupslog(LOG_DEBUG, fmt, va, 1);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
void s_upsdebugx(int level, const char *fmt, ...)
|
||||
void upsdebugx(int level, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
char fmt2[LARGEBUF];
|
||||
|
||||
if (nut_debug_level < level)
|
||||
return;
|
||||
|
||||
/* See comments above in upsdebug_with_errno() - they apply here too. */
|
||||
if (level > 0) {
|
||||
int ret;
|
||||
ret = snprintf(fmt2, sizeof(fmt2), "[D%d] %s", level, fmt);
|
||||
if ((ret < 0) || (ret >= (int) sizeof(fmt2))) {
|
||||
syslog(LOG_WARNING, "upsdebugx: snprintf needed more than %d bytes",
|
||||
LARGEBUF);
|
||||
} else {
|
||||
fmt = (const char *)fmt2;
|
||||
}
|
||||
}
|
||||
|
||||
va_start(va, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vupslog(LOG_DEBUG, fmt, va, 0);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
/* dump message msg and len bytes from buf to upsdebugx(level) in
|
||||
hexadecimal. (This function replaces Philippe Marzouk's original
|
||||
dump_hex() function) */
|
||||
void s_upsdebug_hex(int level, const char *msg, const void *buf, size_t len)
|
||||
void upsdebug_hex(int level, const char *msg, const void *buf, int len)
|
||||
{
|
||||
char line[100];
|
||||
int n; /* number of characters currently in line */
|
||||
size_t i; /* number of bytes output from buffer */
|
||||
int i; /* number of bytes output from buffer */
|
||||
|
||||
n = snprintf(line, sizeof(line), "%s: (%zu bytes) =>", msg, len);
|
||||
if (n < 0) goto failed;
|
||||
n = snprintf(line, sizeof(line), "%s: (%d bytes) =>", msg, len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
|
||||
|
@ -739,86 +403,9 @@ void s_upsdebug_hex(int level, const char *msg, const void *buf, size_t len)
|
|||
}
|
||||
|
||||
n = snprintfcat(line, sizeof(line), n ? " %02x" : "%02x",
|
||||
((const unsigned char *)buf)[i]);
|
||||
|
||||
if (n < 0) goto failed;
|
||||
((unsigned char *)buf)[i]);
|
||||
}
|
||||
|
||||
s_upsdebugx(level, "%s", line);
|
||||
return;
|
||||
|
||||
failed:
|
||||
s_upsdebugx(level, "%s", "Failed to print a hex dump for debug");
|
||||
}
|
||||
|
||||
/* taken from www.asciitable.com */
|
||||
static const char* ascii_symb[] = {
|
||||
"NUL", /* 0x00 */
|
||||
"SOH", /* 0x01 */
|
||||
"STX", /* 0x02 */
|
||||
"ETX", /* 0x03 */
|
||||
"EOT", /* 0x04 */
|
||||
"ENQ", /* 0x05 */
|
||||
"ACK", /* 0x06 */
|
||||
"BEL", /* 0x07 */
|
||||
"BS", /* 0x08 */
|
||||
"TAB", /* 0x09 */
|
||||
"LF", /* 0x0A */
|
||||
"VT", /* 0x0B */
|
||||
"FF", /* 0x0C */
|
||||
"CR", /* 0x0D */
|
||||
"SO", /* 0x0E */
|
||||
"SI", /* 0x0F */
|
||||
"DLE", /* 0x10 */
|
||||
"DC1", /* 0x11 */
|
||||
"DC2", /* 0x12 */
|
||||
"DC3", /* 0x13 */
|
||||
"DC4", /* 0x14 */
|
||||
"NAK", /* 0x15 */
|
||||
"SYN", /* 0x16 */
|
||||
"ETB", /* 0x17 */
|
||||
"CAN", /* 0x18 */
|
||||
"EM", /* 0x19 */
|
||||
"SUB", /* 0x1A */
|
||||
"ESC", /* 0x1B */
|
||||
"FS", /* 0x1C */
|
||||
"GS", /* 0x1D */
|
||||
"RS", /* 0x1E */
|
||||
"US" /* 0x1F */
|
||||
};
|
||||
|
||||
/* dump message msg and len bytes from buf to upsdebugx(level) in ascii. */
|
||||
void s_upsdebug_ascii(int level, const char *msg, const void *buf, size_t len)
|
||||
{
|
||||
char line[256];
|
||||
int n; /* number of characters currently in line */
|
||||
size_t i; /* number of bytes output from buffer */
|
||||
unsigned char ch;
|
||||
|
||||
if (nut_debug_level < level)
|
||||
return; /* save cpu cycles */
|
||||
|
||||
n = snprintf(line, sizeof(line), "%s", msg);
|
||||
if (n < 0) goto failed;
|
||||
|
||||
for (i=0; i<len; ++i) {
|
||||
ch = ((const unsigned char *)buf)[i];
|
||||
|
||||
if (ch < 0x20)
|
||||
n = snprintfcat(line, sizeof(line), "%3s ", ascii_symb[ch]);
|
||||
else if (ch >= 0x80)
|
||||
n = snprintfcat(line, sizeof(line), "%02Xh ", ch);
|
||||
else
|
||||
n = snprintfcat(line, sizeof(line), "'%c' ", ch);
|
||||
|
||||
if (n < 0) goto failed;
|
||||
}
|
||||
|
||||
s_upsdebugx(level, "%s", line);
|
||||
return;
|
||||
|
||||
failed:
|
||||
s_upsdebugx(level, "%s", "Failed to print an ASCII data dump for debug");
|
||||
upsdebugx(level, "%s", line);
|
||||
}
|
||||
|
||||
static void vfatal(const char *fmt, va_list va, int use_strerror)
|
||||
|
@ -828,19 +415,7 @@ static void vfatal(const char *fmt, va_list va, int use_strerror)
|
|||
if (xbit_test(upslog_flags, UPSLOG_SYSLOG_ON_FATAL))
|
||||
xbit_set(&upslog_flags, UPSLOG_SYSLOG);
|
||||
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vupslog(LOG_ERR, fmt, va, use_strerror);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
void fatal_with_errno(int status, const char *fmt, ...)
|
||||
|
@ -848,19 +423,7 @@ void fatal_with_errno(int status, const char *fmt, ...)
|
|||
va_list va;
|
||||
|
||||
va_start(va, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vfatal(fmt, va, (errno > 0) ? 1 : 0);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(va);
|
||||
|
||||
exit(status);
|
||||
|
@ -871,19 +434,7 @@ void fatalx(int status, const char *fmt, ...)
|
|||
va_list va;
|
||||
|
||||
va_start(va, fmt);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_FORMAT_SECURITY
|
||||
#pragma GCC diagnostic ignored "-Wformat-security"
|
||||
#endif
|
||||
vfatal(fmt, va, 0);
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
va_end(va);
|
||||
|
||||
exit(status);
|
||||
|
@ -927,10 +478,23 @@ char *xstrdup(const char *string)
|
|||
return p;
|
||||
}
|
||||
|
||||
/* modify in - strip all trailing instances of <sep> */
|
||||
char *rtrim(char *in, const char sep)
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = &in[strlen(in) - 1];
|
||||
|
||||
while ((p >= in) && (*p == sep))
|
||||
*p-- = '\0';
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
/* Read up to buflen bytes from fd and return the number of bytes
|
||||
read. If no data is available within d_sec + d_usec, return 0.
|
||||
On error, a value < 0 is returned (errno indicates error). */
|
||||
ssize_t select_read(const int fd, void *buf, const size_t buflen, const time_t d_sec, const suseconds_t d_usec)
|
||||
int select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const long d_usec)
|
||||
{
|
||||
int ret;
|
||||
fd_set fds;
|
||||
|
@ -954,7 +518,7 @@ ssize_t select_read(const int fd, void *buf, const size_t buflen, const time_t d
|
|||
/* Write up to buflen bytes to fd and return the number of bytes
|
||||
written. If no data is available within d_sec + d_usec, return 0.
|
||||
On error, a value < 0 is returned (errno indicates error). */
|
||||
ssize_t select_write(const int fd, const void *buf, const size_t buflen, const time_t d_sec, const suseconds_t d_usec)
|
||||
int select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const long d_usec)
|
||||
{
|
||||
int ret;
|
||||
fd_set fds;
|
||||
|
@ -974,106 +538,3 @@ ssize_t select_write(const int fd, const void *buf, const size_t buflen, const t
|
|||
|
||||
return write(fd, buf, buflen);
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: would be good to get more from /etc/ld.so.conf[.d] and/or
|
||||
* LD_LIBRARY_PATH and a smarter dependency on build bitness; also
|
||||
* note that different OSes can have their pathnames set up differently
|
||||
* with regard to default/preferred bitness (maybe a "32" in the name
|
||||
* should also be searched explicitly - again, IFF our build is 32-bit).
|
||||
*
|
||||
* General premise for this solution is that some parts of NUT (e.g. the
|
||||
* nut-scanner tool, or DMF feature code) must be pre-built and distributed
|
||||
* in binary packages, but only at run-time it gets to know which third-party
|
||||
* libraries it should use for particular operations. This differs from e.g.
|
||||
* distribution packages which group NUT driver binaries explicitly dynamically
|
||||
* linked against certain OS-provided libraries for accessing this or that
|
||||
* communications media and/or vendor protocol.
|
||||
*/
|
||||
static const char * search_paths[] = {
|
||||
/* Use the library path (and bitness) provided during ./configure first */
|
||||
LIBDIR,
|
||||
"/usr"LIBDIR,
|
||||
"/usr/local"LIBDIR,
|
||||
#ifdef BUILD_64
|
||||
/* Fall back to explicit preference of 64-bit paths as named on some OSes */
|
||||
"/usr/lib/64",
|
||||
"/usr/lib64",
|
||||
#endif
|
||||
"/usr/lib",
|
||||
#ifdef BUILD_64
|
||||
"/lib/64",
|
||||
"/lib64",
|
||||
#endif
|
||||
"/lib",
|
||||
#ifdef BUILD_64
|
||||
"/usr/local/lib/64",
|
||||
"/usr/local/lib64",
|
||||
#endif
|
||||
"/usr/local/lib",
|
||||
#ifdef AUTOTOOLS_TARGET_SHORT_ALIAS
|
||||
"/usr/lib/" AUTOTOOLS_TARGET_SHORT_ALIAS,
|
||||
"/usr/lib/gcc/" AUTOTOOLS_TARGET_SHORT_ALIAS,
|
||||
#else
|
||||
# ifdef AUTOTOOLS_HOST_SHORT_ALIAS
|
||||
"/usr/lib/" AUTOTOOLS_HOST_SHORT_ALIAS,
|
||||
"/usr/lib/gcc/" AUTOTOOLS_HOST_SHORT_ALIAS,
|
||||
# else
|
||||
# ifdef AUTOTOOLS_BUILD_SHORT_ALIAS
|
||||
"/usr/lib/" AUTOTOOLS_BUILD_SHORT_ALIAS,
|
||||
"/usr/lib/gcc/" AUTOTOOLS_BUILD_SHORT_ALIAS,
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifdef AUTOTOOLS_TARGET_ALIAS
|
||||
"/usr/lib/" AUTOTOOLS_TARGET_ALIAS,
|
||||
"/usr/lib/gcc/" AUTOTOOLS_TARGET_ALIAS,
|
||||
#else
|
||||
# ifdef AUTOTOOLS_HOST_ALIAS
|
||||
"/usr/lib/" AUTOTOOLS_HOST_ALIAS,
|
||||
"/usr/lib/gcc/" AUTOTOOLS_HOST_ALIAS,
|
||||
# else
|
||||
# ifdef AUTOTOOLS_BUILD_ALIAS
|
||||
"/usr/lib/" AUTOTOOLS_BUILD_ALIAS,
|
||||
"/usr/lib/gcc/" AUTOTOOLS_BUILD_ALIAS,
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
char * get_libname(const char* base_libname)
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *dirp;
|
||||
int index = 0;
|
||||
char *libname_path = NULL;
|
||||
char current_test_path[LARGEBUF];
|
||||
size_t base_libname_length = strlen(base_libname);
|
||||
|
||||
for(index = 0 ; (search_paths[index] != NULL) && (libname_path == NULL) ; index++)
|
||||
{
|
||||
memset(current_test_path, 0, LARGEBUF);
|
||||
|
||||
if ((dp = opendir(search_paths[index])) == NULL)
|
||||
continue;
|
||||
|
||||
upsdebugx(2,"Looking for lib %s in directory #%d : %s", base_libname, index, search_paths[index]);
|
||||
while ((dirp = readdir(dp)) != NULL)
|
||||
{
|
||||
upsdebugx(5,"Comparing lib %s with dirpath %s", base_libname, dirp->d_name);
|
||||
int compres = strncmp(dirp->d_name, base_libname, base_libname_length);
|
||||
if(compres == 0) {
|
||||
snprintf(current_test_path, LARGEBUF, "%s/%s", search_paths[index], dirp->d_name);
|
||||
libname_path = realpath(current_test_path, NULL);
|
||||
upsdebugx(2,"Candidate path for lib %s is %s (realpath %s)", base_libname, current_test_path, (libname_path!=NULL)?libname_path:"NULL");
|
||||
if (libname_path != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
closedir(dp);
|
||||
}
|
||||
|
||||
upsdebugx(1,"Looking for lib %s, found %s", base_libname, (libname_path!=NULL)?libname_path:"NULL");
|
||||
return libname_path;
|
||||
}
|
||||
|
|
|
@ -76,8 +76,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
@ -85,11 +83,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "parseconf.h"
|
||||
#include "attribute.h"
|
||||
#include "nut_stdint.h"
|
||||
|
||||
/* possible states */
|
||||
|
||||
|
@ -102,9 +97,6 @@
|
|||
#define STATE_ENDOFLINE 7
|
||||
#define STATE_PARSEERR 8
|
||||
|
||||
static void pconf_fatal(PCONF_CTX_t *ctx, const char *errtxt)
|
||||
__attribute__((noreturn));
|
||||
|
||||
static void pconf_fatal(PCONF_CTX_t *ctx, const char *errtxt)
|
||||
{
|
||||
if (ctx->errhandler)
|
||||
|
@ -117,7 +109,7 @@ static void pconf_fatal(PCONF_CTX_t *ctx, const char *errtxt)
|
|||
|
||||
static void add_arg_word(PCONF_CTX_t *ctx)
|
||||
{
|
||||
size_t argpos;
|
||||
int argpos;
|
||||
size_t wbuflen;
|
||||
|
||||
/* this is where the new value goes */
|
||||
|
@ -137,7 +129,7 @@ static void add_arg_word(PCONF_CTX_t *ctx)
|
|||
pconf_fatal(ctx, "realloc arglist failed");
|
||||
|
||||
ctx->argsize = realloc(ctx->argsize,
|
||||
sizeof(size_t) * ctx->numargs);
|
||||
sizeof(int *) * ctx->numargs);
|
||||
|
||||
if (!ctx->argsize)
|
||||
pconf_fatal(ctx, "realloc argsize failed");
|
||||
|
@ -179,13 +171,6 @@ static void addchar(PCONF_CTX_t *ctx)
|
|||
|
||||
wbuflen = strlen(ctx->wordbuf);
|
||||
|
||||
/* CVE-2012-2944: only allow the subset of ASCII charset from Space to ~ */
|
||||
if ((ctx->ch < 0x20) || (ctx->ch > 0x7f)) {
|
||||
fprintf(stderr, "addchar: discarding invalid character (0x%02x)!\n",
|
||||
ctx->ch);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->wordlen_limit != 0) {
|
||||
if (wbuflen >= ctx->wordlen_limit) {
|
||||
|
||||
|
@ -207,7 +192,7 @@ static void addchar(PCONF_CTX_t *ctx)
|
|||
ctx->wordptr = &ctx->wordbuf[wbuflen];
|
||||
}
|
||||
|
||||
*ctx->wordptr++ = (char)ctx->ch;
|
||||
*ctx->wordptr++ = ctx->ch;
|
||||
*ctx->wordptr = '\0';
|
||||
}
|
||||
|
||||
|
@ -242,7 +227,7 @@ static int findwordstart(PCONF_CTX_t *ctx)
|
|||
return STATE_FINDEOL;
|
||||
|
||||
/* space = not in a word yet, so loop back */
|
||||
if (isspace((size_t)ctx->ch))
|
||||
if (isspace(ctx->ch))
|
||||
return STATE_FINDWORDSTART;
|
||||
|
||||
/* \ = literal = accept the next char blindly */
|
||||
|
@ -255,13 +240,6 @@ static int findwordstart(PCONF_CTX_t *ctx)
|
|||
|
||||
/* at this point the word just started */
|
||||
addchar(ctx);
|
||||
|
||||
/* if the first character is a '=' this is considered a whole word */
|
||||
if (ctx->ch == '=') {
|
||||
endofword(ctx);
|
||||
return STATE_FINDWORDSTART;
|
||||
}
|
||||
|
||||
return STATE_COLLECT;
|
||||
}
|
||||
|
||||
|
@ -342,20 +320,12 @@ static int collect(PCONF_CTX_t *ctx)
|
|||
}
|
||||
|
||||
/* space means the word is done */
|
||||
if (isspace((size_t)ctx->ch)) {
|
||||
if (isspace(ctx->ch)) {
|
||||
endofword(ctx);
|
||||
|
||||
return STATE_FINDWORDSTART;
|
||||
}
|
||||
|
||||
/* '=' means the word is done and the = is a single char word*/
|
||||
if (ctx->ch == '=') {
|
||||
endofword(ctx);
|
||||
findwordstart(ctx);
|
||||
|
||||
return STATE_FINDWORDSTART;
|
||||
}
|
||||
|
||||
/* \ = literal = accept the next char blindly */
|
||||
if (ctx->ch == '\\')
|
||||
return STATE_COLLECTLITERAL;
|
||||
|
@ -451,9 +421,6 @@ int pconf_file_begin(PCONF_CTX_t *ctx, const char *fn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* prevent fd leaking to child processes */
|
||||
fcntl(fileno(ctx->f), F_SETFD, FD_CLOEXEC);
|
||||
|
||||
return 1; /* OK */
|
||||
}
|
||||
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/* setenv.c Ben Collver <collver@softhome.net> */
|
||||
#ifndef HAVE_SETENV
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "common.h"
|
||||
|
||||
int nut_setenv(const char *name, const char *value, int overwrite)
|
||||
{
|
||||
char *val;
|
||||
char *buffer;
|
||||
int rv;
|
||||
|
||||
if (overwrite == 0) {
|
||||
val = getenv(name);
|
||||
if (val != NULL) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
buffer = xmalloc(strlen(value) + strlen(name) + 2);
|
||||
strcpy(buffer, name);
|
||||
strcat(buffer, "=");
|
||||
strcat(buffer, value);
|
||||
rv = putenv(buffer); /* man putenv, do not free(buffer) */
|
||||
return (rv);
|
||||
}
|
||||
#endif
|
|
@ -1,965 +0,0 @@
|
|||
/*
|
||||
* Copyright Patrick Powell 1995
|
||||
* This code is based on code written by Patrick Powell (papowell@astart.com)
|
||||
* It may be used for any purpose as long as this notice remains intact
|
||||
* on all source code distributions
|
||||
*/
|
||||
|
||||
/**************************************************************
|
||||
* Original:
|
||||
* Patrick Powell Tue Apr 11 09:48:21 PDT 1995
|
||||
* A bombproof version of doprnt (dopr) included.
|
||||
* Sigh. This sort of thing is always nasty do deal with. Note that
|
||||
* the version here does not include floating point...
|
||||
*
|
||||
* snprintf() is used instead of sprintf() as it does limit checks
|
||||
* for string length. This covers a nasty loophole.
|
||||
*
|
||||
* The other functions are there to prevent NULL pointers from
|
||||
* causing nast effects.
|
||||
*
|
||||
* More Recently:
|
||||
* Brandon Long <blong@fiction.net> 9/15/96 for mutt 0.43
|
||||
* This was ugly. It is still ugly. I opted out of floating point
|
||||
* numbers, but the formatter understands just about everything
|
||||
* from the normal C string format, at least as far as I can tell from
|
||||
* the Solaris 2.5 printf(3S) man page.
|
||||
*
|
||||
* Brandon Long <blong@fiction.net> 10/22/97 for mutt 0.87.1
|
||||
* Ok, added some minimal floating point support, which means this
|
||||
* probably requires libm on most operating systems. Don't yet
|
||||
* support the exponent (e,E) and sigfig (g,G). Also, fmtint()
|
||||
* was pretty badly broken, it just wasn't being exercised in ways
|
||||
* which showed it, so that's been fixed. Also, formated the code
|
||||
* to mutt conventions, and removed dead code left over from the
|
||||
* original. Also, there is now a builtin-test, just compile with:
|
||||
* gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
|
||||
* and run snprintf for results.
|
||||
*
|
||||
* Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
|
||||
* The PGP code was using unsigned hexadecimal formats.
|
||||
* Unfortunately, unsigned formats simply didn't work.
|
||||
*
|
||||
* Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
|
||||
* The original code assumed that both snprintf() and vsnprintf() were
|
||||
* missing. Some systems only have snprintf() but not vsnprintf(), so
|
||||
* the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF.
|
||||
*
|
||||
* Andrew Tridgell (tridge@samba.org) Oct 1998
|
||||
* fixed handling of %.0f
|
||||
* added test for HAVE_LONG_DOUBLE
|
||||
*
|
||||
**************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||
|
||||
/* Define this as a fall through, HAVE_STDARG_H is probably already set */
|
||||
|
||||
#ifndef HAVE_VARARGS_H
|
||||
#define HAVE_VARARGS_H
|
||||
#endif
|
||||
|
||||
/* varargs declarations: */
|
||||
|
||||
#if defined(HAVE_STDARG_H)
|
||||
# include <stdarg.h>
|
||||
# define HAVE_STDARGS /* let's hope that works everywhere (mj) */
|
||||
# define VA_LOCAL_DECL va_list ap
|
||||
# define VA_START(f) va_start(ap, f)
|
||||
# define VA_SHIFT(v,t) ; /* no-op for ANSI */
|
||||
# define VA_END va_end(ap)
|
||||
#else
|
||||
# if defined(HAVE_VARARGS_H)
|
||||
# include <varargs.h>
|
||||
# undef HAVE_STDARGS
|
||||
# define VA_LOCAL_DECL va_list ap
|
||||
# define VA_START(f) va_start(ap) /* f is ignored! */
|
||||
# define VA_SHIFT(v,t) v = va_arg(ap,t)
|
||||
# define VA_END va_end(ap)
|
||||
# else
|
||||
/*XX ** NO VARARGS ** XX*/
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LONG_DOUBLE
|
||||
#define LDOUBLE long double
|
||||
#else
|
||||
#define LDOUBLE double
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LONG_LONG_INT
|
||||
#define LLONG long long
|
||||
#else
|
||||
#define LLONG long
|
||||
#endif
|
||||
|
||||
/*int snprintf (char *str, size_t count, const char *fmt, ...);*/
|
||||
/*int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);*/
|
||||
|
||||
static void dopr (char *buffer, size_t maxlen, const char *format,
|
||||
va_list args);
|
||||
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
||||
char *value, int flags, int min, int max);
|
||||
static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||
long value, int base, int min, int max, int flags);
|
||||
static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||
LDOUBLE fvalue, int min, int max, int flags);
|
||||
static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c );
|
||||
|
||||
/*
|
||||
* dopr(): poor man's version of doprintf
|
||||
*/
|
||||
|
||||
/* format read states */
|
||||
#define DP_S_DEFAULT 0
|
||||
#define DP_S_FLAGS 1
|
||||
#define DP_S_MIN 2
|
||||
#define DP_S_DOT 3
|
||||
#define DP_S_MAX 4
|
||||
#define DP_S_MOD 5
|
||||
#define DP_S_CONV 6
|
||||
#define DP_S_DONE 7
|
||||
|
||||
/* format flags - Bits */
|
||||
#define DP_F_MINUS (1 << 0)
|
||||
#define DP_F_PLUS (1 << 1)
|
||||
#define DP_F_SPACE (1 << 2)
|
||||
#define DP_F_NUM (1 << 3)
|
||||
#define DP_F_ZERO (1 << 4)
|
||||
#define DP_F_UP (1 << 5)
|
||||
#define DP_F_UNSIGNED (1 << 6)
|
||||
|
||||
/* Conversion Flags */
|
||||
#define DP_C_SHORT 1
|
||||
/* Note: Originally DP_C_SHORT converted to "short int" types, but modernish
|
||||
* (C99+ or even earlier) standards require that the minimal type passed
|
||||
* through variadic args '...' is an int, and smaller types are padded up
|
||||
* to it - so value shifts in memory and erroneous access crashes can occur
|
||||
* if smaller data is accessed blindly. Code below has been fixed to not pass
|
||||
* "short int" anymore - it just casts the int to desired smaller type (and
|
||||
* so drops the padding bits). */
|
||||
#define DP_C_LONG 2
|
||||
#define DP_C_LDOUBLE 3
|
||||
#define DP_C_LLONG 4
|
||||
|
||||
#ifdef C89PLUS
|
||||
#undef C89PLUS
|
||||
#endif
|
||||
|
||||
#if defined(__STDC__) || defined(__STDC_VERSION__)
|
||||
/* C89+ and C90+ code respectively */
|
||||
#define C89PLUS 1
|
||||
#endif
|
||||
|
||||
#define char_to_int(p) ((p)- '0')
|
||||
#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
|
||||
|
||||
static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||
{
|
||||
char ch;
|
||||
LLONG value;
|
||||
LDOUBLE fvalue;
|
||||
char *strvalue;
|
||||
int min;
|
||||
int max;
|
||||
int state;
|
||||
int flags;
|
||||
int cflags;
|
||||
size_t currlen;
|
||||
|
||||
state = DP_S_DEFAULT;
|
||||
currlen = flags = cflags = min = 0;
|
||||
max = -1;
|
||||
ch = *format++;
|
||||
|
||||
while (state != DP_S_DONE)
|
||||
{
|
||||
if ((ch == '\0') || (currlen >= maxlen))
|
||||
state = DP_S_DONE;
|
||||
|
||||
switch(state)
|
||||
{
|
||||
case DP_S_DEFAULT:
|
||||
if (ch == '%')
|
||||
state = DP_S_FLAGS;
|
||||
else
|
||||
dopr_outch (buffer, &currlen, maxlen, ch);
|
||||
ch = *format++;
|
||||
break;
|
||||
case DP_S_FLAGS:
|
||||
switch (ch)
|
||||
{
|
||||
case '-':
|
||||
flags |= DP_F_MINUS;
|
||||
ch = *format++;
|
||||
break;
|
||||
case '+':
|
||||
flags |= DP_F_PLUS;
|
||||
ch = *format++;
|
||||
break;
|
||||
case ' ':
|
||||
flags |= DP_F_SPACE;
|
||||
ch = *format++;
|
||||
break;
|
||||
case '#':
|
||||
flags |= DP_F_NUM;
|
||||
ch = *format++;
|
||||
break;
|
||||
case '0':
|
||||
flags |= DP_F_ZERO;
|
||||
ch = *format++;
|
||||
break;
|
||||
default:
|
||||
state = DP_S_MIN;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DP_S_MIN:
|
||||
if (isdigit((unsigned char)ch))
|
||||
{
|
||||
min = 10*min + char_to_int (ch);
|
||||
ch = *format++;
|
||||
}
|
||||
else if (ch == '*')
|
||||
{
|
||||
min = va_arg (args, int);
|
||||
ch = *format++;
|
||||
state = DP_S_DOT;
|
||||
}
|
||||
else
|
||||
state = DP_S_DOT;
|
||||
break;
|
||||
case DP_S_DOT:
|
||||
if (ch == '.')
|
||||
{
|
||||
state = DP_S_MAX;
|
||||
ch = *format++;
|
||||
}
|
||||
else
|
||||
state = DP_S_MOD;
|
||||
break;
|
||||
case DP_S_MAX:
|
||||
if (isdigit((unsigned char)ch))
|
||||
{
|
||||
if (max < 0)
|
||||
max = 0;
|
||||
max = 10*max + char_to_int (ch);
|
||||
ch = *format++;
|
||||
}
|
||||
else if (ch == '*')
|
||||
{
|
||||
max = va_arg (args, int);
|
||||
ch = *format++;
|
||||
state = DP_S_MOD;
|
||||
}
|
||||
else
|
||||
state = DP_S_MOD;
|
||||
break;
|
||||
case DP_S_MOD:
|
||||
switch (ch)
|
||||
{
|
||||
case 'h':
|
||||
cflags = DP_C_SHORT;
|
||||
ch = *format++;
|
||||
break;
|
||||
case 'l':
|
||||
cflags = DP_C_LONG;
|
||||
ch = *format++;
|
||||
if (ch == 'l') { /* It's a long long */
|
||||
cflags = DP_C_LLONG;
|
||||
ch = *format++;
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
cflags = DP_C_LDOUBLE;
|
||||
ch = *format++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
state = DP_S_CONV;
|
||||
break;
|
||||
case DP_S_CONV:
|
||||
switch (ch)
|
||||
{
|
||||
case 'd':
|
||||
case 'i':
|
||||
if (cflags == DP_C_SHORT)
|
||||
#ifdef C89PLUS
|
||||
value = (short int)va_arg (args, int);
|
||||
#else
|
||||
value = va_arg (args, short int);
|
||||
#endif
|
||||
else if (cflags == DP_C_LONG)
|
||||
value = va_arg (args, long int);
|
||||
else if (cflags == DP_C_LLONG)
|
||||
value = va_arg (args, LLONG);
|
||||
else
|
||||
value = va_arg (args, int);
|
||||
fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
|
||||
break;
|
||||
case 'o':
|
||||
flags |= DP_F_UNSIGNED;
|
||||
if (cflags == DP_C_SHORT)
|
||||
#ifdef C89PLUS
|
||||
value = (unsigned short int)va_arg (args, unsigned int);
|
||||
#else
|
||||
value = va_arg (args, unsigned short int);
|
||||
#endif
|
||||
else if (cflags == DP_C_LONG)
|
||||
value = (long)va_arg (args, unsigned long int);
|
||||
else if (cflags == DP_C_LLONG)
|
||||
value = (long)va_arg (args, unsigned LLONG);
|
||||
else
|
||||
value = (long)va_arg (args, unsigned int);
|
||||
fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags);
|
||||
break;
|
||||
case 'u':
|
||||
flags |= DP_F_UNSIGNED;
|
||||
if (cflags == DP_C_SHORT)
|
||||
#ifdef C89PLUS
|
||||
value = (unsigned short int)va_arg (args, unsigned int);
|
||||
#else
|
||||
value = va_arg (args, unsigned short int);
|
||||
#endif
|
||||
else if (cflags == DP_C_LONG)
|
||||
value = (long)va_arg (args, unsigned long int);
|
||||
else if (cflags == DP_C_LLONG)
|
||||
value = (LLONG)va_arg (args, unsigned LLONG);
|
||||
else
|
||||
value = (long)va_arg (args, unsigned int);
|
||||
fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
|
||||
break;
|
||||
case 'X':
|
||||
flags |= DP_F_UP;
|
||||
goto fallthrough_case_x;
|
||||
case 'x':
|
||||
fallthrough_case_x:
|
||||
flags |= DP_F_UNSIGNED;
|
||||
if (cflags == DP_C_SHORT)
|
||||
#ifdef C89PLUS
|
||||
value = (unsigned short int)va_arg (args, unsigned int);
|
||||
#else
|
||||
value = va_arg (args, unsigned short int);
|
||||
#endif
|
||||
else if (cflags == DP_C_LONG)
|
||||
value = (long)va_arg (args, unsigned long int);
|
||||
else if (cflags == DP_C_LLONG)
|
||||
value = (LLONG)va_arg (args, unsigned LLONG);
|
||||
else
|
||||
value = (long)va_arg (args, unsigned int);
|
||||
fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags);
|
||||
break;
|
||||
case 'f':
|
||||
if (cflags == DP_C_LDOUBLE)
|
||||
fvalue = va_arg (args, LDOUBLE);
|
||||
else
|
||||
fvalue = va_arg (args, double);
|
||||
/* um, floating point? */
|
||||
fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
|
||||
break;
|
||||
case 'E':
|
||||
flags |= DP_F_UP;
|
||||
goto fallthrough_case_e;
|
||||
case 'e':
|
||||
fallthrough_case_e:
|
||||
if (cflags == DP_C_LDOUBLE)
|
||||
fvalue = va_arg (args, LDOUBLE);
|
||||
else
|
||||
fvalue = va_arg (args, double);
|
||||
break;
|
||||
case 'G':
|
||||
flags |= DP_F_UP;
|
||||
goto fallthrough_case_g;
|
||||
case 'g':
|
||||
fallthrough_case_g:
|
||||
if (cflags == DP_C_LDOUBLE)
|
||||
fvalue = va_arg (args, LDOUBLE);
|
||||
else
|
||||
fvalue = va_arg (args, double);
|
||||
break;
|
||||
case 'c':
|
||||
dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
|
||||
break;
|
||||
case 's':
|
||||
strvalue = va_arg (args, char *);
|
||||
if (max < 0)
|
||||
max = maxlen; /* ie, no max */
|
||||
fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
|
||||
break;
|
||||
case 'p':
|
||||
strvalue = va_arg (args, void *);
|
||||
fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
|
||||
break;
|
||||
case 'n':
|
||||
if (cflags == DP_C_SHORT)
|
||||
{
|
||||
short int *num;
|
||||
num = va_arg (args, short int *);
|
||||
*num = currlen;
|
||||
}
|
||||
else if (cflags == DP_C_LONG)
|
||||
{
|
||||
long int *num;
|
||||
num = va_arg (args, long int *);
|
||||
*num = (long int)currlen;
|
||||
}
|
||||
else if (cflags == DP_C_LLONG)
|
||||
{
|
||||
LLONG *num;
|
||||
num = va_arg (args, LLONG *);
|
||||
*num = (LLONG)currlen;
|
||||
}
|
||||
else
|
||||
{
|
||||
int *num;
|
||||
num = va_arg (args, int *);
|
||||
*num = currlen;
|
||||
}
|
||||
break;
|
||||
case '%':
|
||||
dopr_outch (buffer, &currlen, maxlen, ch);
|
||||
break;
|
||||
case 'w':
|
||||
/* not supported yet, treat as next char */
|
||||
ch = *format++;
|
||||
break;
|
||||
default:
|
||||
/* Unknown, skip */
|
||||
break;
|
||||
}
|
||||
ch = *format++;
|
||||
state = DP_S_DEFAULT;
|
||||
flags = cflags = min = 0;
|
||||
max = -1;
|
||||
break;
|
||||
case DP_S_DONE:
|
||||
break;
|
||||
default:
|
||||
/* hmm? */
|
||||
break; /* some picky compilers need this */
|
||||
}
|
||||
}
|
||||
if (currlen < maxlen - 1)
|
||||
buffer[currlen] = '\0';
|
||||
else
|
||||
buffer[maxlen - 1] = '\0';
|
||||
}
|
||||
|
||||
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
||||
char *value, int flags, int min, int max)
|
||||
{
|
||||
int padlen, strln; /* amount to pad */
|
||||
int cnt = 0;
|
||||
|
||||
if (value == 0)
|
||||
{
|
||||
value = "<NULL>";
|
||||
}
|
||||
|
||||
for (strln = 0; value[strln]; ++strln); /* strlen */
|
||||
padlen = min - strln;
|
||||
if (padlen < 0)
|
||||
padlen = 0;
|
||||
if (flags & DP_F_MINUS)
|
||||
padlen = -padlen; /* Left Justify */
|
||||
|
||||
while ((padlen > 0) && (cnt < max))
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||
--padlen;
|
||||
++cnt;
|
||||
}
|
||||
while (*value && (cnt < max))
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, *value++);
|
||||
++cnt;
|
||||
}
|
||||
while ((padlen < 0) && (cnt < max))
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||
++padlen;
|
||||
++cnt;
|
||||
}
|
||||
}
|
||||
|
||||
/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
|
||||
|
||||
static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||
long value, int base, int min, int max, int flags)
|
||||
{
|
||||
int signvalue = 0;
|
||||
unsigned long uvalue;
|
||||
char convert[20];
|
||||
int place = 0;
|
||||
int spadlen = 0; /* amount to space pad */
|
||||
int zpadlen = 0; /* amount to zero pad */
|
||||
int caps = 0;
|
||||
|
||||
if (max < 0)
|
||||
max = 0;
|
||||
|
||||
uvalue = value;
|
||||
|
||||
if(!(flags & DP_F_UNSIGNED))
|
||||
{
|
||||
if( value < 0 ) {
|
||||
signvalue = '-';
|
||||
uvalue = -value;
|
||||
}
|
||||
else
|
||||
if (flags & DP_F_PLUS) /* Do a sign (+/i) */
|
||||
signvalue = '+';
|
||||
else
|
||||
if (flags & DP_F_SPACE)
|
||||
signvalue = ' ';
|
||||
}
|
||||
|
||||
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
||||
|
||||
do {
|
||||
convert[place++] =
|
||||
(caps? "0123456789ABCDEF":"0123456789abcdef")
|
||||
[uvalue % (unsigned)base ];
|
||||
uvalue = (uvalue / (unsigned)base );
|
||||
} while(uvalue && (place < 20));
|
||||
if (place == 20) place--;
|
||||
convert[place] = 0;
|
||||
|
||||
zpadlen = max - place;
|
||||
spadlen = min - MAX (max, place) - (signvalue ? 1 : 0);
|
||||
if (zpadlen < 0) zpadlen = 0;
|
||||
if (spadlen < 0) spadlen = 0;
|
||||
if (flags & DP_F_ZERO)
|
||||
{
|
||||
zpadlen = MAX(zpadlen, spadlen);
|
||||
spadlen = 0;
|
||||
}
|
||||
if (flags & DP_F_MINUS)
|
||||
spadlen = -spadlen; /* Left Justifty */
|
||||
|
||||
#ifdef DEBUG_SNPRINTF
|
||||
printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
|
||||
zpadlen, spadlen, min, max, place);
|
||||
#endif
|
||||
|
||||
/* Spaces */
|
||||
while (spadlen > 0)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||
--spadlen;
|
||||
}
|
||||
|
||||
/* Sign */
|
||||
if (signvalue)
|
||||
dopr_outch (buffer, currlen, maxlen, signvalue);
|
||||
|
||||
/* Zeros */
|
||||
if (zpadlen > 0)
|
||||
{
|
||||
while (zpadlen > 0)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, '0');
|
||||
--zpadlen;
|
||||
}
|
||||
}
|
||||
|
||||
/* Digits */
|
||||
while (place > 0)
|
||||
dopr_outch (buffer, currlen, maxlen, convert[--place]);
|
||||
|
||||
/* Left Justified spaces */
|
||||
while (spadlen < 0) {
|
||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||
++spadlen;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef HAVE_ABS_VAL
|
||||
static LDOUBLE abs_val (LDOUBLE value)
|
||||
{
|
||||
LDOUBLE result = value;
|
||||
|
||||
if (value < 0)
|
||||
result = -value;
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FCVT
|
||||
/* The two routines that may get defined below are only used if we also don't
|
||||
* have a fcvt() in the system. Defining and not using the routines may be a
|
||||
* warning (fatal with -Werror), so we hide them here. */
|
||||
# ifndef HAVE_POW10
|
||||
static LDOUBLE pow10 (int exp)
|
||||
{
|
||||
LDOUBLE result = 1;
|
||||
|
||||
while (exp)
|
||||
{
|
||||
result *= 10;
|
||||
exp--;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_ROUND
|
||||
static long round (LDOUBLE value)
|
||||
{
|
||||
long intpart;
|
||||
|
||||
intpart = (long)value;
|
||||
value = value - intpart;
|
||||
if (value >= 0.5)
|
||||
intpart++;
|
||||
|
||||
return intpart;
|
||||
}
|
||||
# endif
|
||||
#endif /* HAVE_FCVT */
|
||||
|
||||
static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||
LDOUBLE fvalue, int min, int max, int flags)
|
||||
{
|
||||
int signvalue = 0;
|
||||
LDOUBLE ufvalue;
|
||||
#ifndef HAVE_FCVT
|
||||
char iconvert[20];
|
||||
char fconvert[20];
|
||||
#else
|
||||
char iconvert[311];
|
||||
char fconvert[311];
|
||||
char *result;
|
||||
int dec_pt, sig;
|
||||
int r_length;
|
||||
# ifdef HAVE_FCVTL
|
||||
extern char *fcvtl(long double value, int ndigit, int *decpt, int *sign);
|
||||
# else
|
||||
extern char *fcvt(double value, int ndigit, int *decpt, int *sign);
|
||||
# endif
|
||||
#endif
|
||||
int iplace = 0;
|
||||
int fplace = 0;
|
||||
int padlen = 0; /* amount to pad */
|
||||
int zpadlen = 0;
|
||||
#ifndef HAVE_FCVT
|
||||
int caps = 0;
|
||||
long intpart;
|
||||
long fracpart;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AIX manpage says the default is 0, but Solaris says the default
|
||||
* is 6, and sprintf on AIX defaults to 6
|
||||
*/
|
||||
if (max < 0)
|
||||
max = 6;
|
||||
|
||||
ufvalue = abs_val (fvalue);
|
||||
|
||||
if (fvalue < 0)
|
||||
signvalue = '-';
|
||||
else
|
||||
if (flags & DP_F_PLUS) /* Do a sign (+/i) */
|
||||
signvalue = '+';
|
||||
else
|
||||
if (flags & DP_F_SPACE)
|
||||
signvalue = ' ';
|
||||
|
||||
#if 0
|
||||
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FCVT
|
||||
intpart = (long)ufvalue;
|
||||
|
||||
/*
|
||||
* Sorry, we only support 9 digits past the decimal because of our
|
||||
* conversion method
|
||||
*/
|
||||
if (max > 9)
|
||||
max = 9;
|
||||
|
||||
/* We "cheat" by converting the fractional part to integer by
|
||||
* multiplying by a factor of 10
|
||||
*/
|
||||
fracpart = round ((pow10 (max)) * (ufvalue - intpart));
|
||||
|
||||
if (fracpart >= pow10 (max))
|
||||
{
|
||||
intpart++;
|
||||
fracpart -= pow10 (max);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SNPRINTF
|
||||
printf("fmtfp: %g %d.%d min=%d max=%d\n",
|
||||
(double)fvalue, intpart, fracpart, min, max);
|
||||
#endif
|
||||
|
||||
/* Convert integer part */
|
||||
do {
|
||||
iconvert[iplace++] =
|
||||
(caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10];
|
||||
intpart = (intpart / 10);
|
||||
} while(intpart && (iplace < 20));
|
||||
if (iplace == 20) iplace--;
|
||||
iconvert[iplace] = 0;
|
||||
|
||||
/* Convert fractional part */
|
||||
do {
|
||||
fconvert[fplace++] =
|
||||
(caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10];
|
||||
fracpart = (fracpart / 10);
|
||||
} while(fracpart && (fplace < 20));
|
||||
if (fplace == 20) fplace--;
|
||||
fconvert[fplace] = 0;
|
||||
#else /* use fcvt() */
|
||||
if (max > 310)
|
||||
max = 310;
|
||||
# ifdef HAVE_FCVTL
|
||||
result = fcvtl(ufvalue, max, &dec_pt, &sig);
|
||||
# else
|
||||
result = fcvt(ufvalue, max, &dec_pt, &sig);
|
||||
# endif
|
||||
|
||||
r_length = strlen(result);
|
||||
|
||||
/*
|
||||
* Fix broken fcvt implementation returns..
|
||||
*/
|
||||
|
||||
if (r_length == 0)
|
||||
{
|
||||
result[0] = '0';
|
||||
result[1] = '\0';
|
||||
r_length = 1;
|
||||
}
|
||||
|
||||
if ( r_length < dec_pt )
|
||||
dec_pt = r_length;
|
||||
|
||||
if (dec_pt <= 0) {
|
||||
iplace = 1;
|
||||
iconvert[0] = '0';
|
||||
iconvert[1] = '\0';
|
||||
|
||||
fplace = 0;
|
||||
|
||||
while(r_length)
|
||||
fconvert[fplace++] = result[--r_length];
|
||||
|
||||
while ((dec_pt < 0) && (fplace < max)) {
|
||||
fconvert[fplace++] = '0';
|
||||
dec_pt++;
|
||||
}
|
||||
} else {
|
||||
int c;
|
||||
|
||||
iplace=0;
|
||||
for(c=dec_pt; c; iconvert[iplace++] = result[--c])
|
||||
;
|
||||
iconvert[iplace] = '\0';
|
||||
|
||||
result += dec_pt;
|
||||
fplace = 0;
|
||||
|
||||
for(c=(r_length-dec_pt); c; fconvert[fplace++] = result[--c])
|
||||
;
|
||||
}
|
||||
#endif /* fcvt */
|
||||
|
||||
/* -1 for decimal point, another -1 if we are printing a sign */
|
||||
padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
|
||||
zpadlen = max - fplace;
|
||||
if (zpadlen < 0)
|
||||
zpadlen = 0;
|
||||
if (padlen < 0)
|
||||
padlen = 0;
|
||||
if (flags & DP_F_MINUS)
|
||||
padlen = -padlen; /* Left Justifty */
|
||||
|
||||
if ((flags & DP_F_ZERO) && (padlen > 0))
|
||||
{
|
||||
if (signvalue)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, signvalue);
|
||||
--padlen;
|
||||
signvalue = 0;
|
||||
}
|
||||
while (padlen > 0)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, '0');
|
||||
--padlen;
|
||||
}
|
||||
}
|
||||
while (padlen > 0)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||
--padlen;
|
||||
}
|
||||
if (signvalue)
|
||||
dopr_outch (buffer, currlen, maxlen, signvalue);
|
||||
|
||||
while (iplace > 0)
|
||||
dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
|
||||
|
||||
|
||||
#ifdef DEBUG_SNPRINTF
|
||||
printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Decimal point. This should probably use locale to find the correct
|
||||
* char to print out.
|
||||
*/
|
||||
if (max > 0) {
|
||||
dopr_outch (buffer, currlen, maxlen, '.');
|
||||
|
||||
while (fplace > 0)
|
||||
dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
|
||||
}
|
||||
|
||||
while (zpadlen > 0)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, '0');
|
||||
--zpadlen;
|
||||
}
|
||||
|
||||
while (padlen < 0)
|
||||
{
|
||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||
++padlen;
|
||||
}
|
||||
}
|
||||
|
||||
static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
|
||||
{
|
||||
if (*currlen < maxlen)
|
||||
buffer[(*currlen)++] = c;
|
||||
}
|
||||
#endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */
|
||||
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
|
||||
{
|
||||
str[0] = 0;
|
||||
dopr(str, count, fmt, args);
|
||||
return(strlen(str));
|
||||
}
|
||||
#endif /* !HAVE_VSNPRINTF */
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
/* VARARGS3 */
|
||||
#ifdef HAVE_STDARGS
|
||||
int snprintf (char *str,size_t count,const char *fmt,...)
|
||||
#else
|
||||
int snprintf (va_alist) va_dcl
|
||||
#endif
|
||||
{
|
||||
#ifndef HAVE_STDARGS
|
||||
char *str;
|
||||
size_t count;
|
||||
char *fmt;
|
||||
#endif
|
||||
VA_LOCAL_DECL;
|
||||
|
||||
VA_START (fmt);
|
||||
VA_SHIFT (str, char *);
|
||||
VA_SHIFT (count, size_t );
|
||||
VA_SHIFT (fmt, char *);
|
||||
(void) vsnprintf(str, count, fmt, ap);
|
||||
VA_END;
|
||||
return(strlen(str));
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/* keep compilers happy about empty files */
|
||||
void dummy_snprintf(void) {}
|
||||
#endif /* !HAVE_SNPRINTF */
|
||||
|
||||
#ifdef TEST_SNPRINTF
|
||||
#ifndef LONG_STRING
|
||||
#define LONG_STRING 1024
|
||||
#endif
|
||||
int main (void)
|
||||
{
|
||||
char buf1[LONG_STRING];
|
||||
char buf2[LONG_STRING];
|
||||
char *fp_fmt[] = {
|
||||
"%-1.5f",
|
||||
"%1.5f",
|
||||
"%123.9f",
|
||||
"%10.5f",
|
||||
"% 10.5f",
|
||||
"%+22.9f",
|
||||
"%+4.9f",
|
||||
"%01.3f",
|
||||
"%4f",
|
||||
"%3.1f",
|
||||
"%3.2f",
|
||||
"%.0f",
|
||||
"%.1f",
|
||||
NULL
|
||||
};
|
||||
double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
|
||||
0.9996, 1.996, 4.136, 6442452944.1234, 0};
|
||||
char *int_fmt[] = {
|
||||
"%-1.5d",
|
||||
"%1.5d",
|
||||
"%123.9d",
|
||||
"%5.5d",
|
||||
"%10.5d",
|
||||
"% 10.5d",
|
||||
"%+22.33d",
|
||||
"%01.3d",
|
||||
"%4d",
|
||||
NULL
|
||||
};
|
||||
long int_nums[] = { -1, 134, 91340, 341, 0203, 0};
|
||||
int x, y;
|
||||
int fail = 0;
|
||||
int num = 0;
|
||||
|
||||
printf ("Testing snprintf format codes against system sprintf...\n");
|
||||
|
||||
for (x = 0; fp_fmt[x] != NULL ; x++)
|
||||
for (y = 0; fp_nums[y] != 0 ; y++)
|
||||
{
|
||||
snprintf (buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]);
|
||||
sprintf (buf2, fp_fmt[x], fp_nums[y]);
|
||||
if (strcmp (buf1, buf2))
|
||||
{
|
||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
|
||||
fp_fmt[x], buf1, buf2);
|
||||
fail++;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
|
||||
for (x = 0; int_fmt[x] != NULL ; x++)
|
||||
for (y = 0; int_nums[y] != 0 ; y++)
|
||||
{
|
||||
snprintf (buf1, sizeof (buf1), int_fmt[x], int_nums[y]);
|
||||
sprintf (buf2, int_fmt[x], int_nums[y]);
|
||||
if (strcmp (buf1, buf2))
|
||||
{
|
||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
|
||||
int_fmt[x], buf1, buf2);
|
||||
fail++;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
printf ("%d tests failed out of %d.\n", fail, num);
|
||||
}
|
||||
#endif /* SNPRINTF_TEST */
|
||||
|
207
common/state.c
207
common/state.c
|
@ -3,7 +3,6 @@
|
|||
Copyright (C)
|
||||
2003 Russell Kroll <rkroll@exploits.org>
|
||||
2008 Arjen de Korte <adkorte-guest@alioth.debian.org>
|
||||
2012 Arnaud Quette <arnaud.quette@free.fr>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,8 +19,6 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h" /* must be first */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -33,7 +30,7 @@
|
|||
#include "state.h"
|
||||
#include "parseconf.h"
|
||||
|
||||
static void val_escape(st_tree_t *node)
|
||||
static void val_escape(struct st_tree_t *node)
|
||||
{
|
||||
char etmp[ST_MAX_VALUE_LEN];
|
||||
|
||||
|
@ -56,7 +53,7 @@ static void val_escape(st_tree_t *node)
|
|||
node->val = node->safe;
|
||||
}
|
||||
|
||||
static void st_tree_enum_free(enum_t *list)
|
||||
static void st_tree_enum_free(struct enum_t *list)
|
||||
{
|
||||
if (!list) {
|
||||
return;
|
||||
|
@ -68,19 +65,8 @@ static void st_tree_enum_free(enum_t *list)
|
|||
free(list);
|
||||
}
|
||||
|
||||
static void st_tree_range_free(range_t *list)
|
||||
{
|
||||
if (!list) {
|
||||
return;
|
||||
}
|
||||
|
||||
st_tree_range_free(list->next);
|
||||
|
||||
free(list);
|
||||
}
|
||||
|
||||
/* free all memory associated with a node */
|
||||
static void st_tree_node_free(st_tree_t *node)
|
||||
static void st_tree_node_free(struct st_tree_t *node)
|
||||
{
|
||||
free(node->var);
|
||||
free(node->raw);
|
||||
|
@ -91,15 +77,12 @@ static void st_tree_node_free(st_tree_t *node)
|
|||
/* blow away the list of enums */
|
||||
st_tree_enum_free(node->enum_list);
|
||||
|
||||
/* and the list of ranges */
|
||||
st_tree_range_free(node->range_list);
|
||||
|
||||
/* now finally kill the node itself */
|
||||
free(node);
|
||||
}
|
||||
|
||||
/* add a subtree to another subtree */
|
||||
static void st_tree_node_add(st_tree_t **nptr, st_tree_t *sptr)
|
||||
static void st_tree_node_add(struct st_tree_t **nptr, struct st_tree_t *sptr)
|
||||
{
|
||||
if (!sptr) {
|
||||
return;
|
||||
|
@ -107,7 +90,7 @@ static void st_tree_node_add(st_tree_t **nptr, st_tree_t *sptr)
|
|||
|
||||
while (*nptr) {
|
||||
|
||||
st_tree_t *node = *nptr;
|
||||
struct st_tree_t *node = *nptr;
|
||||
|
||||
if (strcasecmp(node->var, sptr->var) > 0) {
|
||||
nptr = &node->left;
|
||||
|
@ -126,15 +109,12 @@ static void st_tree_node_add(st_tree_t **nptr, st_tree_t *sptr)
|
|||
*nptr = sptr;
|
||||
}
|
||||
|
||||
/* remove a variable from a tree
|
||||
* except for variables with ST_FLAG_IMMUTABLE
|
||||
* (for override.* to survive) per issue #737
|
||||
*/
|
||||
int state_delinfo(st_tree_t **nptr, const char *var)
|
||||
/* remove a variable from a tree */
|
||||
int state_delinfo(struct st_tree_t **nptr, const char *var)
|
||||
{
|
||||
while (*nptr) {
|
||||
|
||||
st_tree_t *node = *nptr;
|
||||
struct st_tree_t *node = *nptr;
|
||||
|
||||
if (strcasecmp(node->var, var) > 0) {
|
||||
nptr = &node->left;
|
||||
|
@ -146,11 +126,6 @@ int state_delinfo(st_tree_t **nptr, const char *var)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (node->flags & ST_FLAG_IMMUTABLE) {
|
||||
upsdebugx(6, "%s: not deleting immutable variable [%s]", __func__, var);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* whatever is on the left, hang it off current right */
|
||||
st_tree_node_add(&node->right, node->left);
|
||||
|
||||
|
@ -167,11 +142,11 @@ int state_delinfo(st_tree_t **nptr, const char *var)
|
|||
|
||||
/* interface */
|
||||
|
||||
int state_setinfo(st_tree_t **nptr, const char *var, const char *val)
|
||||
int state_setinfo(struct st_tree_t **nptr, const char *var, const char *val)
|
||||
{
|
||||
while (*nptr) {
|
||||
|
||||
st_tree_t *node = *nptr;
|
||||
struct st_tree_t *node = *nptr;
|
||||
|
||||
if (strcasecmp(node->var, var) > 0) {
|
||||
nptr = &node->left;
|
||||
|
@ -218,9 +193,9 @@ int state_setinfo(st_tree_t **nptr, const char *var, const char *val)
|
|||
return 1; /* added */
|
||||
}
|
||||
|
||||
static int st_tree_enum_add(enum_t **list, const char *enc)
|
||||
static int st_tree_enum_add(struct enum_t **list, const char *enc)
|
||||
{
|
||||
enum_t *item;
|
||||
struct enum_t *item;
|
||||
|
||||
while (*list) {
|
||||
|
||||
|
@ -242,9 +217,9 @@ static int st_tree_enum_add(enum_t **list, const char *enc)
|
|||
return 1; /* added */
|
||||
}
|
||||
|
||||
int state_addenum(st_tree_t *root, const char *var, const char *val)
|
||||
int state_addenum(struct st_tree_t *root, const char *var, const char *val)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
struct st_tree_t *sttmp;
|
||||
char enc[ST_MAX_VALUE_LEN];
|
||||
|
||||
/* find the tree node for var */
|
||||
|
@ -262,58 +237,10 @@ int state_addenum(st_tree_t *root, const char *var, const char *val)
|
|||
return st_tree_enum_add(&sttmp->enum_list, enc);
|
||||
}
|
||||
|
||||
static int st_tree_range_add(range_t **list, const int min, const int max)
|
||||
int state_setaux(struct st_tree_t *root, const char *var, const char *auxs)
|
||||
{
|
||||
range_t *item;
|
||||
|
||||
while (*list) {
|
||||
|
||||
if (((*list)->min != min) && ((*list)->max != max)) {
|
||||
list = &(*list)->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
return 0; /* duplicate */
|
||||
}
|
||||
|
||||
item = xcalloc(1, sizeof(*item));
|
||||
item->min = min;
|
||||
item->max = max;
|
||||
item->next = *list;
|
||||
|
||||
/* now we're done creating it, add it to the list */
|
||||
*list = item;
|
||||
|
||||
return 1; /* added */
|
||||
}
|
||||
|
||||
int state_addrange(st_tree_t *root, const char *var, const int min, const int max)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
|
||||
/* sanity check */
|
||||
if (min > max) {
|
||||
upslogx(LOG_ERR, "state_addrange: min is superior to max! (%i, %i)",
|
||||
min, max);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
||||
if (!sttmp) {
|
||||
upslogx(LOG_ERR, "state_addrange: base variable (%s) "
|
||||
"does not exist", var);
|
||||
return 0; /* failed */
|
||||
}
|
||||
|
||||
return st_tree_range_add(&sttmp->range_list, min, max);
|
||||
}
|
||||
|
||||
int state_setaux(st_tree_t *root, const char *var, const char *auxs)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
long aux;
|
||||
struct st_tree_t *sttmp;
|
||||
int aux;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -336,9 +263,9 @@ int state_setaux(st_tree_t *root, const char *var, const char *auxs)
|
|||
return 1;
|
||||
}
|
||||
|
||||
const char *state_getinfo(st_tree_t *root, const char *var)
|
||||
const char *state_getinfo(struct st_tree_t *root, const char *var)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
struct st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -350,9 +277,9 @@ const char *state_getinfo(st_tree_t *root, const char *var)
|
|||
return sttmp->val;
|
||||
}
|
||||
|
||||
int state_getflags(st_tree_t *root, const char *var)
|
||||
int state_getflags(struct st_tree_t *root, const char *var)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
struct st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -364,9 +291,9 @@ int state_getflags(st_tree_t *root, const char *var)
|
|||
return sttmp->flags;
|
||||
}
|
||||
|
||||
long state_getaux(st_tree_t *root, const char *var)
|
||||
int state_getaux(struct st_tree_t *root, const char *var)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
struct st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -378,9 +305,9 @@ long state_getaux(st_tree_t *root, const char *var)
|
|||
return sttmp->aux;
|
||||
}
|
||||
|
||||
const enum_t *state_getenumlist(st_tree_t *root, const char *var)
|
||||
const struct enum_t *state_getenumlist(struct st_tree_t *root, const char *var)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
struct st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -392,24 +319,10 @@ const enum_t *state_getenumlist(st_tree_t *root, const char *var)
|
|||
return sttmp->enum_list;
|
||||
}
|
||||
|
||||
const range_t *state_getrangelist(st_tree_t *root, const char *var)
|
||||
void state_setflags(struct st_tree_t *root, const char *var, int numflags, char **flag)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
||||
if (!sttmp) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sttmp->range_list;
|
||||
}
|
||||
|
||||
void state_setflags(st_tree_t *root, const char *var, size_t numflags, char **flag)
|
||||
{
|
||||
size_t i;
|
||||
st_tree_t *sttmp;
|
||||
int i;
|
||||
struct st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -434,18 +347,13 @@ void state_setflags(st_tree_t *root, const char *var, size_t numflags, char **fl
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!strcasecmp(flag[i], "NUMBER")) {
|
||||
sttmp->flags |= ST_FLAG_NUMBER;
|
||||
continue;
|
||||
}
|
||||
|
||||
upsdebugx(2, "Unrecognized flag [%s]", flag[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int state_addcmd(cmdlist_t **list, const char *cmd)
|
||||
int state_addcmd(struct cmdlist_t **list, const char *cmd)
|
||||
{
|
||||
cmdlist_t *item;
|
||||
struct cmdlist_t *item;
|
||||
|
||||
while (*list) {
|
||||
|
||||
|
@ -472,7 +380,7 @@ int state_addcmd(cmdlist_t **list, const char *cmd)
|
|||
return 1; /* added */
|
||||
}
|
||||
|
||||
void state_infofree(st_tree_t *node)
|
||||
void state_infofree(struct st_tree_t *node)
|
||||
{
|
||||
if (!node) {
|
||||
return;
|
||||
|
@ -484,7 +392,7 @@ void state_infofree(st_tree_t *node)
|
|||
st_tree_node_free(node);
|
||||
}
|
||||
|
||||
void state_cmdfree(cmdlist_t *list)
|
||||
void state_cmdfree(struct cmdlist_t *list)
|
||||
{
|
||||
if (!list) {
|
||||
return;
|
||||
|
@ -496,11 +404,11 @@ void state_cmdfree(cmdlist_t *list)
|
|||
free(list);
|
||||
}
|
||||
|
||||
int state_delcmd(cmdlist_t **list, const char *cmd)
|
||||
int state_delcmd(struct cmdlist_t **list, const char *cmd)
|
||||
{
|
||||
while (*list) {
|
||||
|
||||
cmdlist_t *item = *list;
|
||||
struct cmdlist_t *item = *list;
|
||||
|
||||
if (strcasecmp(item->name, cmd) > 0) {
|
||||
/* not found */
|
||||
|
@ -525,11 +433,11 @@ int state_delcmd(cmdlist_t **list, const char *cmd)
|
|||
return 0; /* not found */
|
||||
}
|
||||
|
||||
static int st_tree_del_enum(enum_t **list, const char *val)
|
||||
static int st_tree_del_enum(struct enum_t **list, const char *val)
|
||||
{
|
||||
while (*list) {
|
||||
|
||||
enum_t *item = *list;
|
||||
struct enum_t *item = *list;
|
||||
|
||||
/* if this is not the right value, go on to the next */
|
||||
if (strcasecmp(item->val, val)) {
|
||||
|
@ -549,9 +457,9 @@ static int st_tree_del_enum(enum_t **list, const char *val)
|
|||
return 0; /* not found */
|
||||
}
|
||||
|
||||
int state_delenum(st_tree_t *root, const char *var, const char *val)
|
||||
int state_delenum(struct st_tree_t *root, const char *var, const char *val)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
struct st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
@ -563,44 +471,7 @@ int state_delenum(st_tree_t *root, const char *var, const char *val)
|
|||
return st_tree_del_enum(&sttmp->enum_list, val);
|
||||
}
|
||||
|
||||
static int st_tree_del_range(range_t **list, const int min, const int max)
|
||||
{
|
||||
while (*list) {
|
||||
|
||||
range_t *item = *list;
|
||||
|
||||
/* if this is not the right value, go on to the next */
|
||||
if (((*list)->min != min) && ((*list)->max != max)) {
|
||||
list = &item->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* we found it! */
|
||||
*list = item->next;
|
||||
|
||||
free(item);
|
||||
|
||||
return 1; /* deleted */
|
||||
}
|
||||
|
||||
return 0; /* not found */
|
||||
}
|
||||
|
||||
int state_delrange(st_tree_t *root, const char *var, const int min, const int max)
|
||||
{
|
||||
st_tree_t *sttmp;
|
||||
|
||||
/* find the tree node for var */
|
||||
sttmp = state_tree_find(root, var);
|
||||
|
||||
if (!sttmp) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return st_tree_del_range(&sttmp->range_list, min, max);
|
||||
}
|
||||
|
||||
st_tree_t *state_tree_find(st_tree_t *node, const char *var)
|
||||
struct st_tree_t *state_tree_find(struct st_tree_t *node, const char *var)
|
||||
{
|
||||
while (node) {
|
||||
|
||||
|
|
629
common/str.c
629
common/str.c
|
@ -1,629 +0,0 @@
|
|||
/* str.c - Common string-related functions
|
||||
*
|
||||
* Copyright (C)
|
||||
* 2000 Russell Kroll <rkroll@exploits.org>
|
||||
* 2015 Daniele Pezzini <hyouko@gmail.com>
|
||||
*
|
||||
* This program 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "config.h" /* must be first */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h> /* for strdup() and many others */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h> /* for strncasecmp() and strcasecmp() */
|
||||
#endif
|
||||
|
||||
#include "nut_stdint.h"
|
||||
#include "str.h"
|
||||
|
||||
char *str_trim(char *string, const char character)
|
||||
{
|
||||
return str_rtrim(str_ltrim(string, character), character);
|
||||
}
|
||||
|
||||
char *str_trim_m(char *string, const char *characters)
|
||||
{
|
||||
return str_rtrim_m(str_ltrim_m(string, characters), characters);
|
||||
}
|
||||
|
||||
char *str_ltrim(char *string, const char character)
|
||||
{
|
||||
char characters[2] = { character, '\0' };
|
||||
|
||||
return str_ltrim_m(string, characters);
|
||||
}
|
||||
|
||||
char *str_ltrim_m(char *string, const char *characters)
|
||||
{
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0' ||
|
||||
characters == NULL ||
|
||||
*characters == '\0'
|
||||
)
|
||||
return string;
|
||||
|
||||
while (
|
||||
*string != '\0' &&
|
||||
strchr(characters, *string) != NULL
|
||||
)
|
||||
memmove(string, string + 1, strlen(string));
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
char *str_rtrim(char *string, const char character)
|
||||
{
|
||||
char characters[2] = { character, '\0' };
|
||||
|
||||
return str_rtrim_m(string, characters);
|
||||
}
|
||||
|
||||
char *str_rtrim_m(char *string, const char *characters)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0' ||
|
||||
characters == NULL ||
|
||||
*characters == '\0'
|
||||
)
|
||||
return string;
|
||||
|
||||
ptr = &string[strlen(string) - 1];
|
||||
|
||||
while (
|
||||
ptr >= string &&
|
||||
strchr(characters, *ptr) != NULL
|
||||
)
|
||||
*ptr-- = '\0';
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
char *str_trim_space(char *string)
|
||||
{
|
||||
return str_rtrim_space(str_ltrim_space(string));
|
||||
}
|
||||
|
||||
char *str_ltrim_space(char *string)
|
||||
{
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0'
|
||||
)
|
||||
return string;
|
||||
|
||||
while (
|
||||
*string != '\0' &&
|
||||
isspace((size_t)*string)
|
||||
)
|
||||
memmove(string, string + 1, strlen(string));
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
char *str_rtrim_space(char *string)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0'
|
||||
)
|
||||
return string;
|
||||
|
||||
ptr = &string[strlen(string) - 1];
|
||||
|
||||
while (
|
||||
ptr >= string &&
|
||||
isspace((size_t)*ptr)
|
||||
)
|
||||
*ptr-- = '\0';
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
int str_is_short(const char *string, const int base)
|
||||
{
|
||||
short number;
|
||||
|
||||
return str_to_short(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_short_strict(const char *string, const int base)
|
||||
{
|
||||
short number;
|
||||
|
||||
return str_to_short_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_ushort(const char *string, const int base)
|
||||
{
|
||||
unsigned short number;
|
||||
|
||||
return str_to_ushort(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_ushort_strict(const char *string, const int base)
|
||||
{
|
||||
unsigned short number;
|
||||
|
||||
return str_to_ushort_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_int(const char *string, const int base)
|
||||
{
|
||||
int number;
|
||||
|
||||
return str_to_int(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_int_strict(const char *string, const int base)
|
||||
{
|
||||
int number;
|
||||
|
||||
return str_to_int_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_uint(const char *string, const int base)
|
||||
{
|
||||
unsigned int number;
|
||||
|
||||
return str_to_uint(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_uint_strict(const char *string, const int base)
|
||||
{
|
||||
unsigned int number;
|
||||
|
||||
return str_to_uint_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_long(const char *string, const int base)
|
||||
{
|
||||
long number;
|
||||
|
||||
return str_to_long(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_long_strict(const char *string, const int base)
|
||||
{
|
||||
long number;
|
||||
|
||||
return str_to_long_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_ulong(const char *string, const int base)
|
||||
{
|
||||
unsigned long number;
|
||||
|
||||
return str_to_ulong(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_ulong_strict(const char *string, const int base)
|
||||
{
|
||||
unsigned long number;
|
||||
|
||||
return str_to_ulong_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_double(const char *string, const int base)
|
||||
{
|
||||
double number;
|
||||
|
||||
return str_to_double(string, &number, base);
|
||||
}
|
||||
|
||||
int str_is_double_strict(const char *string, const int base)
|
||||
{
|
||||
double number;
|
||||
|
||||
return str_to_double_strict(string, &number, base);
|
||||
}
|
||||
|
||||
int str_to_short(const char *string, short *number, const int base)
|
||||
{
|
||||
long num;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_long(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (
|
||||
num < SHRT_MIN ||
|
||||
num > SHRT_MAX
|
||||
) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (short)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_short_strict(const char *string, short *number, const int base)
|
||||
{
|
||||
long num;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_long_strict(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (
|
||||
num < SHRT_MIN ||
|
||||
num > SHRT_MAX
|
||||
) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (short)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_ushort(const char *string, unsigned short *number, const int base)
|
||||
{
|
||||
unsigned long num;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_ulong(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (num > USHRT_MAX) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (unsigned short)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_ushort_strict(const char *string, unsigned short *number, const int base)
|
||||
{
|
||||
unsigned long num;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_ulong_strict(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (num > USHRT_MAX) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (unsigned short)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_int(const char *string, int *number, const int base)
|
||||
{
|
||||
long num; /* long >= int, make sure we fit well */
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_long(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (
|
||||
num < INT_MIN ||
|
||||
num > INT_MAX
|
||||
) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (int)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_int_strict(const char *string, int *number, const int base)
|
||||
{
|
||||
long num; /* long >= int, make sure we fit well */
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_long_strict(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (
|
||||
num < INT_MIN ||
|
||||
num > INT_MAX
|
||||
) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (int)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_uint(const char *string, unsigned int *number, const int base)
|
||||
{
|
||||
unsigned long num; /* long >= int, make sure we fit well */
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_ulong(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (num > UINT_MAX) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (unsigned int)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_uint_strict(const char *string, unsigned int *number, const int base)
|
||||
{
|
||||
unsigned long num; /* long >= int, make sure we fit well */
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (!str_to_ulong_strict(string, &num, base))
|
||||
return 0;
|
||||
|
||||
if (num > UINT_MAX) {
|
||||
errno = ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*number = (unsigned int)num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_long(const char *string, long *number, const int base)
|
||||
{
|
||||
char *str;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0'
|
||||
) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
str = strdup(string);
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
|
||||
str_trim_space(str);
|
||||
|
||||
if (!str_to_long_strict(str, number, base)) {
|
||||
free(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free(str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_long_strict(const char *string, long *number, const int base)
|
||||
{
|
||||
char *ptr = NULL;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0' ||
|
||||
isspace((size_t)*string)
|
||||
) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
*number = strtol(string, &ptr, base);
|
||||
|
||||
if (
|
||||
errno == EINVAL ||
|
||||
*ptr != '\0'
|
||||
) {
|
||||
*number = 0;
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (errno == ERANGE) {
|
||||
*number = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_ulong(const char *string, unsigned long *number, const int base)
|
||||
{
|
||||
char *str;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0'
|
||||
) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
str = strdup(string);
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
|
||||
str_trim_space(str);
|
||||
|
||||
if (!str_to_ulong_strict(str, number, base)) {
|
||||
free(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free(str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_ulong_strict(const char *string, unsigned long *number, const int base)
|
||||
{
|
||||
char *ptr = NULL;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0' ||
|
||||
*string == '+' ||
|
||||
*string == '-' ||
|
||||
isspace((size_t)*string)
|
||||
) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
*number = strtoul(string, &ptr, base);
|
||||
|
||||
if (
|
||||
errno == EINVAL ||
|
||||
*ptr != '\0'
|
||||
) {
|
||||
*number = 0;
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (errno == ERANGE) {
|
||||
*number = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_double(const char *string, double *number, const int base)
|
||||
{
|
||||
char *str;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0'
|
||||
) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
str = strdup(string);
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
|
||||
str_trim_space(str);
|
||||
|
||||
if (!str_to_double_strict(str, number, base)) {
|
||||
free(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free(str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_to_double_strict(const char *string, double *number, const int base)
|
||||
{
|
||||
char *ptr = NULL;
|
||||
|
||||
*number = 0;
|
||||
|
||||
if (
|
||||
string == NULL ||
|
||||
*string == '\0' ||
|
||||
isspace((size_t)*string)
|
||||
) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (base)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 10:
|
||||
if (strlen(string) != strspn(string, "-+.0123456789Ee")) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (strlen(string) != strspn(string, "-+.0123456789ABCDEFabcdefXxPp")) {
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
*number = strtod(string, &ptr);
|
||||
|
||||
if (
|
||||
errno == EINVAL ||
|
||||
*ptr != '\0'
|
||||
) {
|
||||
*number = 0;
|
||||
errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (errno == ERANGE) {
|
||||
*number = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_ends_with(const char *s, const char *suff) {
|
||||
size_t slen;
|
||||
size_t sufflen;
|
||||
|
||||
if (!s) return 0; /* null string does not end with anything */
|
||||
if (!suff) return 1; /* null suffix tails anything */
|
||||
|
||||
slen = strlen(s);
|
||||
sufflen = strlen(suff);
|
||||
|
||||
return (slen >= sufflen) && (!memcmp(s + slen - sufflen, suff, sufflen));
|
||||
}
|
|
@ -1,518 +0,0 @@
|
|||
/* strerror() Mark Powell <medp@primagraphics.co.uk> */
|
||||
/* Simple implementation derived from libiberty */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
char *strerror(int errnum)
|
||||
{
|
||||
static char buf[32];
|
||||
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE_BREAK
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code-break"
|
||||
#endif
|
||||
#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic ignored "-Wunreachable-code"
|
||||
#endif
|
||||
|
||||
switch (errnum) {
|
||||
#if defined (EPERM)
|
||||
case EPERM:
|
||||
return "Not owner";
|
||||
#endif
|
||||
#if defined (ENOENT)
|
||||
case ENOENT:
|
||||
return "No such file or directory";
|
||||
#endif
|
||||
#if defined (ESRCH)
|
||||
case ESRCH:
|
||||
return "No such process";
|
||||
#endif
|
||||
#if defined (EINTR)
|
||||
case EINTR:
|
||||
return "Interrupted system call";
|
||||
#endif
|
||||
#if defined (EIO)
|
||||
case EIO:
|
||||
return "I/O error";
|
||||
#endif
|
||||
#if defined (ENXIO)
|
||||
case ENXIO:
|
||||
return "No such device or address";
|
||||
#endif
|
||||
#if defined (E2BIG)
|
||||
return "Arg list too long";
|
||||
#endif
|
||||
#if defined (ENOEXEC)
|
||||
case ENOEXEC:
|
||||
return "Exec format error";
|
||||
#endif
|
||||
#if defined (EBADF)
|
||||
case EBADF:
|
||||
return "Bad file number";
|
||||
#endif
|
||||
#if defined (ECHILD)
|
||||
case ECHILD:
|
||||
return "No child processes";
|
||||
#endif
|
||||
#if defined (EWOULDBLOCK) /* Put before EAGAIN, sometimes aliased */
|
||||
case EWOULDBLOCK:
|
||||
return "Operation would block";
|
||||
#endif
|
||||
#if defined (EAGAIN)
|
||||
#if defined (EWOULDBLOCK) && EAGAIN != EWOULDBLOCK
|
||||
case EAGAIN:
|
||||
return "No more processes";
|
||||
#endif
|
||||
#endif
|
||||
#if defined (ENOMEM)
|
||||
case ENOMEM:
|
||||
return "Not enough space";
|
||||
#endif
|
||||
#if defined (EACCES)
|
||||
case EACCES:
|
||||
return "Permission denied";
|
||||
#endif
|
||||
#if defined (EFAULT)
|
||||
case EFAULT:
|
||||
return "Bad address";
|
||||
#endif
|
||||
#if defined (ENOTBLK)
|
||||
case ENOTBLK:
|
||||
return "Block device required";
|
||||
#endif
|
||||
#if defined (EBUSY)
|
||||
case EBUSY:
|
||||
return "Device busy";
|
||||
#endif
|
||||
#if defined (EEXIST)
|
||||
case EEXIST:
|
||||
return "File exists";
|
||||
#endif
|
||||
#if defined (EXDEV)
|
||||
case EXDEV:
|
||||
return "Cross-device link";
|
||||
#endif
|
||||
#if defined (ENODEV)
|
||||
case ENODEV:
|
||||
return "No such device";
|
||||
#endif
|
||||
#if defined (ENOTDIR)
|
||||
case ENOTDIR:
|
||||
return "Not a directory";
|
||||
#endif
|
||||
#if defined (EISDIR)
|
||||
case EISDIR:
|
||||
return "Is a directory";
|
||||
#endif
|
||||
#if defined (EINVAL)
|
||||
case EINVAL:
|
||||
return "Invalid argument";
|
||||
#endif
|
||||
#if defined (ENFILE)
|
||||
case ENFILE:
|
||||
return "File table overflow";
|
||||
#endif
|
||||
#if defined (EMFILE)
|
||||
case EMFILE:
|
||||
return "Too many open files";
|
||||
#endif
|
||||
#if defined (ENOTTY)
|
||||
case ENOTTY:
|
||||
return "Not a typewriter";
|
||||
#endif
|
||||
#if defined (ETXTBSY)
|
||||
case ETXTBSY:
|
||||
return "Text file busy";
|
||||
#endif
|
||||
#if defined (EFBIG)
|
||||
case EFBIG:
|
||||
return "File too large";
|
||||
#endif
|
||||
#if defined (ENOSPC)
|
||||
case ENOSPC:
|
||||
return "No space left on device";
|
||||
#endif
|
||||
#if defined (ESPIPE)
|
||||
case ESPIPE:
|
||||
return "Illegal seek";
|
||||
#endif
|
||||
#if defined (EROFS)
|
||||
case EROFS:
|
||||
return "Read-only file system";
|
||||
#endif
|
||||
#if defined (EMLINK)
|
||||
case EMLINK:
|
||||
return "Too many links";
|
||||
#endif
|
||||
#if defined (EPIPE)
|
||||
case EPIPE:
|
||||
return "Broken pipe";
|
||||
#endif
|
||||
#if defined (EDOM)
|
||||
case EDOM:
|
||||
return "Math argument out of domain of func";
|
||||
#endif
|
||||
#if defined (ERANGE)
|
||||
case ERANGE:
|
||||
return "Math result not representable";
|
||||
#endif
|
||||
#if defined (ENOMSG)
|
||||
case ENOMSG:
|
||||
return "No message of desired type";
|
||||
#endif
|
||||
#if defined (EIDRM)
|
||||
case EIDRM:
|
||||
return "Identifier removed";
|
||||
#endif
|
||||
#if defined (ECHRNG)
|
||||
case ECHRNG:
|
||||
return "Channel number out of range";
|
||||
#endif
|
||||
#if defined (EL2NSYNC)
|
||||
return "Level 2 not synchronized";
|
||||
#endif
|
||||
#if defined (EL3HLT)
|
||||
return "Level 3 halted";
|
||||
#endif
|
||||
#if defined (EL3RST)
|
||||
return "Level 3 reset";
|
||||
#endif
|
||||
#if defined (ELNRNG)
|
||||
case ELNRNG:
|
||||
return "Link number out of range";
|
||||
#endif
|
||||
#if defined (EUNATCH)
|
||||
case EUNATCH:
|
||||
return "Protocol driver not attached";
|
||||
#endif
|
||||
#if defined (ENOCSI)
|
||||
case ENOCSI:
|
||||
return "No CSI structure available";
|
||||
#endif
|
||||
#if defined (EL2HLT)
|
||||
return "Level 2 halted";
|
||||
#endif
|
||||
#if defined (EDEADLK)
|
||||
case EDEADLK:
|
||||
return "Deadlock condition";
|
||||
#endif
|
||||
#if defined (ENOLCK)
|
||||
case ENOLCK:
|
||||
return "No record locks available";
|
||||
#endif
|
||||
#if defined (EBADE)
|
||||
case EBADE:
|
||||
return "Invalid exchange";
|
||||
#endif
|
||||
#if defined (EBADR)
|
||||
case EBADR:
|
||||
return "Invalid request descriptor";
|
||||
#endif
|
||||
#if defined (EXFULL)
|
||||
case EXFULL:
|
||||
return "Exchange full";
|
||||
#endif
|
||||
#if defined (ENOANO)
|
||||
case ENOANO:
|
||||
return "No anode";
|
||||
#endif
|
||||
#if defined (EBADRQC)
|
||||
case EBADRQC:
|
||||
return "Invalid request code";
|
||||
#endif
|
||||
#if defined (EBADSLT)
|
||||
case EBADSLT:
|
||||
return "Invalid slot";
|
||||
#endif
|
||||
#if defined (EDEADLOCK)
|
||||
case EDEADLOCK:
|
||||
return "File locking deadlock error";
|
||||
#endif
|
||||
#if defined (EBFONT)
|
||||
case EBFONT:
|
||||
return "Bad font file format";
|
||||
#endif
|
||||
#if defined (ENOSTR)
|
||||
case ENOSTR:
|
||||
return "Device not a stream";
|
||||
#endif
|
||||
#if defined (ENODATA)
|
||||
case ENODATA:
|
||||
return "No data available";
|
||||
#endif
|
||||
#if defined (ETIME)
|
||||
case ETIME:
|
||||
return "Timer expired";
|
||||
#endif
|
||||
#if defined (ENOSR)
|
||||
case ENOSR:
|
||||
return "Out of streams resources";
|
||||
#endif
|
||||
#if defined (ENONET)
|
||||
case ENONET:
|
||||
return "Machine is not on the network";
|
||||
#endif
|
||||
#if defined (ENOPKG)
|
||||
case ENOPKG:
|
||||
return "Package not installed";
|
||||
#endif
|
||||
#if defined (EREMOTE)
|
||||
case EREMOTE:
|
||||
return "Object is remote";
|
||||
#endif
|
||||
#if defined (ENOLINK)
|
||||
case ENOLINK:
|
||||
return "Link has been severed";
|
||||
#endif
|
||||
#if defined (EADV)
|
||||
case EADV:
|
||||
return "Advertise error";
|
||||
#endif
|
||||
#if defined (ESRMNT)
|
||||
case ESRMNT:
|
||||
return "Srmount error";
|
||||
#endif
|
||||
#if defined (ECOMM)
|
||||
case ECOMM:
|
||||
return "Communication error on send";
|
||||
#endif
|
||||
#if defined (EPROTO)
|
||||
case EPROTO:
|
||||
return "Protocol error";
|
||||
#endif
|
||||
#if defined (EMULTIHOP)
|
||||
case EMULTIHOP:
|
||||
return "Multihop attempted";
|
||||
#endif
|
||||
#if defined (EDOTDOT)
|
||||
case EDOTDOT:
|
||||
return "RFS specific error";
|
||||
#endif
|
||||
#if defined (EBADMSG)
|
||||
case EBADMSG:
|
||||
return "Not a data message";
|
||||
#endif
|
||||
#if defined (ENAMETOOLONG)
|
||||
case ENAMETOOLONG:
|
||||
return "File name too long";
|
||||
#endif
|
||||
#if defined (EOVERFLOW)
|
||||
case EOVERFLOW:
|
||||
return "Value too large for defined data type";
|
||||
#endif
|
||||
#if defined (ENOTUNIQ)
|
||||
case ENOTUNIQ:
|
||||
return "Name not unique on network";
|
||||
#endif
|
||||
#if defined (EBADFD)
|
||||
case EBADFD:
|
||||
return "File descriptor in bad state";
|
||||
#endif
|
||||
#if defined (EREMCHG)
|
||||
case EREMCHG:
|
||||
return "Remote address changed";
|
||||
#endif
|
||||
#if defined (ELIBACC)
|
||||
case ELIBACC:
|
||||
return "Can not access a needed shared library";
|
||||
#endif
|
||||
#if defined (ELIBBAD)
|
||||
case ELIBBAD:
|
||||
return "Accessing a corrupted shared library";
|
||||
#endif
|
||||
#if defined (ELIBSCN)
|
||||
case ELIBSCN:
|
||||
return ".lib section in a.out corrupted";
|
||||
#endif
|
||||
#if defined (ELIBMAX)
|
||||
case ELIBMAX:
|
||||
return "Attempting to link in too many shared libraries";
|
||||
#endif
|
||||
#if defined (ELIBEXEC)
|
||||
case ELIBEXEC:
|
||||
return "Cannot exec a shared library directly";
|
||||
#endif
|
||||
#if defined (EILSEQ)
|
||||
case EILSEQ:
|
||||
return "Illegal byte sequence";
|
||||
#endif
|
||||
#if defined (ENOSYS)
|
||||
case ENOSYS:
|
||||
return "Operation not applicable";
|
||||
#endif
|
||||
#if defined (ELOOP)
|
||||
case ELOOP:
|
||||
return "Too many symbolic links encountered";
|
||||
#endif
|
||||
#if defined (ERESTART)
|
||||
case ERESTART:
|
||||
return "Interrupted system call should be restarted";
|
||||
#endif
|
||||
#if defined (ESTRPIPE)
|
||||
case ESTRPIPE:
|
||||
return "Streams pipe error";
|
||||
#endif
|
||||
#if defined (ENOTEMPTY)
|
||||
case ENOTEMPTY:
|
||||
return "Directory not empty";
|
||||
#endif
|
||||
#if defined (EUSERS)
|
||||
case EUSERS:
|
||||
return "Too many users";
|
||||
#endif
|
||||
#if defined (ENOTSOCK)
|
||||
case ENOTSOCK:
|
||||
return "Socket operation on non-socket";
|
||||
#endif
|
||||
#if defined (EDESTADDRREQ)
|
||||
case EDESTADDRREQ:
|
||||
return "Destination address required";
|
||||
#endif
|
||||
#if defined (EMSGSIZE)
|
||||
case EMSGSIZE:
|
||||
return "Message too long";
|
||||
#endif
|
||||
#if defined (EPROTOTYPE)
|
||||
case EPROTOTYPE:
|
||||
return "Protocol wrong type for socket";
|
||||
#endif
|
||||
#if defined (ENOPROTOOPT)
|
||||
case ENOPROTOOPT:
|
||||
return "Protocol not available";
|
||||
#endif
|
||||
#if defined (EPROTONOSUPPORT)
|
||||
case EPROTONOSUPPORT:
|
||||
return "Protocol not supported";
|
||||
#endif
|
||||
#if defined (ESOCKTNOSUPPORT)
|
||||
case ESOCKTNOSUPPORT:
|
||||
return "Socket type not supported";
|
||||
#endif
|
||||
#if defined (EOPNOTSUPP)
|
||||
case EOPNOTSUPP:
|
||||
return "Operation not supported on transport endpoint";
|
||||
#endif
|
||||
#if defined (EPFNOSUPPORT)
|
||||
case EPFNOSUPPORT:
|
||||
return "Protocol family not supported";
|
||||
#endif
|
||||
#if defined (EAFNOSUPPORT)
|
||||
case EAFNOSUPPORT:
|
||||
return "Address family not supported by protocol";
|
||||
#endif
|
||||
#if defined (EADDRINUSE)
|
||||
case EADDRINUSE:
|
||||
return "Address already in use";
|
||||
#endif
|
||||
#if defined (EADDRNOTAVAIL)
|
||||
case EADDRNOTAVAIL:
|
||||
return "Cannot assign requested address";
|
||||
#endif
|
||||
#if defined (ENETDOWN)
|
||||
case ENETDOWN:
|
||||
return "Network is down";
|
||||
#endif
|
||||
#if defined (ENETUNREACH)
|
||||
case ENETUNREACH:
|
||||
return "Network is unreachable";
|
||||
#endif
|
||||
#if defined (ENETRESET)
|
||||
case ENETRESET:
|
||||
return "Network dropped connection because of reset";
|
||||
#endif
|
||||
#if defined (ECONNABORTED)
|
||||
case ECONNABORTED:
|
||||
return "Software caused connection abort";
|
||||
#endif
|
||||
#if defined (ECONNRESET)
|
||||
case ECONNRESET:
|
||||
return "Connection reset by peer";
|
||||
#endif
|
||||
#if defined (ENOBUFS)
|
||||
case ENOBUFS:
|
||||
return "No buffer space available";
|
||||
#endif
|
||||
#if defined (EISCONN)
|
||||
case EISCONN:
|
||||
return "Transport endpoint is already connected";
|
||||
#endif
|
||||
#if defined (ENOTCONN)
|
||||
case ENOTCONN:
|
||||
return "Transport endpoint is not connected";
|
||||
#endif
|
||||
#if defined (ESHUTDOWN)
|
||||
case ESHUTDOWN:
|
||||
return "Cannot send after transport endpoint shutdown";
|
||||
#endif
|
||||
#if defined (ETOOMANYREFS)
|
||||
case ETOOMANYREFS:
|
||||
return "Too many references: cannot splice";
|
||||
#endif
|
||||
#if defined (ETIMEDOUT)
|
||||
case ETIMEDOUT:
|
||||
return "Connection timed out";
|
||||
#endif
|
||||
#if defined (ECONNREFUSED)
|
||||
case ECONNREFUSED:
|
||||
return "Connection refused";
|
||||
#endif
|
||||
#if defined (EHOSTDOWN)
|
||||
case EHOSTDOWN:
|
||||
return "Host is down";
|
||||
#endif
|
||||
#if defined (EHOSTUNREACH)
|
||||
case EHOSTUNREACH:
|
||||
return "No route to host";
|
||||
#endif
|
||||
#if defined (EALREADY)
|
||||
case EALREADY:
|
||||
return "Operation already in progress";
|
||||
#endif
|
||||
#if defined (EINPROGRESS)
|
||||
case EINPROGRESS:
|
||||
return "Operation now in progress";
|
||||
#endif
|
||||
#if defined (ESTALE)
|
||||
case ESTALE:
|
||||
return "Stale NFS file handle";
|
||||
#endif
|
||||
#if defined (EUCLEAN)
|
||||
case EUCLEAN:
|
||||
return "Structure needs cleaning";
|
||||
#endif
|
||||
#if defined (ENOTNAM)
|
||||
case ENOTNAM:
|
||||
return "Not a XENIX named type file";
|
||||
#endif
|
||||
#if defined (ENAVAIL)
|
||||
case ENAVAIL:
|
||||
return "No XENIX semaphores available";
|
||||
#endif
|
||||
#if defined (EISNAM)
|
||||
case EISNAM:
|
||||
return "Is a named type file";
|
||||
#endif
|
||||
#if defined (EREMOTEIO)
|
||||
case EREMOTEIO:
|
||||
return "Remote I/O error";
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Fallback: just print the error number */
|
||||
snprintf(buf, sizeof(buf), "Error %d", errnum);
|
||||
return buf;
|
||||
|
||||
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif /* HAVE_STRERROR */
|
|
@ -17,8 +17,6 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h" /* must be the first header */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -31,8 +29,10 @@
|
|||
static char *ups_section;
|
||||
|
||||
/* handle arguments separated by parseconf */
|
||||
static void conf_args(size_t numargs, char **arg)
|
||||
static void conf_args(int numargs, char **arg)
|
||||
{
|
||||
char *ep;
|
||||
|
||||
if (numargs < 1)
|
||||
return;
|
||||
|
||||
|
@ -46,6 +46,15 @@ static void conf_args(size_t numargs, char **arg)
|
|||
return;
|
||||
}
|
||||
|
||||
/* handle 'foo=bar' (compressed form) */
|
||||
ep = strchr(arg[0], '=');
|
||||
if (ep) {
|
||||
*ep = '\0';
|
||||
|
||||
do_upsconf_args(ups_section, arg[0], ep+1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* handle 'foo' (flag) */
|
||||
if (numargs == 1) {
|
||||
do_upsconf_args(ups_section, arg[0], NULL);
|
||||
|
@ -55,7 +64,7 @@ static void conf_args(size_t numargs, char **arg)
|
|||
if (numargs < 3)
|
||||
return;
|
||||
|
||||
/* handle 'foo = bar', 'foo=bar', 'foo =bar' or 'foo= bar' forms */
|
||||
/* handle 'foo = bar' (split form) */
|
||||
if (!strcmp(arg[1], "=")) {
|
||||
do_upsconf_args(ups_section, arg[0], arg[2]);
|
||||
return;
|
||||
|
|
21
compile
21
compile
|
@ -1,10 +1,9 @@
|
|||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2009-10-06.20; # UTC
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
@ -18,7 +17,8 @@ scriptversion=2009-10-06.20; # UTC
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
|
@ -103,13 +103,13 @@ if test -z "$ofile" || test -z "$cfile"; then
|
|||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
|
||||
# Note: use `[/.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
|
@ -124,9 +124,9 @@ trap "rmdir '$lockdir'; exit 1" 1 2 15
|
|||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
|
@ -138,6 +138,5 @@ exit $ret
|
|||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
INSTALL_0600 = $(INSTALL) -m 0600
|
||||
|
||||
SECFILES = upsd.conf.sample upsd.users.sample
|
||||
SECFILES = upsmon.conf.sample upsd.conf.sample upsd.users.sample
|
||||
PUBFILES = nut.conf.sample ups.conf.sample
|
||||
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
||||
upsstats-single.html.sample
|
||||
|
@ -14,28 +14,4 @@ else
|
|||
endif
|
||||
|
||||
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
|
||||
nodist_sysconf_DATA = upssched.conf.sample upsmon.conf.sample
|
||||
|
||||
SPELLCHECK_SRC = $(dist_sysconf_DATA) \
|
||||
upssched.conf.sample.in upsmon.conf.sample.in
|
||||
|
||||
# NOTE: Due to portability, we do not use a GNU percent-wildcard extension:
|
||||
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here
|
||||
# by a wildcard target in case the make implementation can put the two together.
|
||||
*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
|
||||
.sample.sample-spellchecked:
|
||||
$(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
.in.in-spellchecked:
|
||||
$(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
spellcheck spellcheck-interactive spellcheck-sortdict:
|
||||
$(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
CLEANFILES = *.pdf *.html *-spellchecked
|
||||
nodist_sysconf_DATA = upssched.conf.sample
|
||||
|
|
309
conf/Makefile.in
309
conf/Makefile.in
|
@ -1,8 +1,9 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -17,61 +18,6 @@
|
|||
# Network UPS Tools: conf
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -92,70 +38,38 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = conf
|
||||
DIST_COMMON = $(am__dist_sysconf_DATA_DIST) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/upssched.conf.sample.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_c_pragmas.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/ax_run_or_link_ifelse.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_asciidoc.m4 \
|
||||
$(top_srcdir)/m4/nut_check_cppcheck.m4 \
|
||||
$(top_srcdir)/m4/nut_check_headers_windows.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_ipv6.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_check_pkgconfig.m4 \
|
||||
$(top_srcdir)/m4/nut_check_python.m4 \
|
||||
$(top_srcdir)/m4/nut_compiler_family.m4 \
|
||||
$(top_srcdir)/m4/nut_func_getnameinfo_argtypes.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_sysconf_DATA_DIST) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = upsmon.conf.sample upssched.conf.sample
|
||||
CONFIG_CLEAN_FILES = upssched.conf.sample
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__dist_sysconf_DATA_DIST = upsd.conf.sample upsd.users.sample \
|
||||
nut.conf.sample ups.conf.sample hosts.conf.sample \
|
||||
upsset.conf.sample upsstats.html.sample \
|
||||
am__dist_sysconf_DATA_DIST = upsmon.conf.sample upsd.conf.sample \
|
||||
upsd.users.sample nut.conf.sample ups.conf.sample \
|
||||
hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
||||
upsstats-single.html.sample
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
|
@ -178,27 +92,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
|||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(sysconfdir)"
|
||||
DATA = $(dist_sysconf_DATA) $(nodist_sysconf_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(srcdir)/upsmon.conf.sample.in \
|
||||
$(srcdir)/upssched.conf.sample.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUGPARSE = @AUGPARSE@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -209,25 +108,13 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPCHECK = @CPPCHECK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBLATEX = @DBLATEX@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DRVPATH = @DRVPATH@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
|
@ -236,8 +123,12 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||
GREP = @GREP@
|
||||
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
|
||||
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
|
||||
HAL_FDI_PATH = @HAL_FDI_PATH@
|
||||
HAL_USER = @HAL_USER@
|
||||
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -245,51 +136,34 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LIBS = @LIBNETSNMP_LIBS@
|
||||
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
|
||||
LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LN_S_R = @LN_S_R@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NUT_DATADIR = @NUT_DATADIR@
|
||||
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||
NUT_NETVERSION = @NUT_NETVERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_NAME = @OS_NAME@
|
||||
|
@ -303,46 +177,29 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PIDPATH = @PIDPATH@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
SBINDIR = @SBINDIR@
|
||||
SED = @SED@
|
||||
SERLIBS = @SERLIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||
STATEPATH = @STATEPATH@
|
||||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
TREE_VERSION = @TREE_VERSION@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
XMLLINT = @XMLLINT@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
auglensdir = @auglensdir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -353,12 +210,8 @@ builddir = @builddir@
|
|||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dummy_PKG_CONFIG = @dummy_PKG_CONFIG@
|
||||
dummy_PKG_CONFIG_CFLAGS = @dummy_PKG_CONFIG_CFLAGS@
|
||||
dummy_PKG_CONFIG_LIBS = @dummy_PKG_CONFIG_LIBS@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
|
@ -375,23 +228,19 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
now = @now@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdshutdowndir = @systemdshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
|
@ -402,7 +251,7 @@ top_builddir = @top_builddir@
|
|||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
INSTALL_0600 = $(INSTALL) -m 0600
|
||||
SECFILES = upsd.conf.sample upsd.users.sample
|
||||
SECFILES = upsmon.conf.sample upsd.conf.sample upsd.users.sample
|
||||
PUBFILES = nut.conf.sample ups.conf.sample
|
||||
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
||||
upsstats-single.html.sample
|
||||
|
@ -410,16 +259,10 @@ CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
|||
@WITH_CGI_FALSE@CGI_INSTALL =
|
||||
@WITH_CGI_TRUE@CGI_INSTALL = $(CGIPUB)
|
||||
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
|
||||
nodist_sysconf_DATA = upssched.conf.sample upsmon.conf.sample
|
||||
SPELLCHECK_SRC = $(dist_sysconf_DATA) \
|
||||
upssched.conf.sample.in upsmon.conf.sample.in
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
CLEANFILES = *.pdf *.html *-spellchecked
|
||||
nodist_sysconf_DATA = upssched.conf.sample
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .in .in-spellchecked .sample .sample-spellchecked
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
|
@ -432,13 +275,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu conf/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu conf/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -449,8 +293,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
upsmon.conf.sample: $(top_builddir)/config.status $(srcdir)/upsmon.conf.sample.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
upssched.conf.sample: $(top_builddir)/config.status $(srcdir)/upssched.conf.sample.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
|
@ -461,11 +303,8 @@ clean-libtool:
|
|||
-rm -rf .libs _libs
|
||||
install-dist_sysconfDATA: $(dist_sysconf_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)"
|
||||
@list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
|
@ -479,14 +318,13 @@ uninstall-dist_sysconfDATA:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir)
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files
|
||||
install-nodist_sysconfDATA: $(nodist_sysconf_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)"
|
||||
@list='$(nodist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
|
@ -500,18 +338,17 @@ uninstall-nodist_sysconfDATA:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nodist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
@ -558,19 +395,13 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
@ -579,7 +410,6 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
@ -649,39 +479,18 @@ uninstall-am: uninstall-dist_sysconfDATA uninstall-nodist_sysconfDATA
|
|||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-dist_sysconfDATA install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man \
|
||||
install-nodist_sysconfDATA install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dist_sysconfDATA \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-nodist_sysconfDATA install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am uninstall-dist_sysconfDATA \
|
||||
uninstall-nodist_sysconfDATA
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-dist_sysconfDATA uninstall-nodist_sysconfDATA
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# NOTE: Due to portability, we do not use a GNU percent-wildcard extension:
|
||||
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here
|
||||
# by a wildcard target in case the make implementation can put the two together.
|
||||
*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
|
||||
.sample.sample-spellchecked:
|
||||
$(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
.in.in-spellchecked:
|
||||
$(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
spellcheck spellcheck-interactive spellcheck-sortdict:
|
||||
$(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
|
@ -24,16 +24,5 @@
|
|||
# Since this MODE is opened to the network, a special care should be applied
|
||||
# to security concerns.
|
||||
# - netclient: this mode only requires upsmon.
|
||||
#
|
||||
# IMPORTANT NOTE:
|
||||
# This file is intended to be sourced by standard POSIX shell scripts (so
|
||||
# there is no guaranteed `export VAR=VAL` syntax) and by systemd on Linux.
|
||||
# You MUST NOT use spaces around the equal sign!
|
||||
|
||||
MODE=none
|
||||
|
||||
# Uncomment this to allow starting the service even if ups.conf has no device
|
||||
# sections at the moment. This environment variable overrides the built-in
|
||||
# "false" and an optional same-named default flag that can be set in upsd.conf:
|
||||
#ALLOW_NO_DEVICE=true
|
||||
#export ALLOW_NO_DEVICE
|
||||
MODE = none
|
||||
|
|
|
@ -30,97 +30,17 @@
|
|||
#
|
||||
# If you have a UPS called snoopy, your section header would be "[snoopy]".
|
||||
# On a system called "doghouse", the line in your upsmon.conf to monitor
|
||||
# and manage it would look something like this:
|
||||
# it would look something like this:
|
||||
#
|
||||
# MONITOR snoopy@doghouse 1 upsmonuser mypassword primary
|
||||
# MONITOR snoopy@doghouse 1 upsmonuser mypassword master
|
||||
#
|
||||
# It might look like this if monitoring in "secondary" mode (without any
|
||||
# ability to directly manage the UPS) from a different system:
|
||||
# It might look like this if monitoring in slave mode:
|
||||
#
|
||||
# MONITOR snoopy@doghouse 1 upsmonuser mypassword secondary
|
||||
# MONITOR snoopy@doghouse 1 upsmonuser mypassword slave
|
||||
#
|
||||
# Configuration directives
|
||||
# ------------------------
|
||||
#
|
||||
# These directives are used by upsdrvctl only and should be specified outside
|
||||
# of a driver definition:
|
||||
#
|
||||
# maxretry: OPTIONAL. Specify the number of attempts to start the driver(s),
|
||||
# in case of failure, before giving up. A delay of 'retrydelay' is
|
||||
# inserted between each attempt. Caution should be taken when using
|
||||
# this option, since it can impact the time taken by your system to
|
||||
# start.
|
||||
#
|
||||
# The built-in default is 1 attempt.
|
||||
#
|
||||
# retrydelay: OPTIONAL. Specify the delay between each restart attempt of the
|
||||
# driver(s), as specified by 'maxretry'. Caution should be taken
|
||||
# when using this option, since it can impact the time taken by your
|
||||
# system to start.
|
||||
#
|
||||
# The default is 5 seconds.
|
||||
#
|
||||
# chroot: OPTIONAL. Used for securing. See man page for details.
|
||||
#
|
||||
# driverpath: OPTIONAL. Used for custom setups. See man page for details.
|
||||
#
|
||||
# nowait: OPTIONAL. Tell upsdrvctl to not wait at all for the driver(s)
|
||||
# to execute the requested command. Fire and forget.
|
||||
#
|
||||
# pollinterval: OPTIONAL. The status of the UPS will be refreshed after a
|
||||
# maximum delay which is controlled by this setting (default
|
||||
# 2 seconds). This may be useful if the driver is creating too
|
||||
# much of a load on your system or network.
|
||||
# Note that some drivers also have an option called *pollfreq*
|
||||
# which controls how frequently some of the less critical
|
||||
# parameters are polled. See respective driver man pages.
|
||||
#
|
||||
|
||||
# Set maxretry to 3 by default, this should mitigate race with slow devices:
|
||||
maxretry = 3
|
||||
|
||||
# These directives can be set outside and inside a driver definition, with
|
||||
# slightly different meanings per context:
|
||||
#
|
||||
# maxstartdelay: OPTIONAL. This can be set as a global variable
|
||||
# above your first UPS definition and it can also be
|
||||
# set in a UPS section. This value controls how long
|
||||
# upsdrvctl will wait for the driver to finish starting.
|
||||
# This keeps your system from getting stuck due to a
|
||||
# broken driver or UPS.
|
||||
# The default is 45 seconds.
|
||||
#
|
||||
# debug_min: OPTIONAL. Specify a minimum debug level for all driver daemons
|
||||
# (when specified at global level), or for this driver daemon
|
||||
# (when specified in a driver section), e.g. for troubleshooting
|
||||
# a deployment. This does not directly impact the foreground or
|
||||
# background running mode. If both the global and driver level
|
||||
# `debug_min` are set, the driver-level setting takes precedence.
|
||||
# Command-line option `-D` can only increase this verbosity level.
|
||||
#
|
||||
# user, group: OPTIONAL. Overrides the compiled-in (also global-section,
|
||||
# when used in driver section) default unprivileged user/group
|
||||
# name for NUT device driver. Impacts access rights used for
|
||||
# the socket file access (group) and communication ports (user).
|
||||
#
|
||||
# synchronous: OPTIONAL. The driver work by default in asynchronous
|
||||
# mode (like *no*) with fallback to synchronous if sending
|
||||
# fails (i.e *synchronous=auto*). This means that all data
|
||||
# are pushed by the driver on the communication socket to
|
||||
# upsd (Unix socket on Unix, Named pipe on Windows) without
|
||||
# waiting for these data to be actually consumed. With
|
||||
# some HW, such as ePDUs, that can produce a lot of data,
|
||||
# asynchronous mode may cause some congestion, resulting in
|
||||
# the socket to be full, and the driver to appear as not
|
||||
# connected. By enabling the 'synchronous' flag
|
||||
# (value = 'yes'), the driver will wait for data to be
|
||||
# consumed by upsd, prior to publishing more. This can be
|
||||
# enabled either globally or per driver.
|
||||
#
|
||||
# The default is 'no' (i.e. asynchronous mode) for backward
|
||||
# compatibility of the driver behavior.
|
||||
#
|
||||
|
||||
# These directives are common to all drivers that support ups.conf:
|
||||
#
|
||||
# driver: REQUIRED. Specify the program to run to talk to this UPS.
|
||||
|
@ -129,15 +49,13 @@ maxretry = 3
|
|||
# port: REQUIRED. The serial port where your UPS is connected.
|
||||
# /dev/ttyS0 is usually the first port on Linux boxes, for example.
|
||||
#
|
||||
# sdorder: OPTIONAL. When you have multiple UPSes on your system, you
|
||||
# sdorder: optional. When you have multiple UPSes on your system, you
|
||||
# usually need to turn them off in a certain order. upsdrvctl
|
||||
# shuts down all the 0s, then the 1s, 2s, and so on. To exclude
|
||||
# a UPS from the shutdown sequence, set this to -1.
|
||||
#
|
||||
# The default value for this parameter is 0.
|
||||
#
|
||||
# desc: optional, to keep a note of the UPS purpose, location, etc.
|
||||
#
|
||||
# nolock: optional, and not recommended for use in this file.
|
||||
#
|
||||
# If you put nolock in here, the driver will not lock the
|
||||
|
@ -148,31 +66,15 @@ maxretry = 3
|
|||
# This is only intended to be used on systems where locking
|
||||
# absolutely must be disabled for the software to work.
|
||||
#
|
||||
# ignorelb: OPTIONAL. Ignore low battery condition reported by device,
|
||||
# and evaluate remaining battery charge or runtime instead.
|
||||
# See man page for details.
|
||||
# maxstartdelay: optional. This can be set as a global variable
|
||||
# above your first UPS definition and it can also be
|
||||
# set in a UPS section. This value controls how long
|
||||
# upsdrvctl will wait for the driver to finish starting.
|
||||
# This keeps your system from getting stuck due to a
|
||||
# broken driver or UPS.
|
||||
#
|
||||
# usb_set_altinterface(=num): OPTIONAL. Require that NUT calls this method
|
||||
# to set the interface, even if 0 (default). Some devices require
|
||||
# the call to initialize; others however can get stuck due to it -
|
||||
# so it is not called by default. Yet others can be composite
|
||||
# devices which use a non-zero interface to represent the UPS.
|
||||
# The default is 45 seconds.
|
||||
#
|
||||
# default.<variable>: OPTIONAL. Set a default value for <variable> which is
|
||||
# used in case the UPS doesn't provide a value, but which will be
|
||||
# overwritten if a value is available from the UPS, e.g.:
|
||||
# default.input.voltage.nominal = 230
|
||||
# will report the nominal input voltage to be 230, unless the UPS
|
||||
# eventually tells us differently.
|
||||
#
|
||||
# override.<variable>: OPTIONAL. Set a value for <value> that overrides
|
||||
# (for NUT) any value that may be read from the UPS.
|
||||
# Used for overriding values from the UPS that are clearly wrong
|
||||
# (e.g. some devices report wrong values for battery voltage):
|
||||
# override.battery.voltage.nominal = 12
|
||||
# Use with caution! This will only change the appearance of the
|
||||
# variable to the outside world (and NUT calculations), internally
|
||||
# in the UPS the original value is used.
|
||||
#
|
||||
# Anything else is passed through to the hardware-specific part of
|
||||
# the driver.
|
||||
|
@ -180,11 +82,11 @@ maxretry = 3
|
|||
# Examples
|
||||
# --------
|
||||
#
|
||||
# A simple example for a UPS called "powerpal" that uses the blazer_ser
|
||||
# A simple example for a UPS called "powerpal" that uses the megatec
|
||||
# driver on /dev/ttyS0 is:
|
||||
#
|
||||
# [powerpal]
|
||||
# driver = blazer_ser
|
||||
# driver = megatec
|
||||
# port = /dev/ttyS0
|
||||
# desc = "Web server"
|
||||
#
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
# This file contains access control data, you should keep it secure.
|
||||
#
|
||||
# It should only be readable by the user that upsd becomes. See the FAQ.
|
||||
#
|
||||
# Each entry below provides usage and default value.
|
||||
#
|
||||
# For more information, refer to upsd.conf manual page.
|
||||
|
||||
# =======================================================================
|
||||
# MAXAGE <seconds>
|
||||
|
@ -22,47 +18,12 @@
|
|||
# for notifications from upsd about staleness.
|
||||
|
||||
# =======================================================================
|
||||
# TRACKINGDELAY <seconds>
|
||||
# TRACKINGDELAY 3600
|
||||
#
|
||||
# This defaults to 1 hour. When instant commands and variables setting status
|
||||
# tracking is enabled, status execution information are kept during this
|
||||
# amount of time, and then cleaned up.
|
||||
|
||||
# =======================================================================
|
||||
# ALLOW_NO_DEVICE <Boolean>
|
||||
# ALLOW_NO_DEVICE true
|
||||
#
|
||||
# Normally upsd requires that at least one device section is defined in ups.conf
|
||||
# when the daemon starts, to serve its data. For automatically managed services
|
||||
# it may be preferred to have upsd always running, and reload the configuration
|
||||
# when power devices become defined.
|
||||
#
|
||||
# Boolean values 'true', 'yes', 'on' and '1' mean that the server would not
|
||||
# refuse to start with zero device sections found in ups.conf.
|
||||
#
|
||||
# Boolean values 'false', 'no', 'off' and '0' mean that the server should refuse
|
||||
# to start if zero device sections were found in ups.conf. This is the default.
|
||||
|
||||
# =======================================================================
|
||||
# STATEPATH <path>
|
||||
# STATEPATH /var/run/nut
|
||||
#
|
||||
# Tell upsd to look for the driver state sockets in 'path' rather
|
||||
# than the default that was compiled into the program.
|
||||
|
||||
# =======================================================================
|
||||
# LISTEN <IP address or name> [<port>]
|
||||
# LISTEN <address> [<port>]
|
||||
# LISTEN 127.0.0.1 3493
|
||||
# LISTEN ::1 3493
|
||||
# LISTEN myhostname 83493
|
||||
# LISTEN myhostname.mydomain
|
||||
#
|
||||
# This defaults to the localhost listening addresses and port 3493.
|
||||
# In case of IP v4 or v6 disabled kernel, only the available one will be used.
|
||||
#
|
||||
# You may specify each interface IP address or name that you want upsd to
|
||||
# listen on for connections, optionally with a port number.
|
||||
# This defaults to the localhost listening address and port 3493. You
|
||||
# may specify each interface you want upsd to listen on for connections,
|
||||
# optionally with a port number.
|
||||
#
|
||||
# You may need this if you have multiple interfaces on your machine and
|
||||
# you don't want upsd to listen to all interfaces (for instance on a
|
||||
|
@ -73,96 +34,8 @@
|
|||
|
||||
# =======================================================================
|
||||
# MAXCONN <connections>
|
||||
# MAXCONN 1024
|
||||
#
|
||||
# This defaults to maximum number allowed on your system. Each UPS, each
|
||||
# LISTEN address and each client count as one connection. If the server
|
||||
# runs out of connections, it will no longer accept new incoming client
|
||||
# connections. Only set this if you know exactly what you're doing.
|
||||
|
||||
# =======================================================================
|
||||
# CERTFILE <certificate file>
|
||||
# CERTFILE /usr/local/ups/etc/upsd.pem
|
||||
#
|
||||
# When compiled with SSL support with OpenSSL backend,
|
||||
# you can enter the certificate file here.
|
||||
# The certificates must be in PEM format and must be sorted starting with
|
||||
# the subject's certificate (server certificate), followed by intermediate
|
||||
# CA certificates (if applicable_ and the highest level (root) CA. It should
|
||||
# end with the server key. See 'docs/security.txt' or the Security chapter of
|
||||
# NUT user manual for more information on the SSL support in NUT.
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# =======================================================================
|
||||
# CERTPATH <certificate file or directory>
|
||||
# CERTPATH /usr/local/ups/etc/cert/upsd
|
||||
#
|
||||
# When compiled with SSL support with NSS backend,
|
||||
# you can enter the certificate path here.
|
||||
# Certificates are stored in a dedicated database (split into 3 files).
|
||||
# Specify the path of the database directory.
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# =======================================================================
|
||||
# CERTIDENT <certificate name> <database password>
|
||||
# CERTIDENT "my nut server" "MyPasSw0rD"
|
||||
#
|
||||
# When compiled with SSL support with NSS backend,
|
||||
# you can specify the certificate name to retrieve from database to
|
||||
# authenticate itself and the password
|
||||
# required to access certificate related private key.
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# =======================================================================
|
||||
# CERTREQUEST <certificate request level>
|
||||
# CERTREQUEST REQUIRE
|
||||
#
|
||||
# When compiled with SSL support with NSS backend and client certificate
|
||||
# validation (disabled by default, see 'docs/security.txt'),
|
||||
# you can specify if upsd requests or requires client's' certificates.
|
||||
# Possible values are :
|
||||
# - 0 to not request to clients to provide any certificate
|
||||
# - 1 to require to all clients a certificate
|
||||
# - 2 to require to all clients a valid certificate
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# =======================================================================
|
||||
# DISABLE_WEAK_SSL <Boolean>
|
||||
# DISABLE_WEAK_SSL true
|
||||
#
|
||||
# Tell upsd to disable older/weak SSL/TLS protocols and ciphers.
|
||||
#
|
||||
# With relatively recent versions of OpenSSL or NSS it will be restricted
|
||||
# to TLSv1.2 or better.
|
||||
#
|
||||
# Unless you have really ancient clients, you probably want to enable this.
|
||||
# Currently disabled by default to ensure compatibility with existing setups.
|
||||
|
||||
# =======================================================================
|
||||
# DEBUG_MIN <Integer>
|
||||
# DEBUG_MIN 2
|
||||
#
|
||||
# Optionally specify a minimum debug level for `upsd` data daemon, e.g. for
|
||||
# troubleshooting a deployment, without impacting foreground or background
|
||||
# running mode directly, and without need to edit init-scripts or service
|
||||
# unit definitions. Note that command-line option `-D` can only increase
|
||||
# this verbosity level.
|
||||
#
|
||||
# NOTE: if the running daemon receives a `reload` command, presence of the
|
||||
# `DEBUG_MIN NUMBER` value in the configuration file can be used to tune
|
||||
# debugging verbosity in the running service daemon (it is recommended to
|
||||
# comment it away or set the minimum to explicit zero when done, to avoid
|
||||
# huge journals and I/O system abuse). Keep in mind that for this run-time
|
||||
# tuning, the `DEBUG_MIN` value *present* in *reloaded* configuration files
|
||||
# is applied instantly and overrides any previously set value, from file
|
||||
# or CLI options, regardless of older logging level being higher or lower
|
||||
# than the newly found number; a missing (or commented away) value however
|
||||
# does not change the previously active logging verbosity.
|
||||
|
|
|
@ -48,14 +48,6 @@
|
|||
# instcmds = ALL
|
||||
#
|
||||
|
||||
#
|
||||
# --- Configuring for a user who can execute tests only
|
||||
#
|
||||
# [testuser]
|
||||
# password = pass
|
||||
# instcmds = test.battery.start
|
||||
# instcmds = test.battery.stop
|
||||
|
||||
#
|
||||
# --- Configuring for upsmon
|
||||
#
|
||||
|
@ -63,13 +55,10 @@
|
|||
#
|
||||
# [upsmon]
|
||||
# password = pass
|
||||
# upsmon primary
|
||||
# upsmon master
|
||||
# or
|
||||
# upsmon secondary
|
||||
# upsmon slave
|
||||
#
|
||||
# The matching MONITOR line in your upsmon.conf would look like this:
|
||||
#
|
||||
# MONITOR myups@localhost 1 upsmon pass primary (or secondary)
|
||||
#
|
||||
# See comments in the upsmon.conf(.sample) file for details about this
|
||||
# keyword and the difference of NUT secondary and primary systems.
|
||||
# MONITOR myups@localhost 1 upsmon pass master (or slave)
|
||||
|
|
299
conf/upsmon.conf.sample
Normal file
299
conf/upsmon.conf.sample
Normal file
|
@ -0,0 +1,299 @@
|
|||
# Network UPS Tools: example upsmon configuration
|
||||
#
|
||||
# This file contains passwords, so keep it secure.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# RUN_AS_USER <userid>
|
||||
#
|
||||
# By default, upsmon splits into two processes. One stays as root and
|
||||
# waits to run the SHUTDOWNCMD. The other one switches to another userid
|
||||
# and does everything else.
|
||||
#
|
||||
# The default nonprivileged user is set at compile-time with
|
||||
# 'configure --with-user=...'.
|
||||
#
|
||||
# You can override it with '-u <user>' when starting upsmon, or just
|
||||
# define it here for convenience.
|
||||
#
|
||||
# Note: if you plan to use the reload feature, this file (upsmon.conf)
|
||||
# must be readable by this user! Since it contains passwords, DO NOT
|
||||
# make it world-readable. Also, do not make it writable by the upsmon
|
||||
# user, since it creates an opportunity for an attack by changing the
|
||||
# SHUTDOWNCMD to something malicious.
|
||||
#
|
||||
# For best results, you should create a new normal user like "nutmon",
|
||||
# and make it a member of a "nut" group or similar. Then specify it
|
||||
# here and grant read access to the upsmon.conf for that group.
|
||||
#
|
||||
# This user should not have write access to upsmon.conf.
|
||||
#
|
||||
# RUN_AS_USER nutmon
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MONITOR <system> <powervalue> <username> <password> ("master"|"slave")
|
||||
#
|
||||
# List systems you want to monitor. Not all of these may supply power
|
||||
# to the system running upsmon, but if you want to watch it, it has to
|
||||
# be in this section.
|
||||
#
|
||||
# You must have at least one of these declared.
|
||||
#
|
||||
# <system> is a UPS identifier in the form <upsname>@<hostname>[:<port>]
|
||||
# like ups@localhost, su700@mybox, etc.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# - "su700@mybox" means a UPS called "su700" on a system called "mybox"
|
||||
#
|
||||
# - "fenton@bigbox:5678" is a UPS called "fenton" on a system called
|
||||
# "bigbox" which runs upsd on port "5678".
|
||||
#
|
||||
# The UPS names like "su700" and "fenton" are set in your ups.conf
|
||||
# in [brackets] which identify a section for a particular driver.
|
||||
#
|
||||
# If the ups.conf on host "doghouse" has a section called "snoopy", the
|
||||
# identifier for it would be "snoopy@doghouse".
|
||||
#
|
||||
# <powervalue> is an integer - the number of power supplies that this UPS
|
||||
# feeds on this system. Most computers only have one power supply, so this
|
||||
# is normally set to 1. You need a pretty big or special box to have any
|
||||
# other value here.
|
||||
#
|
||||
# You can also set this to 0 for a system that doesn't supply any power,
|
||||
# but you still want to monitor. Use this when you want to hear about
|
||||
# changes for a given UPS without shutting down when it goes critical,
|
||||
# unless <powervalue> is 0.
|
||||
#
|
||||
# <username> and <password> must match an entry in that system's
|
||||
# upsd.users. If your username is "monmaster" and your password is
|
||||
# "blah", the upsd.users would look like this:
|
||||
#
|
||||
# [monmaster]
|
||||
# password = blah
|
||||
# upsmon master (or slave)
|
||||
#
|
||||
# "master" means this system will shutdown last, allowing the slaves
|
||||
# time to shutdown first.
|
||||
#
|
||||
# "slave" means this system shuts down immediately when power goes critical.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# MONITOR myups@bigserver 1 monmaster blah master
|
||||
# MONITOR su700@server.example.com 1 upsmon secretpass slave
|
||||
# MONITOR myups@localhost 1 upsmon pass master (or slave)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MINSUPPLIES <num>
|
||||
#
|
||||
# Give the number of power supplies that must be receiving power to keep
|
||||
# this system running. Most systems have one power supply, so you would
|
||||
# put "1" in this field.
|
||||
#
|
||||
# Large/expensive server type systems usually have more, and can run with
|
||||
# a few missing. The HP NetServer LH4 can run with 2 out of 4, for example,
|
||||
# so you'd set that to 2. The idea is to keep the box running as long
|
||||
# as possible, right?
|
||||
#
|
||||
# Obviously you have to put the redundant supplies on different UPS circuits
|
||||
# for this to make sense! See big-servers.txt in the docs subdirectory
|
||||
# for more information and ideas on how to use this feature.
|
||||
|
||||
MINSUPPLIES 1
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# SHUTDOWNCMD "<command>"
|
||||
#
|
||||
# upsmon runs this command when the system needs to be brought down.
|
||||
#
|
||||
# This should work just about everywhere ... if it doesn't, well, change it.
|
||||
|
||||
SHUTDOWNCMD "/sbin/shutdown -h +0"
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYCMD <command>
|
||||
#
|
||||
# upsmon calls this to send messages when things happen
|
||||
#
|
||||
# This command is called with the full text of the message as one argument.
|
||||
# The environment string NOTIFYTYPE will contain the type string of
|
||||
# whatever caused this event to happen.
|
||||
#
|
||||
# Note that this is only called for NOTIFY events that have EXEC set with
|
||||
# NOTIFYFLAG. See NOTIFYFLAG below for more details.
|
||||
#
|
||||
# Making this some sort of shell script might not be a bad idea. For more
|
||||
# information and ideas, see pager.txt in the docs directory.
|
||||
#
|
||||
# Example:
|
||||
# NOTIFYCMD /usr/local/ups/bin/notifyme
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# POLLFREQ <n>
|
||||
#
|
||||
# Polling frequency for normal activities, measured in seconds.
|
||||
#
|
||||
# Adjust this to keep upsmon from flooding your network, but don't make
|
||||
# it too high or it may miss certain short-lived power events.
|
||||
|
||||
POLLFREQ 5
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# POLLFREQALERT <n>
|
||||
#
|
||||
# Polling frequency in seconds while UPS on battery.
|
||||
#
|
||||
# You can make this number lower than POLLFREQ, which will make updates
|
||||
# faster when any UPS is running on battery. This is a good way to tune
|
||||
# network load if you have a lot of these things running.
|
||||
#
|
||||
# The default is 5 seconds for both this and POLLFREQ.
|
||||
|
||||
POLLFREQALERT 5
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# HOSTSYNC - How long upsmon will wait before giving up on another upsmon
|
||||
#
|
||||
# The master upsmon process uses this number when waiting for slaves to
|
||||
# disconnect once it has set the forced shutdown (FSD) flag. If they
|
||||
# don't disconnect after this many seconds, it goes on without them.
|
||||
#
|
||||
# Similarly, upsmon slave processes wait up to this interval for the
|
||||
# master upsmon to set FSD when a UPS they are monitoring goes critical -
|
||||
# that is, on battery and low battery. If the master doesn't do its job,
|
||||
# the slaves will shut down anyway to avoid damage to the file systems.
|
||||
#
|
||||
# This "wait for FSD" is done to avoid races where the status changes
|
||||
# to critical and back between polls by the master.
|
||||
|
||||
HOSTSYNC 15
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# DEADTIME - Interval to wait before declaring a stale ups "dead"
|
||||
#
|
||||
# upsmon requires a UPS to provide status information every few seconds
|
||||
# (see POLLFREQ and POLLFREQALERT) to keep things updated. If the status
|
||||
# fetch fails, the UPS is marked stale. If it stays stale for more than
|
||||
# DEADTIME seconds, the UPS is marked dead.
|
||||
#
|
||||
# A dead UPS that was last known to be on battery is assumed to have gone
|
||||
# to a low battery condition. This may force a shutdown if it is providing
|
||||
# a critical amount of power to your system.
|
||||
#
|
||||
# Note: DEADTIME should be a multiple of POLLFREQ and POLLFREQALERT.
|
||||
# Otherwise you'll have "dead" UPSes simply because upsmon isn't polling
|
||||
# them quickly enough. Rule of thumb: take the larger of the two
|
||||
# POLLFREQ values, and multiply by 3.
|
||||
|
||||
DEADTIME 15
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# POWERDOWNFLAG - Flag file for forcing UPS shutdown on the master system
|
||||
#
|
||||
# upsmon will create a file with this name in master mode when it's time
|
||||
# to shut down the load. You should check for this file's existence in
|
||||
# your shutdown scripts and run 'upsdrvctl shutdown' if it exists.
|
||||
#
|
||||
# See the shutdown.txt file in the docs subdirectory for more information.
|
||||
|
||||
POWERDOWNFLAG /etc/killpower
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYMSG - change messages sent by upsmon when certain events occur
|
||||
#
|
||||
# You can change the default messages to something else if you like.
|
||||
#
|
||||
# NOTIFYMSG <notify type> "message"
|
||||
#
|
||||
# NOTIFYMSG ONLINE "UPS %s on line power"
|
||||
# NOTIFYMSG ONBATT "UPS %s on battery"
|
||||
# NOTIFYMSG LOWBATT "UPS %s battery is low"
|
||||
# NOTIFYMSG FSD "UPS %s: forced shutdown in progress"
|
||||
# NOTIFYMSG COMMOK "Communications with UPS %s established"
|
||||
# NOTIFYMSG COMMBAD "Communications with UPS %s lost"
|
||||
# NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"
|
||||
# NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"
|
||||
# NOTIFYMSG NOCOMM "UPS %s is unavailable"
|
||||
# NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"
|
||||
#
|
||||
# Note that %s is replaced with the identifier of the UPS in question.
|
||||
#
|
||||
# Possible values for <notify type>:
|
||||
#
|
||||
# ONLINE : UPS is back online
|
||||
# ONBATT : UPS is on battery
|
||||
# LOWBATT : UPS has a low battery (if also on battery, it's "critical")
|
||||
# FSD : UPS is being shutdown by the master (FSD = "Forced Shutdown")
|
||||
# COMMOK : Communications established with the UPS
|
||||
# COMMBAD : Communications lost to the UPS
|
||||
# SHUTDOWN : The system is being shutdown
|
||||
# REPLBATT : The UPS battery is bad and needs to be replaced
|
||||
# NOCOMM : A UPS is unavailable (can't be contacted for monitoring)
|
||||
# NOPARENT : The process that shuts down the system has died (shutdown impossible)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
|
||||
#
|
||||
# By default, upsmon sends walls (global messages to all logged in users)
|
||||
# and writes to the syslog when things happen. You can change this.
|
||||
#
|
||||
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
|
||||
#
|
||||
# NOTIFYFLAG ONLINE SYSLOG+WALL
|
||||
# NOTIFYFLAG ONBATT SYSLOG+WALL
|
||||
# NOTIFYFLAG LOWBATT SYSLOG+WALL
|
||||
# NOTIFYFLAG FSD SYSLOG+WALL
|
||||
# NOTIFYFLAG COMMOK SYSLOG+WALL
|
||||
# NOTIFYFLAG COMMBAD SYSLOG+WALL
|
||||
# NOTIFYFLAG SHUTDOWN SYSLOG+WALL
|
||||
# NOTIFYFLAG REPLBATT SYSLOG+WALL
|
||||
# NOTIFYFLAG NOCOMM SYSLOG+WALL
|
||||
# NOTIFYFLAG NOPARENT SYSLOG+WALL
|
||||
#
|
||||
# Possible values for the flags:
|
||||
#
|
||||
# SYSLOG - Write the message in the syslog
|
||||
# WALL - Write the message to all users on the system
|
||||
# EXEC - Execute NOTIFYCMD (see above) with the message
|
||||
# IGNORE - Don't do anything
|
||||
#
|
||||
# If you use IGNORE, don't use any other flags on the same line.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# RBWARNTIME - replace battery warning time in seconds
|
||||
#
|
||||
# upsmon will normally warn you about a battery that needs to be replaced
|
||||
# every 43200 seconds, which is 12 hours. It does this by triggering a
|
||||
# NOTIFY_REPLBATT which is then handled by the usual notify structure
|
||||
# you've defined above.
|
||||
#
|
||||
# If this number is not to your liking, override it here.
|
||||
|
||||
RBWARNTIME 43200
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOCOMMWARNTIME - no communications warning time in seconds
|
||||
#
|
||||
# upsmon will let you know through the usual notify system if it can't
|
||||
# talk to any of the UPS entries that are defined in this file. It will
|
||||
# trigger a NOTIFY_NOCOMM by default every 300 seconds unless you
|
||||
# change the interval with this directive.
|
||||
|
||||
NOCOMMWARNTIME 300
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# FINALDELAY - last sleep interval before shutting down the system
|
||||
#
|
||||
# On a master, upsmon will wait this long after sending the NOTIFY_SHUTDOWN
|
||||
# before executing your SHUTDOWNCMD. If you need to do something in between
|
||||
# those events, increase this number. Remember, at this point your UPS is
|
||||
# almost depleted, so don't make this too high.
|
||||
#
|
||||
# Alternatively, you can set this very low so you don't wait around when
|
||||
# it's time to shut down. Some UPSes don't give much warning for low
|
||||
# battery and will require a value of 0 here for a safe shutdown.
|
||||
#
|
||||
# Note: If FINALDELAY on the slave is greater than HOSTSYNC on the master,
|
||||
# the master will give up waiting for the slave to disconnect.
|
||||
|
||||
FINALDELAY 5
|
|
@ -1,453 +0,0 @@
|
|||
# Network UPS Tools: example upsmon configuration
|
||||
#
|
||||
# This file contains passwords, so keep it secure.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# RUN_AS_USER <userid>
|
||||
#
|
||||
# By default, upsmon splits into two processes. One stays as root and
|
||||
# waits to run the SHUTDOWNCMD. The other one switches to another userid
|
||||
# and does everything else.
|
||||
#
|
||||
# The default unprivileged user is set at compile-time with the option
|
||||
# 'configure --with-user=...'
|
||||
#
|
||||
# You can override it with '-u <user>' when starting upsmon, or just
|
||||
# define it here for convenience.
|
||||
#
|
||||
# Note: if you plan to use the reload feature, this file (upsmon.conf)
|
||||
# must be readable by this user! Since it contains passwords, DO NOT
|
||||
# make it world-readable. Also, do not make it writable by the upsmon
|
||||
# user, since it creates an opportunity for an attack by changing the
|
||||
# SHUTDOWNCMD to something malicious.
|
||||
#
|
||||
# For best results, you should create a new normal user like "nutmon",
|
||||
# and make it a member of a "nut" group or similar. Then specify it
|
||||
# here and grant read access to the upsmon.conf for that group.
|
||||
#
|
||||
# This user should not have write access to upsmon.conf.
|
||||
#
|
||||
# RUN_AS_USER @RUN_AS_USER@
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MONITOR <system> <powervalue> <username> <password> ("primary"|"secondary")
|
||||
#
|
||||
# List systems you want to monitor. Not all of these may supply power
|
||||
# to the system running upsmon, but if you want to watch it, it has to
|
||||
# be in this section.
|
||||
#
|
||||
# You must have at least one of these declared.
|
||||
#
|
||||
# <system> is a UPS identifier in the form <upsname>@<hostname>[:<port>]
|
||||
# like ups@localhost, su700@mybox, etc.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# - "su700@mybox" means a UPS called "su700" on a system called "mybox"
|
||||
#
|
||||
# - "fenton@bigbox:5678" is a UPS called "fenton" on a system called
|
||||
# "bigbox" which runs upsd on port "5678".
|
||||
#
|
||||
# The UPS names like "su700" and "fenton" are set in your ups.conf
|
||||
# in [brackets] which identify a section for a particular driver.
|
||||
#
|
||||
# If the ups.conf on host "doghouse" has a section called "snoopy", the
|
||||
# identifier for it would be "snoopy@doghouse".
|
||||
#
|
||||
# <powervalue> is an integer - the number of power supplies that this UPS
|
||||
# feeds on this system. Most personal computers only have one power supply,
|
||||
# so this value is normally set to 1, while most modern servers have at least
|
||||
# two. You need a pretty big or special box to have any other value here.
|
||||
#
|
||||
# You can also set this to 0 for a system that doesn't take any power
|
||||
# from the MONITORed supply, which you still want to monitor (e.g. for an
|
||||
# administrative workstation fed from a different circuit than the datacenter
|
||||
# servers it monitors). Use <powervalue> if 0 when you want to hear about
|
||||
# changes for a given UPS without shutting down when it goes critical.
|
||||
#
|
||||
# <username> and <password> must match an entry in that system's
|
||||
# upsd.users. If your username is "upsmon" and your password is
|
||||
# "blah", the upsd.users would look like this:
|
||||
#
|
||||
# [upsmon]
|
||||
# password = blah
|
||||
# upsmon primary # (or secondary)
|
||||
#
|
||||
# "primary" means this system will shutdown last, allowing the secondary
|
||||
# systems time to shutdown first.
|
||||
#
|
||||
# "secondary" means this system shuts down immediately when power goes
|
||||
# critical and less than MINSUPPLIES power sources have reliable input feeds.
|
||||
#
|
||||
# The general assumption is that the "primary" system is the one with direct
|
||||
# connection to an UPS (such as serial or USB cable), so the primary system
|
||||
# runs the NUT driver and 'upsd' server locally and can manage the device,
|
||||
# and it would often tell the UPS to completely power itself off as a step
|
||||
# in power-race avoidance (see POWERDOWNFLAG for details).
|
||||
#
|
||||
# Also, since the primary system stays up the longest, it suffers higher risks
|
||||
# of ungraceful shutdown if the estimation of remaining runtime (or of the
|
||||
# time it takes to shut down this system) was guessed wrong. By consequence,
|
||||
# the "secondary" systems typically monitor the power environment state
|
||||
# through the 'upsd' processes running on the remote (often "primary") systems
|
||||
# and do not directly interact with an UPS (no local NUT drivers are running
|
||||
# on the secondary systems). As such, secondaries typically shut down as
|
||||
# soon as there is a sufficiently long power outage, or a low-battery alert
|
||||
# from the UPS, or a loss of connection to the primary while the power was
|
||||
# last known to be missing.
|
||||
#
|
||||
# This assumption and configuration can also make sense for networked UPSes,
|
||||
# where a rack full of servers might overload the communications capacity
|
||||
# of the networked management card on the UPS - in this case you might either
|
||||
# reduce the 'snmp-ups' or 'netxml-ups' driver polling rate, or dedicate a
|
||||
# "primary" server and set up the rest as "secondary" systems.
|
||||
#
|
||||
# In case of such large setups as mentioned above, beware also that shutdown
|
||||
# times of the rack done all at once can substantially differ from smaller
|
||||
# scale experiments with single-server shutdowns, since systems can compete
|
||||
# for shared storage and other limited resources as they go down (and also
|
||||
# not everyone may safely shut down simultaneously - e.g. a NAS or DB server
|
||||
# would better go down after all its clients). You would be well served by
|
||||
# higher-end UPSes with manageable thresholds to declare a critical state.
|
||||
#
|
||||
# Examples:
|
||||
#
|
||||
# MONITOR myups@bigserver 1 upswired blah primary
|
||||
# MONITOR su700@server.example.com 1 upsmon secretpass secondary
|
||||
# MONITOR myups@localhost 1 upsmon pass primary # (or secondary)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MINSUPPLIES <num>
|
||||
#
|
||||
# Give the number of power supplies that must be receiving power to keep
|
||||
# this system running. Most systems have one power supply, so you would
|
||||
# put "1" in this field.
|
||||
#
|
||||
# Large/expensive server type systems usually have more, and can run with
|
||||
# a few missing. Some of these can run with 2 out of 4, for example,
|
||||
# so you'd set that to 2. The idea is to keep the box running as long
|
||||
# as possible, right?
|
||||
#
|
||||
# Obviously you have to put the redundant supplies on different UPS circuits
|
||||
# for this to make sense! See big-servers.txt in the docs subdirectory
|
||||
# for more information and ideas on how to use this feature.
|
||||
|
||||
MINSUPPLIES 1
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# SHUTDOWNCMD "<command>"
|
||||
#
|
||||
# upsmon runs this command when the system needs to be brought down.
|
||||
#
|
||||
# This should work just about everywhere ... if it doesn't, well, change it,
|
||||
# perhaps to a more complicated custom script.
|
||||
#
|
||||
# Note that while you experiment with the initial setup and want to test how
|
||||
# your configuration reacts to power state changes and ultimately when power
|
||||
# is reported to go critical, but do not want your system to actually turn
|
||||
# off, consider setting the SHUTDOWNCMD temporarily to do something benign -
|
||||
# such as posting a message with 'logger' or 'wall' or 'mailx'. Do be careful
|
||||
# to plug the UPS back into the wall in a timely fashion.
|
||||
|
||||
SHUTDOWNCMD "/sbin/shutdown -h +0"
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYCMD <command>
|
||||
#
|
||||
# upsmon calls this to send messages when things happen
|
||||
#
|
||||
# This command is called with the full text of the message (from NOTIFYMSG)
|
||||
# as one argument.
|
||||
#
|
||||
# The environment string NOTIFYTYPE will contain the type string of
|
||||
# whatever caused this event to happen.
|
||||
#
|
||||
# The environment string UPSNAME will contain the name of the system/device
|
||||
# that generated the change.
|
||||
#
|
||||
# Note that this is only called for NOTIFY events that have EXEC set with
|
||||
# NOTIFYFLAG. See NOTIFYFLAG below for more details.
|
||||
#
|
||||
# Making this some sort of shell script might not be a bad idea.
|
||||
# Alternately you can use the upssched program as your NOTIFYCMD for some
|
||||
# more complex setups (e.g. to ease handling of notification storms).
|
||||
# For more information and ideas, see docs/scheduling.txt
|
||||
#
|
||||
# Example:
|
||||
# NOTIFYCMD @BINDIR@/notifyme
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# POLLFREQ <n>
|
||||
#
|
||||
# Polling frequency for normal activities, measured in seconds.
|
||||
#
|
||||
# Adjust this to keep upsmon from flooding your network, but don't make
|
||||
# it too high or it may miss certain short-lived power events.
|
||||
|
||||
POLLFREQ 5
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# POLLFREQALERT <n>
|
||||
#
|
||||
# Polling frequency in seconds while UPS on battery.
|
||||
#
|
||||
# You can make this number lower than POLLFREQ, which will make updates
|
||||
# faster when any UPS is running on battery. This is a good way to tune
|
||||
# network load if you have a lot of these things running.
|
||||
#
|
||||
# The default is 5 seconds for both this and POLLFREQ.
|
||||
|
||||
POLLFREQALERT 5
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# HOSTSYNC - How long upsmon will wait before giving up on another upsmon
|
||||
#
|
||||
# The primary upsmon process uses this number when waiting for secondary
|
||||
# systems to disconnect once it has set the forced shutdown (FSD) flag.
|
||||
# If they don't disconnect after this many seconds, it goes on without them.
|
||||
#
|
||||
# Similarly, upsmon secondary processes wait up to this interval for the
|
||||
# primary upsmon to set FSD when an UPS they are monitoring goes critical -
|
||||
# that is, on battery and low battery. If the primary doesn't do its job,
|
||||
# the secondaries will shut down anyway to avoid damage to the file systems.
|
||||
#
|
||||
# This "wait for FSD" is done to avoid races where the status changes
|
||||
# to critical and back between polls by the primary.
|
||||
|
||||
HOSTSYNC 15
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# DEADTIME - Interval to wait before declaring a stale ups "dead"
|
||||
#
|
||||
# upsmon requires a UPS to provide status information every few seconds
|
||||
# (see POLLFREQ and POLLFREQALERT) to keep things updated. If the status
|
||||
# fetch fails, the UPS is marked stale. If it stays stale for more than
|
||||
# DEADTIME seconds, the UPS is marked dead.
|
||||
#
|
||||
# A dead UPS that was last known to be on battery is assumed to have gone
|
||||
# to a low battery condition. This may force a shutdown if it is providing
|
||||
# a critical amount of power to your system.
|
||||
#
|
||||
# Note: DEADTIME should be a multiple of POLLFREQ and POLLFREQALERT.
|
||||
# Otherwise you'll have "dead" UPSes simply because upsmon isn't polling
|
||||
# them quickly enough. Rule of thumb: take the larger of the two
|
||||
# POLLFREQ values, and multiply by 3.
|
||||
|
||||
DEADTIME 15
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# POWERDOWNFLAG - Flag file for forcing UPS shutdown on the primary system
|
||||
#
|
||||
# upsmon will create a file with this name in primary mode when it's time
|
||||
# to shut down the load. You should check for this file's existence in
|
||||
# your shutdown scripts and run 'upsdrvctl shutdown' if it exists, to tell
|
||||
# the UPS(es) to power off.
|
||||
#
|
||||
# See the config-notes.txt file in the docs subdirectory for more information.
|
||||
# Refer to the section:
|
||||
# [[UPS_shutdown]] "Configuring automatic shutdowns for low battery events"
|
||||
# or refer to the online version.
|
||||
|
||||
POWERDOWNFLAG /etc/killpower
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYMSG - change messages sent by upsmon when certain events occur
|
||||
#
|
||||
# You can change the default messages to something else if you like.
|
||||
#
|
||||
# NOTIFYMSG <notify type> "message"
|
||||
#
|
||||
# NOTIFYMSG ONLINE "UPS %s on line power"
|
||||
# NOTIFYMSG ONBATT "UPS %s on battery"
|
||||
# NOTIFYMSG LOWBATT "UPS %s battery is low"
|
||||
# NOTIFYMSG FSD "UPS %s: forced shutdown in progress"
|
||||
# NOTIFYMSG COMMOK "Communications with UPS %s established"
|
||||
# NOTIFYMSG COMMBAD "Communications with UPS %s lost"
|
||||
# NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"
|
||||
# NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"
|
||||
# NOTIFYMSG NOCOMM "UPS %s is unavailable"
|
||||
# NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"
|
||||
#
|
||||
# Note that %s is replaced with the identifier of the UPS in question.
|
||||
#
|
||||
# Possible values for <notify type>:
|
||||
#
|
||||
# ONLINE : UPS is back online
|
||||
# ONBATT : UPS is on battery
|
||||
# LOWBATT : UPS has a low battery (if also on battery, it's "critical")
|
||||
# FSD : UPS is being shutdown by the primary (FSD = "Forced Shutdown")
|
||||
# COMMOK : Communications established with the UPS
|
||||
# COMMBAD : Communications lost to the UPS
|
||||
# SHUTDOWN : The system is being shutdown
|
||||
# REPLBATT : The UPS battery is bad and needs to be replaced
|
||||
# NOCOMM : A UPS is unavailable (can't be contacted for monitoring)
|
||||
# NOPARENT : The process that shuts down the system has died (shutdown impossible)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
|
||||
#
|
||||
# By default, upsmon sends walls (global messages to all logged in users)
|
||||
# and writes to the syslog when things happen. You can change this.
|
||||
#
|
||||
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
|
||||
#
|
||||
# NOTIFYFLAG ONLINE SYSLOG+WALL
|
||||
# NOTIFYFLAG ONBATT SYSLOG+WALL
|
||||
# NOTIFYFLAG LOWBATT SYSLOG+WALL
|
||||
# NOTIFYFLAG FSD SYSLOG+WALL
|
||||
# NOTIFYFLAG COMMOK SYSLOG+WALL
|
||||
# NOTIFYFLAG COMMBAD SYSLOG+WALL
|
||||
# NOTIFYFLAG SHUTDOWN SYSLOG+WALL
|
||||
# NOTIFYFLAG REPLBATT SYSLOG+WALL
|
||||
# NOTIFYFLAG NOCOMM SYSLOG+WALL
|
||||
# NOTIFYFLAG NOPARENT SYSLOG+WALL
|
||||
#
|
||||
# Possible values for the flags:
|
||||
#
|
||||
# SYSLOG - Write the message in the syslog
|
||||
# WALL - Write the message to all users on the system
|
||||
# EXEC - Execute NOTIFYCMD (see above) with the message
|
||||
# IGNORE - Don't do anything
|
||||
#
|
||||
# If you use IGNORE, don't use any other flags on the same line.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# RBWARNTIME - replace battery warning time in seconds
|
||||
#
|
||||
# upsmon will normally warn you about a battery that needs to be replaced
|
||||
# every 43200 seconds, which is 12 hours. It does this by triggering a
|
||||
# NOTIFY_REPLBATT which is then handled by the usual notify structure
|
||||
# you've defined above.
|
||||
#
|
||||
# If this number is not to your liking, override it here.
|
||||
|
||||
RBWARNTIME 43200
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# NOCOMMWARNTIME - no communications warning time in seconds
|
||||
#
|
||||
# upsmon will let you know through the usual notify system if it can't
|
||||
# talk to any of the UPS entries that are defined in this file. It will
|
||||
# trigger a NOTIFY_NOCOMM by default every 300 seconds unless you
|
||||
# change the interval with this directive.
|
||||
|
||||
NOCOMMWARNTIME 300
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# FINALDELAY - last sleep interval before shutting down the system
|
||||
#
|
||||
# On a primary, upsmon will wait this long after sending the NOTIFY_SHUTDOWN
|
||||
# before executing your SHUTDOWNCMD. If you need to do something in between
|
||||
# those events, increase this number. Remember, at this point your UPS is
|
||||
# almost depleted, so don't make this too high. If needed, on high-end UPS
|
||||
# devices you can usually configure when the low-battery state is announced
|
||||
# based on estimated remaining run-time or on charge level of the batteries.
|
||||
#
|
||||
# Alternatively, you can set this very low so you don't wait around when
|
||||
# it's time to shut down. Some UPSes don't give much warning for low
|
||||
# battery and will require a value of 0 here for a safe shutdown.
|
||||
#
|
||||
# Note: If FINALDELAY on the secondary is greater than HOSTSYNC on the
|
||||
# primary, the primary will give up waiting for that secondary system
|
||||
# to disconnect.
|
||||
|
||||
FINALDELAY 5
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# CERTPATH - path to certificates (database directory or directory with CA's)
|
||||
#
|
||||
# When compiled with SSL support, you can enter the certificate path here.
|
||||
#
|
||||
# With NSS:
|
||||
# Certificates are stored in a dedicated database (split into 3 files).
|
||||
# Specify the path of the database directory.
|
||||
#
|
||||
# CERTPATH @CONFPATH@/cert/upsmon
|
||||
#
|
||||
# With OpenSSL:
|
||||
# Directory containing CA certificates in PEM format, used to verify
|
||||
# the server certificate presented by the upsd server. The files each
|
||||
# contain one CA certificate. The files are looked up by the CA subject
|
||||
# name hash value, which must hence be available.
|
||||
#
|
||||
# CERTPATH /usr/ssl/certs
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# CERTIDENT - self certificate name and database password
|
||||
# CERTIDENT <certificate name> <database password>
|
||||
#
|
||||
# When compiled with SSL support with NSS, you can specify the certificate
|
||||
# name to retrieve from database to authenticate itself and the password
|
||||
# required to access certificate related private key.
|
||||
#
|
||||
# CERTIDENT "my nut monitor" "MyPasSw0rD"
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# CERTHOST - security properties for an host
|
||||
# CERTHOST <hostname> <certificate name> <certverify> <forcessl>
|
||||
#
|
||||
# When compiled with SSL support with NSS, you can specify security directive
|
||||
# for each server you can contact.
|
||||
# Each entry maps server name with the expected certificate name and flags
|
||||
# indicating if the server certificate is verified and if the connection
|
||||
# must be secure.
|
||||
#
|
||||
# CERTHOST localhost "My nut server" 1 1
|
||||
#
|
||||
# See 'docs/security.txt' or the Security chapter of NUT user manual
|
||||
# for more information on the SSL support in NUT.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# CERTVERIFY - make upsmon verify all connections with certificates
|
||||
# CERTVERIFY 1
|
||||
#
|
||||
# When compiled with SSL support, make upsmon verify all connections with
|
||||
# certificates.
|
||||
# Without this, there is no guarantee that the upsd is the right host.
|
||||
# Enabling this greatly reduces the risk of man in the middle attacks.
|
||||
# This effectively forces the use of SSL, so don't use this unless
|
||||
# all of your upsd hosts are ready for SSL and have their certificates
|
||||
# in order.
|
||||
# When compiled with NSS support of SSL, can be overridden for host
|
||||
# specified with a CERTHOST directive.
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# FORCESSL - force upsmon to use SSL
|
||||
# FORCESSL 1
|
||||
#
|
||||
# When compiled with SSL, specify that a secured connection must be used
|
||||
# to communicate with upsd.
|
||||
# If you don't use 'CERTVERIFY 1', then this will at least make sure
|
||||
# that nobody can sniff your sessions without a large effort. Setting
|
||||
# this will make upsmon drop connections if the remote upsd doesn't
|
||||
# support SSL, so don't use it unless all of them have it running.
|
||||
# When compiled with NSS support of SSL, can be overridden for host
|
||||
# specified with a CERTHOST directive.
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# DEBUG_MIN - specify minimal debugging level for upsmon daemon
|
||||
# e.g. DEBUG_MIN 6
|
||||
#
|
||||
# Optionally specify a minimum debug level for `upsmon` daemon, e.g. for
|
||||
# troubleshooting a deployment, without impacting foreground or background
|
||||
# running mode directly, and without need to edit init-scripts or service
|
||||
# unit definitions. Note that command-line option `-D` can only increase
|
||||
# this verbosity level.
|
||||
#
|
||||
# NOTE: if the running daemon receives a `reload` command, presence of the
|
||||
# `DEBUG_MIN NUMBER` value in the configuration file can be used to tune
|
||||
# debugging verbosity in the running service daemon (it is recommended to
|
||||
# comment it away or set the minimum to explicit zero when done, to avoid
|
||||
# huge journals and I/O system abuse). Keep in mind that for this run-time
|
||||
# tuning, the `DEBUG_MIN` value *present* in *reloaded* configuration files
|
||||
# is applied instantly and overrides any previously set value, from file
|
||||
# or CLI options, regardless of older logging level being higher or lower
|
||||
# than the newly found number; a missing (or commented away) value however
|
||||
# does not change the previously active logging verbosity.
|
|
@ -83,15 +83,9 @@ CMDSCRIPT @BINDIR@/upssched-cmd
|
|||
# argument.
|
||||
#
|
||||
# Example:
|
||||
# 1) Start a timer that will execute when communication with any UPS (*) has
|
||||
# been gone for 10 seconds
|
||||
# Start a timer that'll execute when any UPS (*) has been gone 10 seconds
|
||||
#
|
||||
# AT COMMBAD * START-TIMER upsgone 10
|
||||
#
|
||||
# 2) Start a timer that will execute when any UPS (*) has been running
|
||||
# on battery for 30 seconds
|
||||
#
|
||||
# AT ONBATT * START-TIMER onbattwarn 30
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
#
|
||||
|
@ -101,15 +95,10 @@ CMDSCRIPT @BINDIR@/upssched-cmd
|
|||
# has passed then pass the optional argument <cmd> to CMDSCRIPT.
|
||||
#
|
||||
# Example:
|
||||
# 1) If a specific UPS (myups@localhost) communication is restored, then stop
|
||||
# the timer before it triggers
|
||||
# If a specific UPS (myups@localhost) comes back online, then stop the
|
||||
# timer before it triggers
|
||||
#
|
||||
# AT COMMOK myups@localhost CANCEL-TIMER upsgone
|
||||
#
|
||||
# 2) If any UPS (*) reverts to utility power, then stop the timer before it
|
||||
# triggers
|
||||
#
|
||||
# AT ONLINE * CANCEL-TIMER onbattwarn
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
#
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
@UPSSTATSPATH upsstats.cgi@
|
||||
@UPSIMAGEPATH upsimage.cgi@
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
@ -26,16 +26,10 @@
|
|||
@REFRESH@
|
||||
<title>@HOSTDESC@ : @VAR ups.model@ on @HOST@</title>
|
||||
<!-- LINK REL="stylesheet" TYPE="text/css" HREF="http://localhost/nut/nut.css" / -->
|
||||
<style type="text/css">
|
||||
body{color:#00fc00; background:#808080; font-family:"Times New Roman", Times, serif;}
|
||||
a:link{color:#00e;}
|
||||
a:visited{color:#551a8b;}
|
||||
table{background:#000;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<body BGCOLOR="#808080" TEXT="#00FC00" LINK="#0000EE" VLINK="#551A8B">
|
||||
|
||||
<table style="margin:auto" BORDER="1" CELLSPACING="0" CELLPADDING="10">
|
||||
<table BORDER="1" ALIGN="CENTER" CELLSPACING="0" CELLPADDING="10" BGCOLOR="#000000">
|
||||
|
||||
<tr>
|
||||
<th COLSPAN="20">Network UPS Tools upsstats @VERSION@ - @HOSTDESC@ - @VAR ups.model@ on @HOST@</th>
|
||||
|
@ -57,7 +51,7 @@ table{background:#000;}
|
|||
|
||||
<tr>
|
||||
|
||||
<td VALIGN="TOP">
|
||||
<td BGCOLOR="#000000" VALIGN="TOP">
|
||||
|
||||
<table BORDER="0"> <!-- table 2 -->
|
||||
|
||||
|
@ -201,7 +195,7 @@ table{background:#000;}
|
|||
|
||||
@IFSUPP ambient.temperature@
|
||||
@IFSUPP ambient.humidity@
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
<td ALIGN="CENTER">Temperature<br>@IMG ambient.temperature tempmin=0 tempmax=50 width=90@</td>
|
||||
<td ALIGN="CENTER">Humidity<br>@IMG ambient.humidity width=90@</td>
|
||||
|
@ -209,21 +203,21 @@ table{background:#000;}
|
|||
</td>
|
||||
@ELSE@
|
||||
@IFSUPP ambient.temperature@
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
<td ALIGN="CENTER">Temperature<br>@IMG ambient.temperature tempmin=0 tempmax=50@</td>
|
||||
</tr></table>
|
||||
</td>
|
||||
@ELSE@
|
||||
@IFSUPP ambient.humidity@
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
<td ALIGN="CENTER">Humidity<br>@IMG ambient.humidity@</td>
|
||||
</tr></table>
|
||||
</td>
|
||||
@ENDIF@
|
||||
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
@IFSUPP battery.charge@
|
||||
@IFSUPP battery.voltage@
|
||||
|
@ -238,7 +232,7 @@ table{background:#000;}
|
|||
</tr></table>
|
||||
</td>
|
||||
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
@IFSUPP input.L2-L3.voltage@
|
||||
<td ALIGN="CENTER">L1-L2<br>@IMG input.L1-L2.voltage width=68@</td>
|
||||
|
@ -255,7 +249,7 @@ table{background:#000;}
|
|||
</tr></table>
|
||||
</td>
|
||||
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
@IFSUPP output.L2-L3.voltage@
|
||||
<td ALIGN="CENTER">L1-L2<br>@IMG output.L1-L2.voltage width=68@</td>
|
||||
|
@ -272,7 +266,7 @@ table{background:#000;}
|
|||
</tr></table>
|
||||
</td>
|
||||
|
||||
<td ALIGN="CENTER" VALIGN="TOP">
|
||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
||||
<table BORDER="0"><tr>
|
||||
@IFSUPP output.L2.power.percent@
|
||||
<td ALIGN="CENTER">L1<br>@IMG output.L1.power.percent width=68@</td>
|
||||
|
@ -292,12 +286,9 @@ table{background:#000;}
|
|||
</tr>
|
||||
|
||||
</table>
|
||||
<div><a href="https://jigsaw.w3.org/css-validator/check/referer"><img
|
||||
style="float:right" src="https://jigsaw.w3.org/css-validator/images/vcss"
|
||||
alt="Valid CSS" title="Valid CSS" height="31" width="88"></a>
|
||||
<a href="https://validator.w3.org/check?uri=referer"><img
|
||||
style="float:right" src="https://www.w3.org/Icons/valid-html401"
|
||||
alt="Valid HTML 4.01 Strict" title="Valid HTML 4.01 Strict"
|
||||
height="31" width="88"></a></div>
|
||||
<a href="http://validator.w3.org/check?uri=referer"><img style="float:right"
|
||||
src="http://www.w3.org/Icons/valid-html40"
|
||||
alt="Valid HTML 4.0 Transitional" height="31" width="88"></a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
@UPSSTATSPATH upsstats.cgi@
|
||||
@UPSIMAGEPATH upsimage.cgi@
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
@ -28,29 +28,21 @@ Network UPS Tools upsstats
|
|||
@VERSION@
|
||||
: UPS Status
|
||||
</title>
|
||||
<style type="text/css">
|
||||
body{font-family:"Times New Roman", Times, serif;}
|
||||
a:link{color:#00e;}
|
||||
a:visited{color:#551a8b;}
|
||||
th, td{padding:0.5ex;}
|
||||
.t1{background:#0ff;}
|
||||
.t2{background:#0f0;}
|
||||
</style>
|
||||
<!-- link rel="stylesheet" type="text/css" href="nut.css" / -->
|
||||
@REFRESH@
|
||||
</head>
|
||||
<body>
|
||||
<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B">
|
||||
|
||||
<table style="margin:auto; background:#50A0A0; text-align:center;">
|
||||
<table BGCOLOR="#50A0A0" ALIGN="CENTER">
|
||||
<tr><td>
|
||||
|
||||
<table>
|
||||
<table CELLPADDING="5">
|
||||
<tr>
|
||||
<th COLSPAN="10" style="background:#60B0B0;">
|
||||
<th COLSPAN="10" BGCOLOR="#60B0B0">
|
||||
|
||||
<span style="font-size:1.5em">Network UPS Tools upsstats
|
||||
<font SIZE="+2">Network UPS Tools upsstats
|
||||
@VERSION@
|
||||
</span>
|
||||
</font>
|
||||
|
||||
<br>
|
||||
@DATE %a %b %d %X %Z %Y@
|
||||
|
@ -58,7 +50,7 @@ th, td{padding:0.5ex;}
|
|||
|
||||
</tr>
|
||||
|
||||
<tr style="background:#60B0B0;">
|
||||
<tr BGCOLOR="#60B0B0">
|
||||
<th COLSPAN="1">System</th>
|
||||
<th COLSPAN="1">Model</th>
|
||||
<th COLSPAN="1">Status</th>
|
||||
|
@ -73,20 +65,20 @@ th, td{padding:0.5ex;}
|
|||
|
||||
@FOREACHUPS@
|
||||
|
||||
<tr>
|
||||
<td class="t1">
|
||||
<tr ALIGN=CENTER>
|
||||
<td BGCOLOR="#00FFFF">
|
||||
@HOSTLINK@
|
||||
</td>
|
||||
|
||||
<td class="t1">
|
||||
<td BGCOLOR="#00FFFF">
|
||||
@VAR ups.model@
|
||||
</td>
|
||||
|
||||
<td style="background:@STATUSCOLOR@">
|
||||
<td BGCOLOR="@STATUSCOLOR@">
|
||||
@STATUS@
|
||||
</td>
|
||||
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@IFSUPP battery.charge@
|
||||
@VAR battery.charge@
|
||||
%
|
||||
|
@ -97,18 +89,18 @@ th, td{padding:0.5ex;}
|
|||
@IFBETWEEN input.transfer.low input.transfer.high input.L1-L2.voltage@
|
||||
@IFBETWEEN input.transfer.low input.transfer.high input.L2-L3.voltage@
|
||||
@IFBETWEEN input.transfer.low input.transfer.high input.L3-L1.voltage@
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@ELSE@
|
||||
@IFSUPP input.L2-N.voltage@
|
||||
@IFBETWEEN input.transfer.low input.transfer.high input.L1-N.voltage@
|
||||
@IFBETWEEN input.transfer.low input.transfer.high input.L2-N.voltage@
|
||||
@IFBETWEEN input.transfer.low input.transfer.high input.L3-N.voltage@
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@ELSE@
|
||||
@IFBETWEEN input.transfer.low input.transfer.high input.voltage@
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@ELSE@
|
||||
<td style="background:red;">
|
||||
<td BGCOLOR="#FF0000">
|
||||
@ENDIF@
|
||||
|
||||
@IFSUPP input.L2-L3.voltage@
|
||||
|
@ -126,7 +118,7 @@ th, td{padding:0.5ex;}
|
|||
@ENDIF@
|
||||
</td>
|
||||
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@IFSUPP output.L2-L3.voltage@
|
||||
@VAR output.L1-L2.voltage@
|
||||
@VAR output.L2-L3.voltage@
|
||||
|
@ -142,7 +134,7 @@ th, td{padding:0.5ex;}
|
|||
@ENDIF@
|
||||
</td>
|
||||
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@IFSUPP output.L2.power.percent@
|
||||
@VAR output.L1.power.percent@
|
||||
@VAR output.L2.power.percent@
|
||||
|
@ -159,7 +151,7 @@ th, td{padding:0.5ex;}
|
|||
@ENDIF@
|
||||
</td>
|
||||
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@IFSUPP ups.temperature@
|
||||
@UPSTEMP@
|
||||
@DEGREES@
|
||||
|
@ -170,13 +162,13 @@ th, td{padding:0.5ex;}
|
|||
@ENDIF@
|
||||
</td>
|
||||
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@IFSUPP battery.runtime@
|
||||
@RUNTIME@
|
||||
@ENDIF@
|
||||
</td>
|
||||
|
||||
<td class="t2">
|
||||
<td BGCOLOR="#00FF00">
|
||||
@TREELINK@
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -188,9 +180,11 @@ th, td{padding:0.5ex;}
|
|||
</td></tr>
|
||||
</table>
|
||||
|
||||
<hr><div><small>
|
||||
<a href="https://jigsaw.w3.org/css-validator/check/referer"><img style="float:right" src="https://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88"></a>
|
||||
<a href="https://validator.w3.org/check?uri=referer"><img style="float:right" src="https://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Strict" height="31" width="88"></a>
|
||||
<hr /><div><small>
|
||||
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="float:right" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88"/></a>
|
||||
<a href="http://validator.w3.org/check?uri=referer"><img style="float:right"
|
||||
src="http://www.w3.org/Icons/valid-html40"
|
||||
alt="Valid HTML 4.0 Transitional" height="31" width="88"></a>
|
||||
</small></div>
|
||||
|
||||
</body></html>
|
||||
|
|
1101
config.guess
vendored
1101
config.guess
vendored
File diff suppressed because it is too large
Load diff
551
config.sub
vendored
551
config.sub
vendored
File diff suppressed because it is too large
Load diff
2969
configure.ac
2969
configure.ac
File diff suppressed because it is too large
Load diff
812
configure.in
Normal file
812
configure.in
Normal file
|
@ -0,0 +1,812 @@
|
|||
dnl +------------------------------------------------------------------+
|
||||
dnl | Network UPS Tools: configure.in |
|
||||
dnl +------------------------------------------------------------------+
|
||||
|
||||
dnl NUT version number is defined here and *only* here (no more include/version)
|
||||
AC_INIT(nut, 2.4.3)
|
||||
AC_CONFIG_SRCDIR(server/upsd.c)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
echo "Network UPS Tools version ${PACKAGE_VERSION}"
|
||||
AC_CANONICAL_SYSTEM
|
||||
NUT_CHECK_OS
|
||||
AC_CONFIG_HEADER(include/config.h)
|
||||
AC_PREFIX_DEFAULT(/usr/local/ups)
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
dnl Require Autoconf 2.60 or better and enable features of Posix that are extensions to C
|
||||
AC_PREREQ([2.60])
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
dnl Use "./configure --enable-maintainer-mode" to keep Makefile.in and Makefile
|
||||
dnl in sync after SVN updates.
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl # the following is commented out, because the UPS_VERSION macro now
|
||||
dnl # resides in include/nut_version.h, which is generated by Makefile.am,
|
||||
dnl # rather than in include/config.h, which is generated by configure. The
|
||||
dnl # reason is that the SVN revision should be computed at compile time,
|
||||
dnl # not configure time.
|
||||
dnl AC_DEFINE_UNQUOTED(UPS_VERSION, "${PACKAGE_VERSION}", [NUT version])
|
||||
|
||||
dnl Fix this early so we can expand with eval later
|
||||
test "${prefix}" = "NONE" && prefix="${ac_default_prefix}"
|
||||
test "${exec_prefix}" = "NONE" && exec_prefix='${prefix}'
|
||||
|
||||
CFLAGS=${CFLAGS-"-O"}
|
||||
|
||||
dnl NOTE: for definition of NUT_* autoconf macros, see m4/ directory
|
||||
dnl and docs/macros.txt
|
||||
|
||||
dnl +------------------------------------------------------------------+
|
||||
dnl | default values for things later on (can be overridden) |
|
||||
|
||||
STATEPATH="/var/state/ups"
|
||||
|
||||
cgiexecdir='${exec_prefix}/cgi-bin'
|
||||
driverexecdir='${exec_prefix}/bin'
|
||||
htmldir='${prefix}/html'
|
||||
pkgconfigdir='${libdir}/pkgconfig'
|
||||
hotplugdir='/etc/hotplug'
|
||||
if test ! -d "${hotplugdir}"; then
|
||||
hotplugdir=''
|
||||
fi
|
||||
udevdir='/lib/udev'
|
||||
if test ! -d "${udevdir}"; then
|
||||
udevdir='/etc/udev'
|
||||
if test ! -d "${udevdir}"; then
|
||||
udevdir=''
|
||||
fi
|
||||
fi
|
||||
|
||||
RUN_AS_USER="nobody"
|
||||
RUN_AS_GROUP="nobody"
|
||||
PIDPATH="/var/run"
|
||||
|
||||
dnl Define directory where LIBOBJS replacement functions are
|
||||
AC_CONFIG_LIBOBJ_DIR([common])
|
||||
|
||||
dnl +-------------------------------------------------------------------
|
||||
|
||||
AC_PROG_CC
|
||||
dnl Needed for per-target flags
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_EGREP
|
||||
AC_PATH_PROG(AR, ar)
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
||||
dnl Postpone call to AC_PROG_LIBTOOL to allow disabling static lib
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_INLINE
|
||||
AC_C_FLEXIBLE_ARRAY_MEMBER
|
||||
AC_C_VARARRAYS
|
||||
AC_CHECK_FUNCS(flock lockf fcvt fcvtl)
|
||||
AC_CHECK_FUNCS(cfsetispeed tcsendbreak)
|
||||
AC_CHECK_FUNCS(seteuid setsid getpassphrase)
|
||||
AC_CHECK_FUNCS(on_exit strptime)
|
||||
|
||||
dnl the following may add stuff to LIBOBJS (is this still needed?)
|
||||
AC_CHECK_FUNCS(vsnprintf snprintf, [], [
|
||||
AC_LIBOBJ(snprintf)
|
||||
AC_TYPE_LONG_DOUBLE
|
||||
AC_TYPE_LONG_LONG_INT
|
||||
])
|
||||
|
||||
AC_REPLACE_FUNCS(setenv inet_aton strerror atexit)
|
||||
|
||||
dnl
|
||||
dnl Only use these when compiling with gcc
|
||||
dnl
|
||||
if ( test "${GCC}" = "yes" )
|
||||
then
|
||||
CFLAGS="${CFLAGS} -Wall -Wsign-compare"
|
||||
fi
|
||||
|
||||
dnl optind handling:
|
||||
dnl need to check if unistd.h is enough, else try getopt.h, else need decls
|
||||
AC_CHECK_DECLS(optind, [], [
|
||||
AC_CHECK_HEADERS(getopt.h, [
|
||||
AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h is needed])
|
||||
], [
|
||||
AC_DEFINE(NEED_GETOPT_DECLS, 1, [Define to use explicit getopt declarations])
|
||||
], [AC_INCLUDES_DEFAULT])
|
||||
], [AC_INCLUDES_DEFAULT])
|
||||
|
||||
dnl FreeBSD serial locking compatibility - look for uu_lock in libutil.h
|
||||
AC_CHECK_DECLS(uu_lock, [
|
||||
AC_DEFINE(HAVE_UU_LOCK, 1, [Use uu_lock for locking (FreeBSD)])
|
||||
SERLIBS="-lutil"
|
||||
dnl put in some better defaults for FreeBSD
|
||||
RUN_AS_USER="uucp"
|
||||
], [
|
||||
SERLIBS=""
|
||||
], [
|
||||
#include <sys/types.h>
|
||||
#include <libutil.h>
|
||||
])
|
||||
|
||||
AC_CHECK_DECLS(__func__, [], [
|
||||
AC_CHECK_DECLS(__FUNCTION__, [
|
||||
AC_DEFINE(__func__, __FUNCTION__, [Replace missing __func__ declaration])
|
||||
], [
|
||||
AC_DEFINE(__func__, __LINE__, [Replace missing __func__ declaration])
|
||||
], [AC_INCLUDES_DEFAULT])
|
||||
], [AC_INCLUDES_DEFAULT])
|
||||
|
||||
dnl Solaris compatibility - check for -lnsl and -lsocket
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
AC_SEARCH_LIBS(connect, socket)
|
||||
|
||||
AC_HEADER_TIME
|
||||
AC_CHECK_HEADERS(sys/modem.h stdarg.h varargs.h sys/termios.h sys/time.h, [], [], [AC_INCLUDES_DEFAULT])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for types and define possible replacements
|
||||
AX_CREATE_STDINT_H(include/nut_stdint.h)
|
||||
NUT_TYPE_SOCKLEN_T
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl check for --with-all (or --without-all, or --with-all=auto) flag
|
||||
|
||||
AC_MSG_CHECKING(for --with-all)
|
||||
AC_ARG_WITH(all,
|
||||
AC_HELP_STRING([--with-all], [enable serial, usb, snmp, hal, cgi, dev, neon, powerman]),
|
||||
[ if test -n "${withval}"; then
|
||||
dnl Note: we allow "no" as a positive value, because
|
||||
dnl this is what the user expects from --without-all
|
||||
if test -z "${with_cgi}"; then with_cgi="${withval}"; fi
|
||||
if test -z "${with_dev}"; then with_dev="${withval}"; fi
|
||||
if test -z "${with_serial}"; then with_serial="${withval}"; fi
|
||||
if test -z "${with_snmp}"; then with_snmp="${withval}"; fi
|
||||
if test -z "${with_usb}"; then with_usb="${withval}"; fi
|
||||
if test -z "${with_hal}"; then with_hal="${withval}"; fi
|
||||
if test -z "${with_neon}"; then with_neon="${withval}"; fi
|
||||
if test -z "${with_powerman}"; then with_powerman="${withval}"; fi
|
||||
AC_MSG_RESULT("${withval}")
|
||||
else
|
||||
AC_MSG_RESULT(not given)
|
||||
fi
|
||||
], [ AC_MSG_RESULT(not given)
|
||||
])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl declare a number of --with-FEATURE options. Do this early, so that
|
||||
dnl they are listed near the top by "./configure --help"
|
||||
|
||||
NUT_ARG_WITH([dev], [build and install the development files], [no])
|
||||
NUT_ARG_WITH([serial], [build and install serial drivers], [yes])
|
||||
NUT_ARG_WITH([usb], [build and install USB drivers], [auto])
|
||||
NUT_CHECK_LIBUSB
|
||||
NUT_ARG_WITH([hal], [build and install HAL support], [no])
|
||||
NUT_CHECK_LIBHAL
|
||||
NUT_ARG_WITH([snmp], [build and install SNMP drivers], [auto])
|
||||
NUT_CHECK_LIBNETSNMP
|
||||
NUT_ARG_WITH([neon], [build and install neon based XML/HTTP driver], [auto])
|
||||
NUT_CHECK_LIBNEON
|
||||
NUT_ARG_WITH([powerman], [build and install Powerman PDU client driver], [auto])
|
||||
NUT_CHECK_LIBPOWERMAN
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl additional USB-related checks
|
||||
|
||||
dnl Solaris 10/11 USB handling (need librt and libusb runtime path)
|
||||
case ${target_os} in
|
||||
solaris2.1* )
|
||||
echo Checking for Solaris 10 / 11 specific configuration for usb drivers
|
||||
AC_SEARCH_LIBS(nanosleep, rt)
|
||||
LIBUSB_LDFLAGS="-R/usr/sfw/lib ${LIBUSB_LDFLAGS}"
|
||||
dnl FIXME: Sun's libusb doesn't support timeout (so blocks notification)
|
||||
dnl and need to call libusb close upon reconnexion
|
||||
AC_DEFINE(SUN_LIBUSB, 1, [Define to 1 for Sun version of the libusb.])
|
||||
SUN_LIBUSB=1
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for --with-ssl
|
||||
|
||||
NUT_ARG_WITH([ssl], [enable SSL development code], [auto])
|
||||
|
||||
dnl ${nut_with_ssl}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_ssl}" != "no"; then
|
||||
dnl check for libssl compiler flags
|
||||
NUT_CHECK_LIBSSL
|
||||
fi
|
||||
|
||||
if test "${nut_with_ssl}" = "yes" -a "${nut_have_libssl}" != "yes"; then
|
||||
AC_MSG_ERROR(["OpenSSL not found, required for SSL support"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_ssl}" != "no"; then
|
||||
nut_with_ssl="${nut_have_libssl}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_SSL, test "${nut_with_ssl}" = "yes")
|
||||
NUT_REPORT_FEATURE([enable SSL development code], [${nut_with_ssl}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl Check for --with-wrap
|
||||
|
||||
NUT_ARG_WITH([wrap], [enable libwrap (tcp-wrappers) support], [auto])
|
||||
|
||||
dnl ${nut_with_wrap}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_wrap}" != "no"; then
|
||||
dnl check for libwrap compiler flags
|
||||
NUT_CHECK_LIBWRAP
|
||||
fi
|
||||
|
||||
if test "${nut_with_wrap}" = "yes" -a "${nut_have_libwrap}" != "yes"; then
|
||||
AC_MSG_ERROR(["libwrap not found"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_wrap}" != "no"; then
|
||||
nut_with_wrap="${nut_have_libwrap}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_WRAP, test "${nut_with_wrap}" = "yes")
|
||||
NUT_REPORT_FEATURE([enable libwrap (tcp-wrappers) support], [${nut_with_wrap}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl check whether to compile IPv6 features
|
||||
|
||||
NUT_ARG_WITH([ipv6], [enable IPv6 support], [auto])
|
||||
|
||||
dnl ${nut_with_ipv6}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_ipv6}" != "no"; then
|
||||
dnl check for IPv6 prerequisites
|
||||
NUT_CHECK_IPV6
|
||||
fi
|
||||
|
||||
if test "${nut_with_ipv6}" = "yes" -a "${nut_have_ipv6}" != "yes"; then
|
||||
AC_MSG_ERROR(["Some feature required for IPv6 support is missing"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_ipv6}" != "no"; then
|
||||
nut_with_ipv6="${nut_have_ipv6}"
|
||||
fi
|
||||
|
||||
NUT_REPORT_FEATURE([enable IPv6 support], [${nut_with_ipv6}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-cgi
|
||||
|
||||
NUT_ARG_WITH([cgi], [build and install the CGI programs], [no])
|
||||
|
||||
dnl ${nut_with_cgi}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_cgi}" != "no"; then
|
||||
dnl check for libgd compiler flags
|
||||
NUT_CHECK_LIBGD
|
||||
fi
|
||||
|
||||
if test "${nut_with_cgi}" = "yes" -a "${nut_have_libgd}" != "yes"; then
|
||||
AC_MSG_ERROR([libgd not found, required for CGI build])
|
||||
fi
|
||||
|
||||
if test "${nut_with_cgi}" != "no"; then
|
||||
nut_with_cgi="${nut_have_libgd}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_CGI, test "${nut_with_cgi}" = "yes")
|
||||
NUT_REPORT_FEATURE([build CGI programs], [${nut_with_cgi}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-dev
|
||||
|
||||
dnl ${nut_with_dev}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_dev}" != "no"; then
|
||||
nut_with_dev="yes"
|
||||
else
|
||||
AC_DISABLE_STATIC
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_DEV, test "${nut_with_dev}" = "yes")
|
||||
NUT_REPORT_FEATURE([build and install the development files], [${nut_with_dev}])
|
||||
|
||||
dnl We only init libtool there to allow AC_DISABLE_STATIC
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-serial
|
||||
|
||||
dnl ${nut_with_serial}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_serial}" != "no"; then
|
||||
nut_with_serial="yes"
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_SERIAL, test "${nut_with_serial}" = "yes")
|
||||
NUT_REPORT_FEATURE([build serial drivers], [${nut_with_serial}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-snmp
|
||||
|
||||
dnl ${nut_with_snmp}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_snmp}" = "yes" -a "${nut_have_libnetsnmp}" != "yes"; then
|
||||
AC_MSG_ERROR(["Net-SNMP libraries not found, required for SNMP drivers"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_snmp}" != "no"; then
|
||||
nut_with_snmp="${nut_have_libnetsnmp}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_SNMP, test "${nut_with_snmp}" = "yes")
|
||||
NUT_REPORT_FEATURE([build SNMP drivers], [${nut_with_snmp}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-usb
|
||||
|
||||
dnl ${nut_with_usb}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_usb}" = "yes" -a "${nut_have_libusb}" != "yes"; then
|
||||
AC_MSG_ERROR(["USB drivers requested, but libusb not found."])
|
||||
fi
|
||||
|
||||
if test "${nut_with_usb}" != "no"; then
|
||||
nut_with_usb="${nut_have_libusb}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_USB, test "${nut_with_usb}" = "yes")
|
||||
NUT_REPORT_FEATURE([build USB drivers], [${nut_with_usb}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-hal
|
||||
|
||||
dnl ${nut_with_hal}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_hal}" = "yes" -a "${nut_have_libhal}" != "yes"; then
|
||||
AC_MSG_ERROR(["libhal not found, required for HAL support"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_hal}" = "yes" -a "${nut_have_libusb}" != "yes"; then
|
||||
AC_MSG_ERROR(["libusb not found, required for HAL support"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_hal}" != "no"; then
|
||||
if test "${nut_have_libhal}" = "yes" -a "${nut_have_libusb}" = "yes"; then
|
||||
nut_with_hal="yes"
|
||||
else
|
||||
nut_with_hal="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_HAL, test "${nut_with_hal}" = "yes")
|
||||
NUT_REPORT_FEATURE([enable HAL support], [${nut_with_hal}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
dnl checks related to --with-neon
|
||||
|
||||
dnl ${nut_with_neon}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_neon}" = "yes" -a "${nut_have_neon}" != "yes"; then
|
||||
AC_MSG_ERROR(["neon libraries not found, required for neon based XML/HTTP driver"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_neon}" != "no"; then
|
||||
nut_with_neon="${nut_have_neon}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_NEONXML, test "${nut_with_neon}" = "yes")
|
||||
NUT_REPORT_FEATURE([build neon based XML driver], [${nut_with_neon}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
|
||||
dnl checks related to --with-powerman
|
||||
|
||||
dnl ${nut_with_powerman}: any value except "yes" or "no" is treated as "auto".
|
||||
if test "${nut_with_powerman}" = "yes" -a "${nut_have_libpowerman}" != "yes"; then
|
||||
AC_MSG_ERROR(["Powerman client libraries not found, required for Powerman PDU client driver"])
|
||||
fi
|
||||
|
||||
if test "${nut_with_powerman}" != "no"; then
|
||||
nut_with_powerman="${nut_have_libpowerman}"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(WITH_LIBPOWERMAN, test "${nut_with_powerman}" = "yes")
|
||||
NUT_REPORT_FEATURE([build Powerman PDU client driver], [${nut_with_powerman}])
|
||||
|
||||
dnl ----------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING(state path)
|
||||
AC_ARG_WITH(statepath,
|
||||
AC_HELP_STRING([--with-statepath=PATH], [path for ups state files (/var/state/ups)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
STATEPATH="${withval}"
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(STATEPATH, "${STATEPATH}",
|
||||
[Path for UPS driver state files])
|
||||
AC_MSG_RESULT(${STATEPATH})
|
||||
|
||||
dnl ---------------------------------------------------------------------
|
||||
dnl The 'alt pid path' is used by the drivers (via main.c) and upsd, since
|
||||
dnl ideally they do not run as root and won't be able to write to the usual
|
||||
dnl /var/run path. This defaults to the STATEPATH since they should be
|
||||
dnl able to write there.
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(alt pid path)
|
||||
AC_ARG_WITH(altpidpath,
|
||||
AC_HELP_STRING([--with-altpidpath=PATH], [path for driver/upsd .pid files (<statepath>)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
ALTPIDPATH="${STATEPATH}"
|
||||
;;
|
||||
*)
|
||||
ALTPIDPATH="${withval}"
|
||||
;;
|
||||
esac],
|
||||
ALTPIDPATH="${STATEPATH}"
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(ALTPIDPATH, "${ALTPIDPATH}",
|
||||
[Path for pid files of drivers and upsd (usually STATEPATH)])
|
||||
AC_MSG_RESULT(${ALTPIDPATH})
|
||||
|
||||
AC_MSG_CHECKING(driver path)
|
||||
AC_ARG_WITH(drvpath,
|
||||
AC_HELP_STRING([--with-drvpath=PATH], [where to install ups drivers (EPREFIX/bin)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
driverexecdir="${withval}"
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
conftemp="${driverexecdir}"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
AC_DEFINE_UNQUOTED(DRVPATH, "${conftemp}", [Default path for UPS drivers])
|
||||
AC_MSG_RESULT(${driverexecdir})
|
||||
|
||||
AC_MSG_CHECKING(cgi path)
|
||||
AC_ARG_WITH(cgipath,
|
||||
AC_HELP_STRING([--with-cgipath=PATH], [where to install CGI programs (EPREFIX/cgi-bin)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
cgiexecdir="${withval}"
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
conftemp="${cgiexecdir}"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
AC_DEFINE_UNQUOTED(CGIPATH, "${conftemp}", [Default path for CGI programs])
|
||||
AC_MSG_RESULT(${cgiexecdir})
|
||||
|
||||
AC_MSG_CHECKING(html path)
|
||||
AC_ARG_WITH(htmlpath,
|
||||
AC_HELP_STRING([--with-htmlpath=PATH], [where to install HTML files (PREFIX/html)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
htmldir="${withval}"
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
conftemp="${htmldir}"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
AC_DEFINE_UNQUOTED(HTMLPATH, "${conftemp}", [Default path for HTML files])
|
||||
AC_MSG_RESULT(${htmldir})
|
||||
|
||||
AC_MSG_CHECKING(pidpath)
|
||||
AC_ARG_WITH(pidpath,
|
||||
AC_HELP_STRING([--with-pidpath=PATH], [path for .pid files (/var/run)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
PIDPATH="${withval}"
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(PIDPATH, "${PIDPATH}", [Path where the pid files should go])
|
||||
AC_MSG_RESULT(${PIDPATH})
|
||||
|
||||
AC_MSG_CHECKING(network port number)
|
||||
AC_ARG_WITH(port,
|
||||
AC_HELP_STRING([--with-port=PORT], [port for network communications (3493)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
PORT="3493"
|
||||
;;
|
||||
*)
|
||||
PORT="${withval}"
|
||||
;;
|
||||
esac],
|
||||
PORT="3493"
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(PORT, ${PORT}, [Port for network communications])
|
||||
AC_MSG_RESULT(${PORT})
|
||||
|
||||
nut_user_given=
|
||||
AC_MSG_CHECKING(user to run as)
|
||||
AC_ARG_WITH(user,
|
||||
AC_HELP_STRING([--with-user=username], [user for programs started as root (nobody)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
RUN_AS_USER="${withval}"
|
||||
nut_user_given=yes
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(RUN_AS_USER, "${RUN_AS_USER}",
|
||||
[User to switch to if started as root])
|
||||
AC_MSG_RESULT(${RUN_AS_USER})
|
||||
|
||||
nut_group_given=
|
||||
AC_MSG_CHECKING(group membership of user to run as)
|
||||
AC_ARG_WITH(group,
|
||||
AC_HELP_STRING([--with-group=groupname], [group membership of user for programs started as root (nogroup)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
;;
|
||||
*)
|
||||
RUN_AS_GROUP="${withval}"
|
||||
nut_group_given=yes
|
||||
;;
|
||||
esac],
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(RUN_AS_GROUP, "${RUN_AS_GROUP}",
|
||||
[Group membership of user to switch to if started as root])
|
||||
AC_MSG_RESULT(${RUN_AS_GROUP})
|
||||
|
||||
dnl check that --with-user is given iff --with-group is given.
|
||||
if test -n "$nut_user_given" -a -z "$nut_group_given"; then
|
||||
AC_MSG_ERROR(["If you specify --with-user, you also must specify --with-group"])
|
||||
elif test -z "$nut_user_given" -a -n "$nut_group_given"; then
|
||||
AC_MSG_ERROR(["If you specify --with-group, you also must specify --with-user"])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(facility for syslog)
|
||||
AC_ARG_WITH(logfacility,
|
||||
AC_HELP_STRING([--with-logfacility=FACILITY], [facility for log messages (LOG_DAEMON)]),
|
||||
[ case "${withval}" in
|
||||
yes|no)
|
||||
LOGFACILITY="LOG_DAEMON"
|
||||
;;
|
||||
*)
|
||||
LOGFACILITY="${withval}"
|
||||
;;
|
||||
esac],
|
||||
LOGFACILITY="LOG_DAEMON"
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(LOG_FACILITY, ${LOGFACILITY},
|
||||
[Desired syslog facility - see syslog(3)])
|
||||
AC_MSG_RESULT(${LOGFACILITY})
|
||||
|
||||
AC_MSG_CHECKING(which drivers to build)
|
||||
AC_ARG_WITH(drivers,
|
||||
AC_HELP_STRING([[[[--with-drivers=driver@<:@,driver...@:>@]]]], [Only use specific drivers (all)]),
|
||||
[ case "${withval}" in
|
||||
yes | no)
|
||||
dnl ignore calls without any arguments
|
||||
DRIVER_BUILD_LIST="all"
|
||||
AC_MSG_RESULT(all available)
|
||||
;;
|
||||
*)
|
||||
DRIVER_BUILD_LIST=`echo ${withval} | sed "s/,/ /g"`
|
||||
AC_MSG_RESULT(${DRIVER_BUILD_LIST})
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[
|
||||
DRIVER_BUILD_LIST="all"
|
||||
AC_MSG_RESULT(all available)
|
||||
]
|
||||
)
|
||||
AM_CONDITIONAL(SOME_DRIVERS, test "${DRIVER_BUILD_LIST}" != "all")
|
||||
|
||||
if test "${DRIVER_BUILD_LIST}" != "all"; then
|
||||
NUT_REPORT([only build specific drivers], [${DRIVER_BUILD_LIST}])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(which driver man pages to install)
|
||||
if test "${DRIVER_BUILD_LIST}" = "all"; then
|
||||
DRIVER_MAN_LIST=all
|
||||
AC_MSG_RESULT(all available)
|
||||
else
|
||||
DRIVER_MAN_LIST=""
|
||||
for i in ${DRIVER_BUILD_LIST}; do
|
||||
if test -f ${srcdir}/man/$i.8; then
|
||||
DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.8"
|
||||
fi
|
||||
done
|
||||
AC_MSG_RESULT(${DRIVER_MAN_LIST})
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether to strip debug symbols)
|
||||
AC_ARG_ENABLE(strip,
|
||||
[ --enable-strip Strip debugging symbols from binaries [no]],
|
||||
[
|
||||
case "${withval}" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="${CFLAGS} -s"
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[ AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
|
||||
AC_MSG_CHECKING(whether to install pkg-config *.pc files)
|
||||
AC_ARG_WITH(pkgconfig-dir,
|
||||
AC_HELP_STRING([--with-pkgconfig-dir=PATH], [where to install pkg-config *.pc files (EPREFIX/lib/pkgconfig)]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes|auto)
|
||||
;;
|
||||
no)
|
||||
pkgconfigdir=""
|
||||
;;
|
||||
*)
|
||||
pkgconfigdir="${withval}"
|
||||
;;
|
||||
esac
|
||||
],
|
||||
)
|
||||
echo ${pkgconfigdir}
|
||||
if test -n "${pkgconfigdir}"; then
|
||||
AC_MSG_RESULT(using ${pkgconfigdir})
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgconfigdir}")
|
||||
|
||||
AC_MSG_CHECKING(whether to install hotplug rules)
|
||||
AC_ARG_WITH(hotplug-dir,
|
||||
AC_HELP_STRING([--with-hotplug-dir=PATH], [where to install hotplug rules (/etc/hotplug)]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes)
|
||||
if test -z "${hotplugdir}"; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(["hotplug directory requested but not found])
|
||||
fi
|
||||
;;
|
||||
auto)
|
||||
;;
|
||||
no)
|
||||
hotplugdir=""
|
||||
;;
|
||||
*)
|
||||
hotplugdir="${withval}"
|
||||
;;
|
||||
esac
|
||||
],
|
||||
)
|
||||
if test -n "${hotplugdir}"; then
|
||||
AC_MSG_RESULT(using ${hotplugdir})
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_HOTPLUG, test -n "${hotplugdir}")
|
||||
|
||||
AC_MSG_CHECKING(whether to install udev rules)
|
||||
AC_ARG_WITH(udev-dir,
|
||||
AC_HELP_STRING([--with-udev-dir=PATH], [where to install udev rules (/lib/udev or /etc/udev)]),
|
||||
[
|
||||
case "${withval}" in
|
||||
yes)
|
||||
if test -z "${udevdir}"; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(["udev directory requested but not found])
|
||||
fi
|
||||
;;
|
||||
auto)
|
||||
;;
|
||||
no)
|
||||
udevdir=""
|
||||
;;
|
||||
*)
|
||||
udevdir="${withval}"
|
||||
;;
|
||||
esac
|
||||
],
|
||||
)
|
||||
if test -n "${udevdir}"; then
|
||||
AC_MSG_RESULT(using ${udevdir})
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL(WITH_UDEV, test -n "${udevdir}")
|
||||
|
||||
dnl expand ${sysconfdir} and write it out
|
||||
conftemp="${sysconfdir}"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
CONFPATH=${conftemp}
|
||||
AC_DEFINE_UNQUOTED(CONFPATH, "${conftemp}",
|
||||
[Default path for configuration files])
|
||||
|
||||
dnl same for datadir
|
||||
conftemp="${datadir}"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
AC_DEFINE_UNQUOTED(DATADIR, "${conftemp}",
|
||||
[Default path for data files])
|
||||
|
||||
dnl same for bindir
|
||||
conftemp="${bindir}"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
eval conftemp=\"${conftemp}\"
|
||||
AC_DEFINE_UNQUOTED(BINDIR, "${conftemp}",
|
||||
[Default path for user executables])
|
||||
|
||||
AC_SUBST(OS_NAME)
|
||||
AC_SUBST(LIBSSL_CFLAGS)
|
||||
AC_SUBST(LIBSSL_LDFLAGS)
|
||||
AC_SUBST(LIBGD_CFLAGS)
|
||||
AC_SUBST(LIBGD_LDFLAGS)
|
||||
AC_SUBST(LIBNETSNMP_CFLAGS)
|
||||
AC_SUBST(LIBNETSNMP_LDFLAGS)
|
||||
AC_SUBST(LIBUSB_CFLAGS)
|
||||
AC_SUBST(LIBUSB_LDFLAGS)
|
||||
AC_SUBST(LIBNEON_CFLAGS)
|
||||
AC_SUBST(LIBNEON_LDFLAGS)
|
||||
AC_SUBST(LIBPOWERMAN_CFLAGS)
|
||||
AC_SUBST(LIBPOWERMAN_LDFLAGS)
|
||||
AC_SUBST(LIBWRAP_CFLAGS)
|
||||
AC_SUBST(LIBWRAP_LDFLAGS)
|
||||
AC_SUBST(HAL_USER)
|
||||
AC_SUBST(HAL_DEVICE_MATCH_KEY)
|
||||
AC_SUBST(HAL_FDI_PATH)
|
||||
AC_SUBST(HAL_CALLOUTS_PATH)
|
||||
AC_SUBST(HAVE_GLIB_2_14)
|
||||
AC_SUBST(LIBHAL_CFLAGS)
|
||||
AC_SUBST(LIBHAL_LDFLAGS)
|
||||
AC_SUBST(DRIVER_BUILD_LIST)
|
||||
AC_SUBST(DRIVER_MAN_LIST)
|
||||
AC_SUBST(DRIVER_INSTALL_TARGET)
|
||||
AC_SUBST(NETLIBS)
|
||||
AC_SUBST(SERLIBS)
|
||||
AC_SUBST(STATEPATH)
|
||||
AC_SUBST(CONFPATH)
|
||||
AC_SUBST(BINDIR)
|
||||
AC_SUBST(RUN_AS_USER)
|
||||
AC_SUBST(RUN_AS_GROUP)
|
||||
AC_SUBST(SUN_LIBUSB)
|
||||
AC_SUBST(WORDS_BIGENDIAN)
|
||||
AC_SUBST(cgiexecdir)
|
||||
AC_SUBST(driverexecdir)
|
||||
AC_SUBST(htmldir)
|
||||
AC_SUBST(pkgconfigdir)
|
||||
AC_SUBST(hotplugdir)
|
||||
AC_SUBST(udevdir)
|
||||
|
||||
AC_OUTPUT([
|
||||
clients/Makefile
|
||||
common/Makefile
|
||||
conf/Makefile
|
||||
conf/upssched.conf.sample
|
||||
data/html/header.html
|
||||
data/html/Makefile
|
||||
data/Makefile
|
||||
docs/Makefile
|
||||
drivers/Makefile
|
||||
include/Makefile
|
||||
lib/libupsclient-config
|
||||
lib/libupsclient.pc
|
||||
lib/Makefile
|
||||
man/Makefile
|
||||
scripts/hal/Makefile
|
||||
scripts/hal/ups-nut-device.fdi
|
||||
scripts/hotplug/Makefile
|
||||
scripts/hotplug/libhidups
|
||||
scripts/python/Makefile
|
||||
scripts/udev/Makefile
|
||||
scripts/udev/nut-usbups.rules
|
||||
scripts/Makefile
|
||||
server/Makefile
|
||||
tools/Makefile
|
||||
Makefile
|
||||
])
|
||||
|
||||
NUT_PRINT_FEATURE_REPORT
|
|
@ -2,19 +2,7 @@
|
|||
|
||||
SUBDIRS = html
|
||||
|
||||
dist_data_DATA = cmdvartab
|
||||
nodist_data_DATA = driver.list
|
||||
EXTRA_DIST = evolution500.seq epdu-managed.dev
|
||||
dist_data_DATA = cmdvartab driver.list
|
||||
EXTRA_DIST = evolution500.dev
|
||||
|
||||
# NOTE: Due to portability, we do not use a GNU percent-wildcard extension:
|
||||
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
cmdvartab-spellchecked: cmdvartab Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
$(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
spellcheck spellcheck-interactive spellcheck-sortdict:
|
||||
$(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="cmdvartab" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
CLEANFILES = *.pdf *.html *-spellchecked
|
||||
DATA_FILES = cmdvartab driver.list
|
||||
|
|
476
data/Makefile.in
476
data/Makefile.in
|
@ -1,8 +1,9 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -17,61 +18,6 @@
|
|||
# Network UPS Tools: data
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -92,75 +38,42 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = data
|
||||
DIST_COMMON = $(dist_data_DATA) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_c_pragmas.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/ax_run_or_link_ifelse.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_asciidoc.m4 \
|
||||
$(top_srcdir)/m4/nut_check_cppcheck.m4 \
|
||||
$(top_srcdir)/m4/nut_check_headers_windows.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_ipv6.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_check_pkgconfig.m4 \
|
||||
$(top_srcdir)/m4/nut_check_python.m4 \
|
||||
$(top_srcdir)/m4/nut_compiler_family.m4 \
|
||||
$(top_srcdir)/m4/nut_func_getnameinfo_argtypes.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(dist_data_DATA) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = driver.list
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
|
@ -182,43 +95,16 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
|||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(datadir)" "$(DESTDIR)$(datadir)"
|
||||
DATA = $(dist_data_DATA) $(nodist_data_DATA)
|
||||
am__installdirs = "$(DESTDIR)$(datadir)"
|
||||
DATA = $(dist_data_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
distdir distdir-am
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/driver.list.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
|
@ -245,14 +131,9 @@ am__relativize = \
|
|||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUGPARSE = @AUGPARSE@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -263,25 +144,13 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPCHECK = @CPPCHECK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBLATEX = @DBLATEX@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DRVPATH = @DRVPATH@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
|
@ -290,8 +159,12 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||
GREP = @GREP@
|
||||
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
|
||||
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
|
||||
HAL_FDI_PATH = @HAL_FDI_PATH@
|
||||
HAL_USER = @HAL_USER@
|
||||
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -299,51 +172,34 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LIBS = @LIBNETSNMP_LIBS@
|
||||
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
|
||||
LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LN_S_R = @LN_S_R@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NUT_DATADIR = @NUT_DATADIR@
|
||||
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||
NUT_NETVERSION = @NUT_NETVERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_NAME = @OS_NAME@
|
||||
|
@ -357,46 +213,29 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PIDPATH = @PIDPATH@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
SBINDIR = @SBINDIR@
|
||||
SED = @SED@
|
||||
SERLIBS = @SERLIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||
STATEPATH = @STATEPATH@
|
||||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
TREE_VERSION = @TREE_VERSION@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
XMLLINT = @XMLLINT@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
auglensdir = @auglensdir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -407,12 +246,8 @@ builddir = @builddir@
|
|||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dummy_PKG_CONFIG = @dummy_PKG_CONFIG@
|
||||
dummy_PKG_CONFIG_CFLAGS = @dummy_PKG_CONFIG_CFLAGS@
|
||||
dummy_PKG_CONFIG_LIBS = @dummy_PKG_CONFIG_LIBS@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
|
@ -429,23 +264,19 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
now = @now@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdshutdowndir = @systemdshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
|
@ -456,11 +287,9 @@ top_builddir = @top_builddir@
|
|||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
SUBDIRS = html
|
||||
dist_data_DATA = cmdvartab
|
||||
nodist_data_DATA = driver.list
|
||||
EXTRA_DIST = evolution500.seq epdu-managed.dev
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
CLEANFILES = *.pdf *.html *-spellchecked
|
||||
dist_data_DATA = cmdvartab driver.list
|
||||
EXTRA_DIST = evolution500.dev
|
||||
DATA_FILES = cmdvartab driver.list
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -476,13 +305,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu data/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -493,8 +323,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
|||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
driver.list: $(top_builddir)/config.status $(srcdir)/driver.list.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
@ -503,11 +331,8 @@ clean-libtool:
|
|||
-rm -rf .libs _libs
|
||||
install-dist_dataDATA: $(dist_data_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(datadir)" || $(MKDIR_P) "$(DESTDIR)$(datadir)"
|
||||
@list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
|
@ -521,49 +346,27 @@ uninstall-dist_dataDATA:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir)
|
||||
install-nodist_dataDATA: $(nodist_data_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(nodist_data_DATA)'; test -n "$(datadir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(datadir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(datadir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-nodist_dataDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nodist_data_DATA)'; test -n "$(datadir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir)
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(datadir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(datadir)" && rm -f $$files
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
|
@ -578,12 +381,57 @@ $(am__recursive_targets):
|
|||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
|
@ -599,7 +447,12 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
|
@ -611,11 +464,15 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
@ -624,29 +481,11 @@ GTAGS:
|
|||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
@ -678,10 +517,13 @@ distdir-am: $(DISTFILES)
|
|||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
|
@ -706,7 +548,7 @@ check: check-recursive
|
|||
all-am: Makefile $(DATA)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(datadir)" "$(DESTDIR)$(datadir)"; do \
|
||||
for dir in "$(DESTDIR)$(datadir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
|
@ -719,19 +561,13 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
@ -740,7 +576,6 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
@ -761,7 +596,7 @@ info: info-recursive
|
|||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-dist_dataDATA install-nodist_dataDATA
|
||||
install-data-am: install-dist_dataDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
|
@ -805,37 +640,26 @@ ps: ps-recursive
|
|||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-dist_dataDATA uninstall-nodist_dataDATA
|
||||
uninstall-am: uninstall-dist_dataDATA
|
||||
|
||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
|
||||
install-am install-strip tags-recursive
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
|
||||
check-am clean clean-generic clean-libtool cscopelist-am ctags \
|
||||
ctags-am distclean distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-dist_dataDATA install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-nodist_dataDATA \
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am check check-am clean clean-generic clean-libtool \
|
||||
ctags ctags-recursive distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dist_dataDATA install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-am uninstall uninstall-am \
|
||||
uninstall-dist_dataDATA uninstall-nodist_dataDATA
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-dist_dataDATA
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# NOTE: Due to portability, we do not use a GNU percent-wildcard extension:
|
||||
#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
cmdvartab-spellchecked: cmdvartab Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT)
|
||||
$(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
spellcheck spellcheck-interactive spellcheck-sortdict:
|
||||
$(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="cmdvartab" SPELLCHECK_DIR="$(srcdir)" $@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
# This file is optional. You may delete it to save resources, but
|
||||
# clients will receive "Unavailable" for any description requests.
|
||||
#
|
||||
# *** NOTE *** : When updating this file, also update docs/nut-names.txt
|
||||
# *** NOTE *** : When updating this file, also update docs/new-names.txt
|
||||
|
||||
VARDESC ups.alarm "UPS alarms"
|
||||
VARDESC ups.status "UPS status"
|
||||
VARDESC ups.time "Internal UPS clock time"
|
||||
VARDESC ups.date "Internal UPS clock date"
|
||||
VARDESC ups.efficiency "Efficiency of the UPS"
|
||||
VARDESC ups.model "UPS model"
|
||||
VARDESC ups.mfr "UPS manufacturer"
|
||||
VARDESC ups.mfr.date "UPS manufacturing date"
|
||||
|
@ -20,7 +19,6 @@ VARDESC ups.firmware "UPS firmware"
|
|||
VARDESC ups.firmware.aux "Auxiliary device firmware"
|
||||
VARDESC ups.temperature "UPS temperature (degrees C)"
|
||||
VARDESC ups.load "Load on UPS (percent of full)"
|
||||
VARDESC ups.load.energysave "Load on UPS that triggers energysave (percent)"
|
||||
VARDESC ups.load.high "Load when UPS switches to overload condition (percent)"
|
||||
VARDESC ups.id "UPS system identifier"
|
||||
VARDESC ups.delay.start "Interval to wait before (re)starting the load (seconds)"
|
||||
|
@ -47,11 +45,6 @@ VARDESC input.voltage "Input voltage (V)"
|
|||
VARDESC input.voltage.extended "Extended input voltage range"
|
||||
VARDESC input.voltage.maximum "Maximum incoming voltage seen (V)"
|
||||
VARDESC input.voltage.minimum "Minimum incoming voltage seen (V)"
|
||||
VARDESC input.voltage.status "Voltage status relative to the thresholds"
|
||||
VARDESC input.voltage.low.warning "Input voltage low warning threshold (V)"
|
||||
VARDESC input.voltage.low.critical "Input voltage low critical threshold (V)"
|
||||
VARDESC input.voltage.high.warning "Input voltage high warning threshold (V)"
|
||||
VARDESC input.voltage.high.critical "Input voltage high critical threshold (V)"
|
||||
VARDESC input.voltage.nominal "Nominal input voltage (V)"
|
||||
VARDESC input.transfer.reason "Reason for last transfer to battery"
|
||||
VARDESC input.transfer.low "Low voltage transfer point (V)"
|
||||
|
@ -64,14 +57,8 @@ VARDESC input.sensitivity "Input power sensitivity"
|
|||
VARDESC input.quality "Input power quality"
|
||||
VARDESC input.current "Input current (A)"
|
||||
VARDESC input.current.nominal "Nominal input current (A)"
|
||||
VARDESC input.current.status "Current status relative to the thresholds"
|
||||
VARDESC input.current.low.warning "Input current low warning threshold (A)"
|
||||
VARDESC input.current.low.critical "Input current low critical threshold (A)"
|
||||
VARDESC input.current.high.warning "Input current high warning threshold (A)"
|
||||
VARDESC input.current.high.critical "Input current high critical threshold (A)"
|
||||
VARDESC input.frequency "Input line frequency (Hz)"
|
||||
VARDESC input.frequency.extended "Extended input frequency range"
|
||||
VARDESC input.frequency.status "Frequency status"
|
||||
VARDESC input.frequency.nominal "Nominal input line frequency (Hz)"
|
||||
VARDESC input.frequency.low "Minimum input line frequency (Hz)"
|
||||
VARDESC input.frequency.high "Maximum input line frequency (Hz)"
|
||||
|
@ -79,12 +66,6 @@ VARDESC input.transfer.boost.low "Low voltage boosting transfer point (V)"
|
|||
VARDESC input.transfer.boost.high "High voltage boosting transfer point (V)"
|
||||
VARDESC input.transfer.trim.low "Low voltage trimming transfer point (V)"
|
||||
VARDESC input.transfer.trim.high "High voltage trimming transfer point (V)"
|
||||
VARDESC input.transfer.delay "Delay before transfer to mains"
|
||||
VARDESC input.load "Load on (ePDU) input (percent of full)"
|
||||
VARDESC input.realpower "Current sum value of all (ePDU) phases real power (W)"
|
||||
VARDESC input.power "Current sum value of all (ePDU) phases apparent power (VA)"
|
||||
VARDESC input.source "The current input power source"
|
||||
VARDESC input.source.preferred "The preferred input power source"
|
||||
|
||||
VARDESC output.voltage "Output voltage (V)"
|
||||
VARDESC output.voltage.nominal "Nominal output voltage (V)"
|
||||
|
@ -94,7 +75,6 @@ VARDESC output.current "Output current (A)"
|
|||
VARDESC output.current.nominal "Nominal output current (A)"
|
||||
|
||||
VARDESC battery.charge "Battery charge (percent of full)"
|
||||
VARDESC battery.charge.approx "Rough approximation of battery charge"
|
||||
VARDESC battery.charge.low "Remaining battery level when UPS switches to LB (percent)"
|
||||
VARDESC battery.charge.restart "Minimum battery level for restart after power off (percent)"
|
||||
VARDESC battery.charge.warning "Battery level when UPS switches to Warning state (percent)"
|
||||
|
@ -113,40 +93,19 @@ VARDESC battery.packs.bad "Number of bad battery packs"
|
|||
VARDESC battery.type "Battery chemistry"
|
||||
VARDESC battery.protection "Prevent deep discharge of battery"
|
||||
VARDESC battery.energysave "Switch off when running on battery and no/low load"
|
||||
VARDESC battery.energysave.load "Switch off UPS if on battery and load level lower (percent)"
|
||||
VARDESC battery.energysave.delay "Delay before switch off UPS if on battery and load level low (min)"
|
||||
VARDESC battery.energysave.realpower "Switch off UPS if on battery and load level lower (Watts)"
|
||||
VARDESC battery.charger.status "Battery charger status"
|
||||
|
||||
VARDESC ambient.temperature "Ambient temperature (degrees C)"
|
||||
VARDESC ambient.temperature.alarm "Ambient temperature alarm is active"
|
||||
VARDESC ambient.temperature.status "Ambient temperature status relative to the configured thresholds"
|
||||
VARDESC ambient.temperature.alarm.maximum "Maximum allowed ambient temperature (degrees C)"
|
||||
VARDESC ambient.temperature.alarm.minimum "Minimum allowed ambient temperature (degrees C)"
|
||||
VARDESC ambient.temperature.alarm.maximum "Maximum allowed ambient temperature"
|
||||
VARDESC ambient.temperature.alarm.minimum "Minimum allowed ambient temperature"
|
||||
VARDESC ambient.temperature.alarm.enable "Enable ambient temperature alarm"
|
||||
VARDESC ambient.temperature.low "Temperature threshold low (degrees C)"
|
||||
VARDESC ambient.temperature.low.warning "Temperature threshold low warning (degrees C)"
|
||||
VARDESC ambient.temperature.low.critical "Temperature threshold low critical (degrees C)"
|
||||
VARDESC ambient.temperature.high "Temperature threshold high (degrees C)"
|
||||
VARDESC ambient.temperature.high.warning "Temperature threshold high warning (degrees C)"
|
||||
VARDESC ambient.temperature.high.critical "Temperature threshold high critical (degrees C)"
|
||||
VARDESC ambient.humidity "Ambient humidity (percent)"
|
||||
VARDESC ambient.humidity "Ambient humidity"
|
||||
VARDESC ambient.humidity.alarm "Ambient humidity alarm is active"
|
||||
VARDESC ambient.humidity.status "Ambient humidity status relative to the configured thresholds"
|
||||
VARDESC ambient.humidity.alarm.maximum "Maximum allowed ambient humidity (percent)"
|
||||
VARDESC ambient.humidity.alarm.minimum "Minimum allowed ambient humidity (percent)"
|
||||
VARDESC ambient.humidity.alarm.maximum "Maximum allowed ambient humidity"
|
||||
VARDESC ambient.humidity.alarm.minimum "Minimum allowed ambient humidity"
|
||||
VARDESC ambient.humidity.alarm.enable "Enable ambient humidity alarm"
|
||||
VARDESC ambient.humidity.low "Ambient humidity threshold low (percent)"
|
||||
VARDESC ambient.humidity.low.warning "Ambient humidity threshold low warning (percent)"
|
||||
VARDESC ambient.humidity.low.critical "Ambient humidity threshold low critical (percent)"
|
||||
VARDESC ambient.humidity.high "Ambient humidity threshold high (percent)"
|
||||
VARDESC ambient.humidity.high.warning "Ambient humidity threshold high warning (percent)"
|
||||
VARDESC ambient.humidity.high.critical "Ambient humidity threshold high critical (percent)"
|
||||
VARDESC ambient.present "Ambient sensor presence"
|
||||
VARDESC ambient.contacts.1.status "State of the dry contact sensor 1"
|
||||
VARDESC ambient.contacts.2.status "State of the dry contact sensor 2"
|
||||
|
||||
# FIXME: the outlet collection is indexed - solve with regexps?
|
||||
# FIXME: the outlet collection is indexed - solve with regexs?
|
||||
#
|
||||
# VARDESC outlet.[[:digit:]]+.id "Outlet system identifier (<index>)"
|
||||
|
||||
|
@ -178,9 +137,6 @@ VARDESC outlet.2.delay.start "Interval to wait before restarting this outlet (se
|
|||
VARDESC driver.name "Driver name"
|
||||
VARDESC driver.version "Driver version - NUT release"
|
||||
VARDESC driver.version.internal "Internal driver version"
|
||||
VARDESC driver.version.usb "USB library version"
|
||||
|
||||
VARDESC device.part "Device Part Number"
|
||||
|
||||
# FIXME: driver.parameter and driver.flag can have many possible members
|
||||
#
|
||||
|
@ -205,7 +161,6 @@ CMDDESC test.battery.start "Start a battery test"
|
|||
CMDDESC test.battery.start.quick "Start a quick battery test"
|
||||
CMDDESC test.battery.start.deep "Start a deep battery test"
|
||||
CMDDESC test.battery.stop "Stop the battery test"
|
||||
CMDDESC test.system.start "Start a system test"
|
||||
CMDDESC calibrate.start "Start run time calibration"
|
||||
CMDDESC calibrate.stop "Stop run time calibration"
|
||||
CMDDESC bypass.start "Put the UPS in bypass mode"
|
||||
|
@ -220,10 +175,8 @@ CMDDESC beeper.mute "Temporarily mute the UPS beeper"
|
|||
CMDDESC beeper.toggle "Toggle the UPS beeper"
|
||||
CMDDESC outlet.1.load.off "Turn off the load on outlet 1 immediately"
|
||||
CMDDESC outlet.1.load.on "Turn on the load on outlet 1 immediately"
|
||||
CMDDESC outlet.1.shutdown.return "Turn off the outlet 1 and return when power is back"
|
||||
CMDDESC outlet.2.load.off "Turn off the load on outlet 2 immediately"
|
||||
CMDDESC outlet.2.load.on "Turn on the load on outlet 2 immediately"
|
||||
CMDDESC outlet.2.shutdown.return "Turn off the outlet 2 and return when power is back"
|
||||
|
||||
# The following two commands should *only* be defined when you need
|
||||
# to compose a 'shutdown.return' command by sending both a switch-off
|
||||
|
|
725
data/driver.list
Normal file
725
data/driver.list
Normal file
|
@ -0,0 +1,725 @@
|
|||
# Network UPS Tools driver.list
|
||||
#
|
||||
# This file is used to build the compat.html on the web server. Any line
|
||||
# with exactly 4 arguments will be turned into an entry on there.
|
||||
# Naturally, it is read by parseconf, so the usual escaping tricks are
|
||||
# allowed if you need to insert something unusual.
|
||||
#
|
||||
# If you write a new driver, modify an existing one to add more support,
|
||||
# or just know about some equipment that isn't listed but should be,
|
||||
# please send me a patch to update this file.
|
||||
#
|
||||
# The format:
|
||||
#
|
||||
# <manufacturer> <model name> <model extra> <driver>
|
||||
#
|
||||
# Note that the "upstype=nn" format must be used for genericups entries,
|
||||
# as they will be parsed by new configuration helper software.
|
||||
#
|
||||
# Duplicate text in the last field will be cooked out during the conversion
|
||||
# to HTML with ROWSPAN magic. They must be an exact match for this to work.
|
||||
|
||||
"Ablerex" "MS-RT" "" "megatec"
|
||||
"Ablerex" "625L" "USB" "megatec_usb"
|
||||
"Ablerex" "Hope Office 400/600" "" "megatec"
|
||||
|
||||
"ActivePower" "400VA" "" "megatec"
|
||||
"ActivePower" "1400VA" "" "megatec"
|
||||
"ActivePower" "2000VA" "" "megatec"
|
||||
|
||||
"Advice" "TopGuard 2000" "" "megatec"
|
||||
|
||||
"AEC" "MiniGuard UPS 700" "Megatec M2501 cable" "genericups upstype=21"
|
||||
|
||||
"APC" "Back-UPS Pro" "" "apcsmart"
|
||||
"APC" "Matrix-UPS" "" "apcsmart"
|
||||
"APC" "Smart-UPS" "" "apcsmart"
|
||||
"APC" "Back-UPS Pro USB" "USB" "usbhid-ups"
|
||||
"APC" "Back-UPS USB" "USB" "usbhid-ups"
|
||||
"APC" "Back-UPS RS USB" "USB" "usbhid-ups"
|
||||
"APC" "Back-UPS LS USB" "USB" "usbhid-ups"
|
||||
"APC" "Back-UPS ES/CyberFort 350" "USB" "usbhid-ups"
|
||||
"APC" "Back-UPS BF500" "USB" "usbhid-ups"
|
||||
"APC" "BACK-UPS XS LCD" "USB" "usbhid-ups"
|
||||
"APC" "Smart-UPS USB" "USB" "usbhid-ups"
|
||||
"APC" "Back-UPS" "940-0095A/C cables" "genericups upstype=1"
|
||||
"APC" "Back-UPS" "940-0020B/C cables" "genericups upstype=2"
|
||||
"APC" "Back-UPS" "940-0023A cable" "genericups upstype=9"
|
||||
"APC" "Back-UPS Office" "940-0119A cable" "genericups upstype=12"
|
||||
"APC" "Back-UPS RS 500" "custom non-USB cable" "genericups upstype=20"
|
||||
"APC" "Masterswitch" "Not a UPS - 940-0020 cable" "genericups upstype=12"
|
||||
"APC" "AP9210" "8 outlets" "powerman-pdu (experimental)"
|
||||
"APC" "AP79xx" "8 to 24 outlets" "powerman-pdu (experimental)"
|
||||
"APC" "(various)" "SNMP monitoring card" "snmp-ups (experimental)"
|
||||
|
||||
"Aphel" "PDU" "no report, but various models should be supported" "snmp-ups (experimental)"
|
||||
|
||||
"Apollo" "1000A" "" "genericups upstype=4"
|
||||
"Apollo" "1000F" "" "genericups upstype=4"
|
||||
|
||||
"Appro" "SWPDU" "48 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"Atlantis Land" "A03-P826" "" "megatec"
|
||||
|
||||
"Baytech" "RPC3" "8 outlets" "powerman-pdu (experimental)"
|
||||
"Baytech" "RPC3-20NC" "8 outlets" "powerman-pdu (experimental)"
|
||||
"Baytech" "RPC28-30NC" "20 outlets" "powerman-pdu (experimental)"
|
||||
"Baytech" "various RPC" "" "snmp-ups"
|
||||
|
||||
"Belkin" "Active Battery Backup BU30 series" "USB" "megatec_usb"
|
||||
"Belkin" "Home Office F6H350-SER" "" "genericups upstype=7"
|
||||
"Belkin" "Home Office F6H500-SER" "" "genericups upstype=7"
|
||||
"Belkin" "Home Office F6H650-SER" "" "genericups upstype=7"
|
||||
"Belkin" "F6H375-USB" "USB (<= 2005 models, vendor id: 050d)" "usbhid-ups"
|
||||
"Belkin" "F6H375-USB" "USB (2007 models, vendor id: 0665)" "megatec_usb"
|
||||
"Belkin" "Office Series F6C550-AVR" "USB" "usbhid-ups"
|
||||
"Belkin" "Regulator Pro" "F6C525-SER, F6C625-SER" "belkin"
|
||||
"Belkin" "Resource" "" "genericups upstype=4"
|
||||
"Belkin" "Small Enterprise F6C1500-TW-RK" "serial port" "belkin"
|
||||
"Belkin" "Small Enterprise F6C1500-TW-RK" "USB" "usbhid-ups"
|
||||
"Belkin" "Universal UPS F6C100-UNV" "USB" "usbhid-ups"
|
||||
"Belkin" "Universal UPS F6C120-UNV" "serial port" "belkinunv"
|
||||
"Belkin" "Universal UPS F6C120-UNV" "USB" "usbhid-ups"
|
||||
"Belkin" "Universal UPS F6C800-UNV" "serial port" "belkinunv"
|
||||
"Belkin" "Universal UPS F6C800-UNV" "USB" "usbhid-ups"
|
||||
"Belkin" "Universal UPS F6C1100-UNV" "serial port (<= 2005 models)" "belkinunv"
|
||||
"Belkin" "Universal UPS F6C1100-UNV" "USB (<= 2005 models, vendor id: 050d)" "usbhid-ups"
|
||||
"Belkin" "Universal UPS F6C1100-UNV" "USB (2007 models, vendor id: 0665)" "megatec_usb"
|
||||
"Belkin" "Universal UPS F6C1200-UNV" "USB (<= 2005 models, vendor id: 050d)" "usbhid-ups"
|
||||
"Belkin" "Universal UPS F6C1200-UNV" "USB (2007 models, vendor id: 0665)" "megatec_usb"
|
||||
"Belkin" "Universal UPS F6H350deUNV" "serial port" "megatec"
|
||||
"Belkin" "Universal UPS F6H350ukUNV" "serial port" "megatec"
|
||||
"Belkin" "Universal UPS F6H500ukUNV" "serial port" "megatec"
|
||||
"Belkin" "Universal UPS F6H650ukUNV" "serial port" "megatec"
|
||||
|
||||
"Best Power" "Fortress (old)" "" "bestfortress"
|
||||
"Best Power" "Fortress (newer)" "" "bestups"
|
||||
"Best Power" "Fortress Telecom" "" "bestups"
|
||||
"Best Power" "Axxium Rackmount" "" "bestups"
|
||||
"Best Power" "Patriot Pro" "" "bestups"
|
||||
"Best Power" "Patriot Pro II" "" "bestups"
|
||||
"Best Power" "Patriot" "INT51 cable" "genericups upstype=6"
|
||||
"Best Power" "Micro-Ferrups" "" "bestuferrups"
|
||||
"Best Power" "Fortress/Ferrups" "f-command support" "bestfcom"
|
||||
|
||||
"Chloride" "Desk Power 650" "serial port" "megatec"
|
||||
|
||||
"Cito Power" "CPG-SR1000" "" "megatec"
|
||||
|
||||
"Clary" "ST-800" "" "gamatronic"
|
||||
|
||||
"Compaq" "T1500h" "" "upscode2 use_pre_lf"
|
||||
"Compaq" "R3000h" "" "upscode2"
|
||||
"Compaq" "R3000 XR" "" "bcmxcp"
|
||||
"Compaq" "R5500 XR" "" "bcmxcp"
|
||||
|
||||
"Cyber Power Systems" "320AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "500AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "650AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "700AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "800AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "850AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "900AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "1250AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "1500AVR" "" "powerpanel or cyberpower"
|
||||
"Cyber Power Systems" "Power99" "" "genericups upstype=7"
|
||||
"Cyber Power Systems" "550SL" "" "genericups upstype=7"
|
||||
"Cyber Power Systems" "725SL" "" "genericups upstype=7"
|
||||
"Cyber Power Systems" "CPS825VA" "" "powerpanel"
|
||||
"Cyber Power Systems" "1100AVR" "" "powerpanel"
|
||||
"Cyber Power Systems" "1200AVR" "" "powerpanel"
|
||||
"Cyber Power Systems" "1500AVR-HO" "" "powerpanel"
|
||||
"Cyber Power Systems" "PR2200" "" "powerpanel"
|
||||
"Cyber Power Systems" "PR3000E" "" "powerpanel (experimental)"
|
||||
"Cyber Power Systems" "685AVR" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "800AVR" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "AE550" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "CP 1500C" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "OR2200LCDRM2U" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "Value 400E" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "Value 600E" "USB" "usbhid-ups"
|
||||
"Cyber Power Systems" "Value 800E" "USB" "usbhid-ups"
|
||||
|
||||
"Cyclades" "PM8" "8 outlets" "powerman-pdu (experimental)"
|
||||
"Cyclades" "PM10" "10 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"Dell" "Dell UPS Tower 500W LV / HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Tower 500W LV / HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack/Tower 1000W LV / HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack/Tower 1000W LV / HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack/Tower 1500W LV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack/Tower 1500W LV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack/Tower 1920W LV / HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack/Tower 1920W LV / HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack/Tower 2300W LV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack/Tower 2300W LV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack/Tower 2700W LV / HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack/Tower 2700W LV / HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Short Depth Rack 2700W High Efficiency Online LV / HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Short Depth Rack 2700W High Efficiency Online LV / HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack 3750W High Efficiency Online HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack 3750W High Efficiency Online HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack 4200W High Efficiency Online HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack 4200W High Efficiency Online HV" "Serial port" "newmge-shut"
|
||||
"Dell" "Dell UPS Rack 5600W HV" "USB port" "usbhid-ups"
|
||||
"Dell" "Dell UPS Rack 5600W HV" "Serial port" "newmge-shut"
|
||||
|
||||
"Delta" "GES602N" "" "belkin"
|
||||
|
||||
"Deltec" "PowerRite Pro II" "" "genericups upstype=15"
|
||||
|
||||
"Digital Loggers" "LPC, EPCR2, DIN" "8 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"Digitus" "DN-170020" "" "megatec"
|
||||
|
||||
"Dynamix" "UPS1700D" "" "megatec"
|
||||
"Dynamix" "UPS-650VA" "" "megatec ignoreoff"
|
||||
|
||||
"Dynex" "975AVR" "" "genericups upstype=7"
|
||||
"Dynex" "DX-800U" "USB" "usbhid-ups"
|
||||
|
||||
"Eaton" "Protection Station 500/650/800 VA" "USB" "usbhid-ups"
|
||||
"Eaton" "Ellipse ASR USBS 600/750/1000/1500 VA" "USB cable" "usbhid-ups"
|
||||
"Eaton" "Ellipse MAX USBS 600/850/1100/1500 VA" "USB cable" "usbhid-ups"
|
||||
"Eaton" "Evolution 650/850/1150/1550/2000 VA" "USB port" "usbhid-ups"
|
||||
"Eaton" "Evolution S 1250/1750/2500/3000 VA" "USB port" "usbhid-ups"
|
||||
"Eaton" "EX 700/1000/1500 VA" "USB port" "usbhid-ups"
|
||||
"Eaton" "EX 2200/3000/3000 XL VA" "USB port" "usbhid-ups"
|
||||
"Eaton" "EX 1000 RT2U / 1500 RT2U" "USB port" "usbhid-ups"
|
||||
"Eaton" "MX 5/8/10/15/20 kVA" "USB port" "usbhid-ups"
|
||||
"Eaton" "Nova AVR 625/1250" "USB" "usbhid-ups"
|
||||
"Eaton" "E Series NV UPS 400-2000 VA" "" "megatec_usb"
|
||||
"Eaton" "E Series DX UPS 1-20 kVA" "" "mge-utalk"
|
||||
"Eaton" "Ellipse ASR USBS 600/750/1000/1500 VA" "Serial cable" "mge-shut or newmge-shut"
|
||||
"Eaton" "Ellipse MAX USBS 600/850/1100/1500 VA" "Serial cable" "mge-shut or newmge-shut"
|
||||
"Eaton" "Evolution 650/850/1150/1550/2000 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"Eaton" "Evolution S 1250/1750/2500/3000 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"Eaton" "EX 700/1000/1500 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"Eaton" "EX 2200/3000/3000 XL VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"Eaton" "EX 1000 RT2U / 1500 RT2U" "Serial port" "mge-shut or newmge-shut"
|
||||
"Eaton" "MX 5/8/10/15/20 kVA" "Serial port" "mge-shut or newmge-shut"
|
||||
"Eaton" "EX RT 1:1 7/11 kVA" "" "mge-shut or newmge-shut"
|
||||
"Eaton" "EX RT 3:1 5/7/11 kVA" "" "mge-shut or newmge-shut"
|
||||
"Eaton" "EX RT (XML/HTTP)" "NMC Transverse card (ref 66074)" "netxml-ups (experimental)"
|
||||
"Eaton" "EX RT (SNMP)" "NMC Transverse card (ref 66074)" "snmp-ups (experimental)"
|
||||
"Eaton" "BladeUPS (SNMP)" "ConnectUPS Web/SNMP Card" "snmp-ups (experimental)"
|
||||
"Eaton" "various models (XML/HTTP mode)" "NMC Minislot (Ref 66102)" "netxml-ups (experimental)"
|
||||
"Eaton" "various models (SNMP mode)" "NMC Minislot (Ref 66102)" "snmp-ups (experimental)"
|
||||
"Eaton" "various models (XML/HTTP mode)" "SNMP/Web Minislot card (ref 66244)" "netxml-ups (experimental)"
|
||||
"Eaton" "various models (SNMP mode)" "SNMP/Web Minislot card (ref 66244)" "snmp-ups (experimental)"
|
||||
"Eaton" "ePDU Managed" "" "snmp-ups (experimental)"
|
||||
"Eaton" "ePDU Monitored" "" "snmp-ups or netxml-ups"
|
||||
"Eaton" "Powerware 9130" "" "bcmxcp or usbhid-ups"
|
||||
|
||||
"Effekta" "MI/MT/MH" "2502 cable" "megatec"
|
||||
"Effekta" "RM2000MH" "" "megatec"
|
||||
|
||||
"Energy Sistem" "(various)" "" "megatec"
|
||||
|
||||
"ETA" "mini+UPS" "WinNT/Upsoft cable" "genericups upstype=7"
|
||||
"ETA" "mini+UPS PRO" "UPS Explorer cable" "etapro"
|
||||
|
||||
"Ever UPS" "NET *-DPC" "" "everups"
|
||||
"Ever UPS" "AP *-PRO" "" "everups"
|
||||
|
||||
"Ever-Power" "625/1000" "" "safenet"
|
||||
|
||||
"Exide" "NetUPS SE" "" "genericups upstype=15"
|
||||
|
||||
"Fenton Technologies" "PowerPal" "P-series" "safenet"
|
||||
"Fenton Technologies" "PowerPal" "L-series" "megatec"
|
||||
"Fenton Technologies" "PowerOn" "" "megatec"
|
||||
"Fenton Technologies" "PowerPure" "" "megatec"
|
||||
|
||||
"Fairstone" "L525/L625/L750" "" "safenet"
|
||||
|
||||
"Fideltronik" "Ares 700 and larger" "" "genericups upstype=6"
|
||||
"Fideltronik" "Other Ares models" "" "genericups upstype=19"
|
||||
|
||||
"Fiskars" "PowerRite MAX" "" "upscode2"
|
||||
"Fiskars" "PowerServer 10" "" "upscode2"
|
||||
"Fiskars" "PowerServer 30" "" "upscode2"
|
||||
"Fiskars" "9200" "UPS Information Unit" "upscode2"
|
||||
|
||||
"Forza Power Technologies" "SL-1001" "USB" "megatec_usb"
|
||||
|
||||
"Gamatronic" "All models with alarm interface" "" "genericups upstype=22"
|
||||
"Gamatronic" "G-SmartCompact 2000" "" "megatec"
|
||||
"Gamatronic" "MP110/210" "" "gamatronic"
|
||||
"Gamatronic" "MS-T" "" "gamatronic"
|
||||
"Gamatronic" "MS" "" "gamatronic"
|
||||
"Gamatronic" "µPS3/1" "" "gamatronic"
|
||||
|
||||
"Geek Squad" "GS1285U" "USB" "usbhid-ups"
|
||||
|
||||
"Gemini" "UPS625/UPS1000" "" "safenet"
|
||||
|
||||
"HP" "PowerTrust 2997A" "HP 5061-2575 cable" "apcsmart"
|
||||
"HP" "R3000 XR" "" "bcmxcp"
|
||||
"HP" "R5500 XR" "" "bcmxcp"
|
||||
"HP" "R1500 G2" "" "bcmxcp"
|
||||
"HP" "R/T 2200 G2" "" "usbhid-ups"
|
||||
"HP" "T500" "older models" "bcmxcp_usb"
|
||||
"HP" "T750 INTL" "" "usbhid-ups"
|
||||
"HP" "T750" "older models" "bcmxcp_usb"
|
||||
"HP" "HP3488 Switch/Control Unit" "" "powerman-pdu (experimental)"
|
||||
|
||||
"IBM" "Blade Center Management Module" "15 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"ICS" "8064 Ethernet Relay Interface" "16 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"INELT" "Monolith 1000LT" "" "megatec"
|
||||
|
||||
"Inform" "GUARD" "Line Interactive AP model" "powercom"
|
||||
"Inform" "Guard S 1500AP" "" "megatec"
|
||||
"Inform" "Informer Compact 1000VA" "" "megatec or blazer_ser"
|
||||
|
||||
"Infosec" "iPEL 350" "" "megatec"
|
||||
"Infosec" "iPEL 500" "" "megatec"
|
||||
"Infosec" "iPEL 750" "" "megatec"
|
||||
"Infosec" "iPEL 1000" "" "megatec"
|
||||
"Infosec" "500XP" "" "megatec"
|
||||
"Infosec" "XP 500" "USB" "megatec_usb"
|
||||
"Infosec" "XP 1000" "" "megatec"
|
||||
|
||||
"IPMI" "" "" "powerman-pdu (experimental)"
|
||||
|
||||
"Ippon" "Back Power Pro 400/500/600/700/800" "" "blazer_ser or megatec"
|
||||
"Ippon" "Back Power Pro 400/500/600/700/800" "USB" "blazer_usb (experimental)"
|
||||
"Ippon" "Back Comfo Pro 600/800" "" "blazer_ser or megatec"
|
||||
"Ippon" "Back Comfo Pro 600/800" "USB" "blazer_usb (experimental)"
|
||||
"Ippon" "Smart Power Pro 1000/1400/2000" "" "blazer_ser or megatec"
|
||||
"Ippon" "Smart Power Pro 1000/1400/2000" "USB" "blazer_usb (experimental)"
|
||||
"Ippon" "Smart Winner 750/1000/1500/2000/3000" "" "blazer_ser or megatec"
|
||||
"Ippon" "Smart Winner 750/1000/1500/2000/3000" "USB" "blazer_usb (experimental)"
|
||||
"Ippon" "(various)" "" "blazer_ser or megatec"
|
||||
"Ippon" "(various)" "USB" "blazer_usb"
|
||||
|
||||
"IVT" "SCD series" "" "ivtscd"
|
||||
|
||||
"Jageson Technology" "Jasuny USPS" "" "genericups upstype=4"
|
||||
|
||||
"Kebo" "1200D/D Series" "" "megatec"
|
||||
|
||||
"Krauler" "UP-D1200VA" "USB" "megatec_usb ignoreoff"
|
||||
"Krauler" "UP-M500VA" "USB" "megatec_usb"
|
||||
|
||||
"Lestar" "MD-800E" "" "megatec"
|
||||
|
||||
"Liebert" "ITON 600VA" "" "megatec"
|
||||
"Liebert" "UPStation GXT2" "contact-closure cable" "liebert"
|
||||
"Liebert" "GXT2-3000RT230" "" "liebertgxt2 (experimental)"
|
||||
"Liebert" "PowerSure Personal XT" "USB" "usbhid-ups"
|
||||
"Liebert" "PowerSure PSA" "USB" "usbhid-ups"
|
||||
|
||||
"LNXI" "Icebox" "10 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"Masterguard" "(various)" "" "masterguard"
|
||||
|
||||
"Maxxtro" "UPS 600 VA" "serial port" "megatec"
|
||||
|
||||
"Mecer" "ME-2000" "" "megatec"
|
||||
|
||||
"Meta System" "HF Line" "1..4 boards" "metasys"
|
||||
"Meta System" "HF Line \/2" "5..8 boards" "metasys"
|
||||
"Meta System" "HF Millennium 810" "" "metasys"
|
||||
"Meta System" "HF Millennium 820" "" "metasys"
|
||||
"Meta System" "HF TOP Line 910" "" "metasys"
|
||||
"Meta System" "HF TOP Line 920" "" "metasys"
|
||||
"Meta System" "HF TOP Line 930" "" "metasys"
|
||||
"Meta System" "HF TOP Line 940" "" "metasys"
|
||||
"Meta System" "HF TOP Line 950" "" "metasys"
|
||||
"Meta System" "HF TOP Line 960" "" "metasys"
|
||||
"Meta System" "HF TOP Line 970" "" "metasys"
|
||||
"Meta System" "HF TOP Line 980" "" "metasys"
|
||||
"Meta System" "ECO Network 750" "" "metasys"
|
||||
"Meta System" "ECO Network 1000" "" "metasys"
|
||||
"Meta System" "ECO Network 1050" "" "metasys"
|
||||
"Meta System" "ECO Network 1500" "" "metasys"
|
||||
"Meta System" "ECO Network 1800" "" "metasys"
|
||||
"Meta System" "ECO Network 2000" "" "metasys"
|
||||
"Meta System" "ECO Network 2100" "" "metasys"
|
||||
"Meta System" "ECO Network 2500" "" "metasys"
|
||||
"Meta System" "ECO Network 3000" "" "metasys"
|
||||
"Meta System" "ECO 305" "" "metasys"
|
||||
"Meta System" "ECO 308" "" "metasys"
|
||||
"Meta System" "ECO 311" "" "metasys"
|
||||
"Meta System" "ECO 511" "" "metasys"
|
||||
"Meta System" "ECO 516" "" "metasys"
|
||||
"Meta System" "ECO 519" "" "metasys"
|
||||
"Meta System" "ECO 522" "" "metasys"
|
||||
"Meta System" "ally HF 800" "" "metasys"
|
||||
"Meta System" "ally HF 1000" "" "metasys"
|
||||
"Meta System" "ally HF 1250" "" "metasys"
|
||||
"Meta System" "ally HF 1600" "" "metasys"
|
||||
"Meta System" "ally HF 2000" "" "metasys"
|
||||
"Meta System" "ally HF 2500" "" "metasys"
|
||||
"Meta System" "Megaline 1250" "" "metasys"
|
||||
"Meta System" "Megaline 2500" "" "metasys"
|
||||
"Meta System" "Megaline 3750" "" "metasys"
|
||||
"Meta System" "Megaline 5000" "" "metasys"
|
||||
"Meta System" "Megaline 6250" "" "metasys"
|
||||
"Meta System" "Megaline 7500" "" "metasys"
|
||||
"Meta System" "Megaline 8750" "" "metasys"
|
||||
"Meta System" "Megaline 10000" "" "metasys"
|
||||
|
||||
"MGE Office Protection Systems" "Protection Center 500/675 VA" "USB" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Protection Station 500/650/800 VA" "USB" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Ellipse ASR USBS 600/750/1000/1500 VA" "USB cable" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Ellipse MAX USBS 600/850/1100/1500 VA" "USB cable" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Evolution 650/850/1150/1550/2000 VA" "USB port" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Evolution S 1250/1750/2500/3000 VA" "USB port" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Pulsar 700/1000/1500 VA" "USB port" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Pulsar M 2200/3000 VA" "USB port" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Pulsar MX 5/8/10/15/20 kVA" "USB port" "usbhid-ups"
|
||||
"MGE Office Protection Systems" "Ellipse ASR USBS 600/750/1000/1500 VA" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Ellipse MAX USBS 600/850/1100/1500 VA" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Evolution 650/850/1150/1550/2000 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Evolution S 1250/1750/2500/3000 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Pulsar 700/1000/1500 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Pulsar M 2200/3000 VA" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Pulsar MX 5/8/10/15/20 kVA" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Comet EX RT 1:1 7/11 kVA" "" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Comet EX RT 3:1 5/7/11 kVA" "" "mge-shut or newmge-shut"
|
||||
"MGE Office Protection Systems" "Comet EX RT (XML/HTTP)" "NMC Transverse card (ref 66074)" "netxml-ups (experimental)"
|
||||
"MGE Office Protection Systems" "Comet EX RT (SNMP)" "NMC Transverse card (ref 66074)" "snmp-ups (experimental)"
|
||||
"MGE Office Protection Systems" "various models (XML/HTTP mode)" "NMC Minislot (Ref 66102)" "netxml-ups (experimental)"
|
||||
"MGE Office Protection Systems" "various models (SNMP mode)" "NMC Minislot (Ref 66102)" "snmp-ups (experimental)"
|
||||
"MGE Office Protection Systems" "various models (XML/HTTP mode)" "SNMP/Web Minislot card (ref 66244)" "netxml-ups (experimental)"
|
||||
"MGE Office Protection Systems" "various models (SNMP mode)" "SNMP/Web Minislot card (ref 66244)" "snmp-ups (experimental)"
|
||||
|
||||
"MGE UPS SYSTEMS" "Comet EX RT" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Comet EX RT 3:1" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Protection Center 420" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Protection Center 500" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Protection Center 675" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "NOVA AVR 600 USB" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "NOVA AVR 1100 USB" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse USBS" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse USB" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse Premium USBS" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse Premium USB" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 600" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 750" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 1000" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 1500" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 600" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 850" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 1100" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 1500" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar Evolution" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution 650" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution 850" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution 1150" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution S 1250" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution 1550" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution S 1750" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution 2000" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution S 2500" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Evolution S 3000" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar M 2200" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar M 3000" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar M 3000 XL" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar 700" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1000" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1500" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1000 RT2U" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1500 RT2U" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar MX 4000 RT" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Pulsar MX 5000 RT" "USB" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "Comet / Galaxy (USB)" "USB Card (ref 66067)" "usbhid-ups"
|
||||
"MGE UPS SYSTEMS" "NOVA AVR 600 Serial" "" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "NOVA AVR 1100 Serial" "" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse USBS" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse S" "" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse Premium USBS" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar Ellipse Premium S" "" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 600" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 750" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 1000" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse Office 1500" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 600" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 850" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 1100" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Ellipse MAX 1500" "Serial cable" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar EXtreme C / EX RT" "" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Comet EX RT" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Comet EX RT 3:1" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar Esprit" "" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution 650" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution 850" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution 1150" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution S 1250" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution 1550" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution S 1750" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution 2000" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution S 2500" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Evolution S 3000" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar M 2200" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar M 3000" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar M 3000 XL" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar 700" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1000" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1500" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1000 RT2U" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar 1500 RT2U" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar MX 4000 RT" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar MX 5000 RT" "Serial port" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar Evolution" "Serial port" "mge-shut or newmge-shut or mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar EXtreme C" "" "mge-shut or newmge-shut or mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar ES+" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar ESV+" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar SV" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar ESV" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar EX" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar EXL" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar PSX" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar SX" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Pulsar EXtreme" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Comet EXtreme" "" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Comet / Galaxy (Serial)" "Utalk Serial Card (ref 66060)" "mge-utalk"
|
||||
"MGE UPS SYSTEMS" "Comet / Galaxy (Serial)" "HID COM Serial Card (ref 66066)" "mge-shut or newmge-shut"
|
||||
"MGE UPS SYSTEMS" "Pulsar / Comet / Galaxy (SNMP)" "SNMP/Web Transverse card (ref 66074)" "snmp-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "various models (XML/HTTP mode)" "NMC Minislot (Ref 66102)" "netxml-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "various models (SNMP mode)" "NMC Minislot (Ref 66102)" "snmp-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "Pulsar (XML/HTTP mode)" "SNMP/Web Minislot card (ref 66244)" "netxml-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "Pulsar (SNMP mode)" "SNMP/Web Minislot card (ref 66244)" "snmp-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "Pulsar / Comet / Galaxy (SNMP)" "SNMP card (ref 66062)" "snmp-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "Pulsar (SNMP)" "SNMP card (ref 66045)" "snmp-ups (experimental)"
|
||||
"MGE UPS SYSTEMS" "UM-Link (SNMP)" "Not a UPS (ref 66850)" "snmp-ups (experimental)"
|
||||
|
||||
"MicroDowell" "B.Box BP 500" "" "powerpanel"
|
||||
"MicroDowell" "B.Box BP 750" "" "powerpanel"
|
||||
"MicroDowell" "B.Box BP 1000" "" "powerpanel"
|
||||
"MicroDowell" "B.Box BP 1500" "" "powerpanel"
|
||||
"MicroDowell" "Enterprise B8" "" "microdowell"
|
||||
"MicroDowell" "Enterprise B10" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N8" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N11" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N15" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N20" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N22" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N30" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N40" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N50" "" "microdowell"
|
||||
"MicroDowell" "Enterprise N60" "" "microdowell"
|
||||
"MicroDowell" "Enterprise HiBox ST" "" "microdowell"
|
||||
|
||||
"Microsol" "Solis 1.0" "1000VA" "solis"
|
||||
"Microsol" "Solis 1.5" "1500VA" "solis"
|
||||
"Microsol" "Solis 2.0" "2000VA" "solis"
|
||||
"Microsol" "Solis 3.0" "3000VA" "solis"
|
||||
"Microsol" "Rhino 6.0" "6000VA" "rhino"
|
||||
"Microsol" "Rhino 7.5" "7500VA" "rhino"
|
||||
"Microsol" "Rhino 10.0" "10000VA" "rhino"
|
||||
"Microsol" "Rhino 20.0" "20000VA" "rhino"
|
||||
|
||||
"Mustek" "Powermust" "400VA Plus" "megatec"
|
||||
"Mustek" "Powermust" "600VA Plus" "megatec"
|
||||
"Mustek" "Powermust" "800VA Pro" "megatec"
|
||||
"Mustek" "Powermust" "1000VA Plus" "megatec"
|
||||
"Mustek" "Powermust" "1400VA Plus" "megatec"
|
||||
"Mustek" "Powermust" "2000VA USB" "megatec"
|
||||
"Mustek" "Powermust Office 650" "USB" "megatec_usb"
|
||||
"Mustek" "PowerMust 424 / 636 / 848" "USB" "blazer_usb"
|
||||
"Mustek" "Various" "" "megatec"
|
||||
|
||||
"Neus" "400va / 600va" "" "megatec"
|
||||
|
||||
"Nitram" "Elite 500" "" "genericups upstype=8"
|
||||
"Nitram" "Elite 2002" "" "genericups upstype=16"
|
||||
"Nitram" "Elite 2005" "" "powerpanel"
|
||||
|
||||
"Oneac" "ON400" "advanced interface" "oneac"
|
||||
"Oneac" "ON600" "advanced interface" "oneac"
|
||||
"Oneac" "ON900" "advanced interface" "oneac"
|
||||
"Oneac" "ON1300" "advanced interface" "oneac"
|
||||
"Oneac" "EG Series" "advanced interface" "oneac"
|
||||
"Oneac" "ON700" "advanced interface" "oneac"
|
||||
"Oneac" "ON700XAU" "advanced interface" "oneac"
|
||||
"Oneac" "ON700XIU" "advanced interface" "oneac"
|
||||
"Oneac" "ON1000" "advanced interface" "oneac"
|
||||
"Oneac" "ON1000XAU" "advanced interface" "oneac"
|
||||
"Oneac" "ON1000XIU" "advanced interface" "oneac"
|
||||
"Oneac" "ON1500" "advanced interface" "oneac"
|
||||
"Oneac" "ON1500XAU" "advanced interface" "oneac"
|
||||
"Oneac" "ON1500XIU" "advanced interface" "oneac"
|
||||
"Oneac" "ON2000" "advanced interface" "oneac"
|
||||
"Oneac" "ON2000XAU" "advanced interface" "oneac"
|
||||
"Oneac" "ON2000XIU" "advanced interface" "oneac"
|
||||
|
||||
"Online" "P-Series" "" "genericups upstype=14"
|
||||
"Online" "Zinto D" "" "optiups"
|
||||
|
||||
"OnLite" "AQUA" "50" "megatec"
|
||||
|
||||
"Opti-UPS" "PowerES" "420E" "optiups"
|
||||
|
||||
"Orvaldi Power Protection" "various" "not 400 or 600" "megatec"
|
||||
|
||||
"Phasak" "400VA / 600VA" "" "megatec"
|
||||
|
||||
"Plexus" "500VA" "USB" "megatec_usb ignoreoff"
|
||||
"Plexus" "1000VA Pro" "USB" "megatec_usb ignoreoff"
|
||||
|
||||
"Powercom" "SMK" "" "megatec"
|
||||
"Powercom" "SXL" "" "megatec"
|
||||
"Powercom" "ULT" "" "megatec"
|
||||
"Powercom" "Trust 425/625" "" "powercom"
|
||||
"Powercom" "Advice Partner/King Pr750" "" "powercom"
|
||||
"Powercom" "Black Knight PRO" "" "powercom"
|
||||
"Powercom" "Black Knight PRO" "USB (2009 models, product id: 00a6)" "usbhid-ups (experimental)"
|
||||
"Powercom" "Smart KING Pro (all Smart series)" "powercom"
|
||||
"Powercom" "Smart KING Pro (all Smart series)" "USB (2009 models, product id: 00a3)" "usbhid-ups (experimental)"
|
||||
"Powercom" "Imperial" "" "powercom"
|
||||
"Powercom" "Imperial" "USB (2009 models, product id: 00a2)" "usbhid-ups (experimental)"
|
||||
"Powercom" "Vanguard" "" "megatec"
|
||||
"Powercom" "Vanguard" "USB (2009 models, product id: 00a5)" "usbhid-ups (experimental)"
|
||||
"Powercom" "WOW" "USB (<= 2009 models, product id: 0002)" "powercom (requires 'usbserial' kernel module)"
|
||||
"Powercom" "WOW" "USB (2009 models, product id: 00a4)" "usbhid-ups (experimental)"
|
||||
"Powercom" "(various)" "USB (<= 2009 models, product id: 0002)" "powercom (requires 'usbserial' kernel module)"
|
||||
"Powercom" "(various)" "USB (2009 models, product id: 00a?)" "usbhid-ups (experimental)"
|
||||
|
||||
"PowerGuard" "PG-600" "" "megatec"
|
||||
|
||||
"PowerKinetics" "9001" "" "genericups upstype=17"
|
||||
"PowerKinetics" "BlackOut Buster" "" "megatec"
|
||||
|
||||
"PowerMan" "RealSmart 800" "" "megatec"
|
||||
"PowerMan" "RealSmart 1000" "" "megatec"
|
||||
"PowerMan" "BackPro" "" "genericups upstype=4"
|
||||
|
||||
"PowerTech" "Comp1000" "DTR cable power" "genericups upstype=3"
|
||||
"PowerTech" "SMK-800" "" "megatec"
|
||||
|
||||
"PowerWalker" "Line-Interactive VI 1000" "" "megatec"
|
||||
"PowerWalker" "Line-Interactive VI 400/800" "" "megatec"
|
||||
"PowerWalker" "Line-Interactive VI 600" "" "megatec battvolts=9:13"
|
||||
|
||||
"Powerware" "3110" "" "genericups upstype=7"
|
||||
"Powerware" "3115" "" "genericups upstype=11"
|
||||
"Powerware" "5119, 5125" "" "genericups upstype=15"
|
||||
"Powerware" "5119 RM" "" "genericups upstype=20"
|
||||
"Powerware" "PW3105" "" "bcmxcp_usb"
|
||||
"Powerware" "PW5110" "" "bcmxcp_usb"
|
||||
"Powerware" "PW5115" "Serial port" "bcmxcp"
|
||||
"Powerware" "PW5115" "USB port" "bcmxcp_usb"
|
||||
"Powerware" "PW5125" "" "bcmxcp"
|
||||
"Powerware" "PW9120" "Serial port" "bcmxcp"
|
||||
"Powerware" "PW9120" "USB port" "bcmxcp_usb"
|
||||
"Powerware" "PW9125" "" "bcmxcp"
|
||||
"Powerware" "PW9315" "3-phase" "bcmxcp"
|
||||
"Powerware" "9110" "" "upscode2"
|
||||
"Powerware" "9120" "" "upscode2"
|
||||
"Powerware" "9150" "" "upscode2"
|
||||
"Powerware" "9305" "" "upscode2"
|
||||
"Powerware" "BladeUPS (SNMP)" "ConnectUPS Web/SNMP Card" "snmp-ups (experimental)"
|
||||
"Powerware" "(various)" "ConnectUPS Web/SNMP card" "snmp-ups (experimental)"
|
||||
|
||||
"Powerwell" "PM525A/-625A/-800A/-1000A/-1250A" "" "safenet"
|
||||
|
||||
"Phantom" "Rackable Systems" "1 outlets" "powerman-pdu (experimental)"
|
||||
|
||||
"Raritan" "Intelligent PDU - Dominion PX" "no report, but should be supported" "snmp-ups (experimental)"
|
||||
"Raritan" "Metered PDU - Raritan PM" "no report, but should be supported" "snmp-ups (experimental)"
|
||||
"Raritan" "Switched PDU - Raritan RPC" "no report, but should be supported" "snmp-ups (experimental)"
|
||||
|
||||
"Repotec" "RPF525/625/800/1000" "" "safenet"
|
||||
"Repotec" "RPT-800A" "" "genericups upstype=13"
|
||||
"Repotec" "RPT-162A" "" "genericups upstype=13"
|
||||
|
||||
"SmartLabs" "2412S Power Line Modem" "for X10/Insteon" "powerman-pdu (experimental)"
|
||||
|
||||
"SMS (Brazil)" "Manager III" "" "megatec"
|
||||
|
||||
"SOLA" "305" "cable INT-0025C" "genericups upstype=7"
|
||||
"SOLA" "325" "" "bestups"
|
||||
"SOLA" "520" "" "bestups"
|
||||
"SOLA" "610" "use ID= in ups.conf" "bestups"
|
||||
"SOLA" "620" "" "bestups"
|
||||
"SOLA" "330" "" "megatec"
|
||||
|
||||
"SOLA/BASIC Mexico" "various" "ISBMEX protocol" "isbmex"
|
||||
|
||||
"Socomec" "NeTYS-PE 600VA" "megatec"
|
||||
"Socomec Sicon" "Egys" "420 VA" "powercom"
|
||||
"Socomec Sicon" "Netvision" "UPS equipped with Netvision WEB/SNMP card/external box" "snmp-ups (experimental)"
|
||||
|
||||
"Soltec" "Winmate 525/625/800/1000" "" "safenet"
|
||||
|
||||
"Soyntec" "Sekury C 500" "" "megatec"
|
||||
"Soyntec" "Sekury C 800" "" "megatec"
|
||||
|
||||
"SquareOne Power" "QP1000" "" "megatec"
|
||||
|
||||
"Sun" "ILOM Management Module" "1 outlet" "powerman-pdu (experimental)"
|
||||
|
||||
"SuperPower" "HP360, Hope-550" "" "megatec"
|
||||
|
||||
"SVEN" "Power Pro+ series" "USB" "megatec_usb"
|
||||
"SVEN" "Power Smart RM 2000" "USB" "megatec_usb"
|
||||
|
||||
"Sweex" "500/1000" "smart - shipped with SafeNet" "safenet"
|
||||
"Sweex" "500/1000" "" "genericups upstype=7"
|
||||
"Sweex" "1000" "USB" "richcomm_usb"
|
||||
"Sweex" "(various)" "" "megatec"
|
||||
|
||||
"Sysgration" "UPGUARDS Pro650" "" "megatec"
|
||||
|
||||
"Tecnoware" "Easy Power 1200" "" "megatec"
|
||||
|
||||
"Tripp-Lite" "INTERNETOFFICE700" "USB" "tripplite_usb"
|
||||
"Tripp-Lite" "OMNIVS1000" "USB" "tripplite_usb"
|
||||
"Tripp-Lite" "OMNIVS1500XL" "USB" "tripplite_usb"
|
||||
"Tripp-Lite" "SMART700USB" "USB" "tripplite_usb"
|
||||
"Tripp-Lite" "SMART1500RM2U" "USB" "tripplite_usb"
|
||||
"Tripp-Lite" "SMART550USB" "USB" "tripplite_usb"
|
||||
"Tripp-Lite" "SMART2200RMXL2U" "USB, older models" "tripplite_usb (experimental)"
|
||||
"Tripp-Lite" "SmartUPS" "" "tripplite"
|
||||
"Tripp-Lite" "SmartOnline" "" "tripplitesu"
|
||||
"Tripp-Lite" "(various)" "Lan 2.2 interface - black 73-0844 cable" "genericups upstype=5"
|
||||
"Tripp-Lite" "OMNI1000LCD" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "OMNI900LCD" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "OMNI650LCD" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "1500 LCD" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "AVR550U" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "AVR750U" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "ECO550UPS" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "SmartOnline SU1500RTXL2ua" "USB" "usbhid-ups"
|
||||
"Tripp-Lite" "smart2200RMXL2U" "USB, newer models" "usbhid-ups"
|
||||
|
||||
"Trust" "UPS 1000 Management PW-4105" "" "megatec"
|
||||
"Trust" "UPS 1200VA Management PW-4120M" "" "megatec"
|
||||
"Trust" "UPS 1300VA Management PW-4130M" "" "megatec"
|
||||
|
||||
"UNITEK" "ALPHA 500 IC" "" "megatec dtr=0 rts=1"
|
||||
"UNITEK" "Alpha 1000is" "" "megatec"
|
||||
"UNITEK" "Alpha 500" "" "megatec"
|
||||
"UNITEK" "Alpha 500 ipE" "" "megatec"
|
||||
"UNITEK" "Alpha 2600" "" "megatec"
|
||||
"UNITEK" "Alpha 1200Sx" "USB" "megatec_usb"
|
||||
"UNITEK" "Alpha 1250xD" "USB" "megatec_usb"
|
||||
|
||||
"UPSonic" "CXR1000" "" "megatec"
|
||||
"UPSonic" "LAN Saver 600" "" "genericups upstype=0"
|
||||
"UPSonic" "Power Guardian" "" "genericups upstype=7"
|
||||
"UPSonic" "PrOffice 650" "USB" "megatec_usb"
|
||||
"UPSonic" "DS-800" "USB" "megatec_usb"
|
||||
|
||||
"Various" "(various)" "SEC protocol" "gamatronic"
|
||||
"Various" "(various)" "Generic RUPS model" "genericups upstype=4"
|
||||
"Various" "(various)" "Generic RUPS 2000 (Megatec M2501 cable)" "genericups upstype=21"
|
||||
"Various" "(various)" "Q1 / Megatec protocol" "megatec"
|
||||
"Various" "(various)" "PhoenixTec protocol" "bestups"
|
||||
"Various" "(various)" "SNMP - RFC 1628" "snmp-ups (experimental)"
|
||||
"Various" "(various)" "Safenet software" "safenet"
|
||||
|
||||
"Victron/IMV" "(various)" "" "victronups"
|
||||
"Victron/IMV" "Lite" "crack cable" "genericups upstype=10"
|
||||
|
||||
"Viewsonic" "PowerES" "420E" "optiups"
|
||||
|
||||
"WinPower" "CPM-800" "" "megatec"
|
||||
|
||||
"WTI" "RPS-10" "10 outlets" "powerman-pdu (experimental)"
|
||||
"WTI" "NPS" "8 outlets" "powerman-pdu (experimental)"
|
1351
data/driver.list.in
1351
data/driver.list.in
File diff suppressed because it is too large
Load diff
|
@ -1,70 +0,0 @@
|
|||
# dummy-ups example device definition file
|
||||
#
|
||||
# Generated using:
|
||||
# $ upsc ups@host > epdu-managed.dev
|
||||
|
||||
device.mfr: EATON | Powerware
|
||||
device.model: DBQ10634/5
|
||||
device.serial: ADO6750531
|
||||
device.type: pdu
|
||||
driver.name: snmp-ups
|
||||
driver.parameter.pollinterval: 2
|
||||
driver.parameter.port: somewhere.org
|
||||
driver.version: 2.3.0-1540MS
|
||||
driver.version.internal: 0.44 (mib: aphel_revelation 0.2)
|
||||
outlet.1.current: 0.00
|
||||
outlet.1.current.maximum: 0.00
|
||||
outlet.1.desc: Outlet 1
|
||||
outlet.1.id: 1
|
||||
outlet.1.power: 0.00
|
||||
outlet.1.powerfactor: 0.05
|
||||
outlet.1.realpower: 0.00
|
||||
outlet.1.status: on
|
||||
outlet.1.switchable: 0.00
|
||||
outlet.1.voltage: 247.00
|
||||
outlet.2.current: 0.00
|
||||
outlet.2.current.maximum: 0.16
|
||||
outlet.2.desc: Outlet 2
|
||||
outlet.2.id: 2
|
||||
outlet.2.power: 0.00
|
||||
outlet.2.powerfactor: 0.01
|
||||
outlet.2.realpower: 0.00
|
||||
outlet.2.status: on
|
||||
outlet.2.switchable: 1.00
|
||||
outlet.2.voltage: 247.00
|
||||
outlet.3.current: 0.00
|
||||
outlet.3.current.maximum: 0.16
|
||||
outlet.3.desc: Outlet 3
|
||||
outlet.3.id: 3
|
||||
outlet.3.power: 0.00
|
||||
outlet.3.powerfactor: 0.13
|
||||
outlet.3.realpower: 0.00
|
||||
outlet.3.status: on
|
||||
outlet.3.switchable: 2.00
|
||||
outlet.3.voltage: 247.00
|
||||
outlet.4.current: 0.19
|
||||
outlet.4.current.maximum: 0.56
|
||||
outlet.4.desc: Outlet 4
|
||||
outlet.4.id: 2
|
||||
outlet.4.power: 46.00
|
||||
outlet.4.powerfactor: 0.60
|
||||
outlet.4.realpower: 28.00
|
||||
outlet.4.status: on
|
||||
outlet.4.switchable: 3.00
|
||||
outlet.4.voltage: 247.00
|
||||
outlet.count: 4.00
|
||||
outlet.current: 0.19
|
||||
outlet.desc: All outlets
|
||||
outlet.id: 0
|
||||
outlet.power: 46.00
|
||||
outlet.realpower: 28.00
|
||||
outlet.voltage: 247.00
|
||||
ups.firmware: 01.01.00
|
||||
ups.id: my_device234
|
||||
ups.macaddr:
|
||||
ups.mfr: EATON | Powerware
|
||||
ups.model: DBQ10634/5
|
||||
ups.serial: ADO6750531
|
||||
ups.status:
|
||||
ups.temperature: 49.00
|
||||
device.type: pdu
|
|
@ -1,9 +1,4 @@
|
|||
# dummy-ups example power sequence file
|
||||
#
|
||||
# Base is the same as .dev files, generated using:
|
||||
# $ upsc ups@host > evolution500.seq
|
||||
#
|
||||
# TIMER have then been added to generate power events.
|
||||
# dummy-ups example definition file ; generated with "upsc ups@host > evolution500.dev"
|
||||
|
||||
battery.charge: 90
|
||||
battery.charge.low: 30
|
|
@ -5,7 +5,3 @@ if WITH_CGI
|
|||
nodist_html_DATA = header.html
|
||||
endif
|
||||
EXTRA_DIST = README
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
# Generated by configure script:
|
||||
DISTCLEANFILES = header.html
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -15,61 +16,6 @@
|
|||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
|
@ -90,67 +36,35 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = data/html
|
||||
DIST_COMMON = README $(am__dist_html_DATA_DIST) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/header.html.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c___attribute__.m4 \
|
||||
$(top_srcdir)/m4/ax_c_pragmas.m4 \
|
||||
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
||||
$(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(top_srcdir)/m4/ax_run_or_link_ifelse.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_asciidoc.m4 \
|
||||
$(top_srcdir)/m4/nut_check_cppcheck.m4 \
|
||||
$(top_srcdir)/m4/nut_check_headers_windows.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_ipv6.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnss.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libopenssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||
$(top_srcdir)/m4/nut_check_pkgconfig.m4 \
|
||||
$(top_srcdir)/m4/nut_check_python.m4 \
|
||||
$(top_srcdir)/m4/nut_compiler_family.m4 \
|
||||
$(top_srcdir)/m4/nut_func_getnameinfo_argtypes.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_html_DATA_DIST) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES = header.html
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__dist_html_DATA_DIST = index.html bottom.html nut-banner.png
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
|
@ -173,26 +87,12 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
|||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
am__installdirs = "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(htmldir)"
|
||||
DATA = $(dist_html_DATA) $(nodist_html_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/header.html.in \
|
||||
README
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
ASPELL = @ASPELL@
|
||||
AUGPARSE = @AUGPARSE@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -203,25 +103,13 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPCHECK = @CPPCHECK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DBLATEX = @DBLATEX@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DRVPATH = @DRVPATH@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
|
@ -230,8 +118,12 @@ ECHO_T = @ECHO_T@
|
|||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||
GREP = @GREP@
|
||||
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
|
||||
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
|
||||
HAL_FDI_PATH = @HAL_FDI_PATH@
|
||||
HAL_USER = @HAL_USER@
|
||||
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -239,51 +131,34 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBDIR = @LIBDIR@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LIBS = @LIBNETSNMP_LIBS@
|
||||
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
|
||||
LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LN_S_R = @LN_S_R@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
NUT_DATADIR = @NUT_DATADIR@
|
||||
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||
NUT_NETVERSION = @NUT_NETVERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_NAME = @OS_NAME@
|
||||
|
@ -297,46 +172,29 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PIDPATH = @PIDPATH@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON2 = @PYTHON2@
|
||||
PYTHON3 = @PYTHON3@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
SBINDIR = @SBINDIR@
|
||||
SED = @SED@
|
||||
SERLIBS = @SERLIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||
STATEPATH = @STATEPATH@
|
||||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
TREE_VERSION = @TREE_VERSION@
|
||||
VALGRIND = @VALGRIND@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
XMLLINT = @XMLLINT@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
auglensdir = @auglensdir@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
|
@ -347,12 +205,8 @@ builddir = @builddir@
|
|||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
devddir = @devddir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dummy_PKG_CONFIG = @dummy_PKG_CONFIG@
|
||||
dummy_PKG_CONFIG_CFLAGS = @dummy_PKG_CONFIG_CFLAGS@
|
||||
dummy_PKG_CONFIG_LIBS = @dummy_PKG_CONFIG_LIBS@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
|
@ -369,23 +223,19 @@ libdir = @libdir@
|
|||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
now = @now@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdshutdowndir = @systemdshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
|
@ -401,9 +251,6 @@ udevdir = @udevdir@
|
|||
@WITH_CGI_TRUE@dist_html_DATA = index.html bottom.html nut-banner.png
|
||||
@WITH_CGI_TRUE@nodist_html_DATA = header.html
|
||||
EXTRA_DIST = README
|
||||
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||
# Generated by configure script:
|
||||
DISTCLEANFILES = header.html
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -419,13 +266,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
|||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/html/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu data/html/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -446,11 +294,8 @@ clean-libtool:
|
|||
-rm -rf .libs _libs
|
||||
install-dist_htmlDATA: $(dist_html_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
|
||||
@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
|
@ -464,14 +309,13 @@ uninstall-dist_htmlDATA:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(htmldir)" && rm -f $$files
|
||||
install-nodist_htmlDATA: $(nodist_html_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
|
||||
@list='$(nodist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
|
@ -485,18 +329,17 @@ uninstall-nodist_htmlDATA:
|
|||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nodist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(htmldir)" && rm -f $$files
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
@ -543,15 +386,10 @@ install-am: all-am
|
|||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
@ -559,12 +397,10 @@ clean-generic:
|
|||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
@ -634,21 +470,18 @@ uninstall-am: uninstall-dist_htmlDATA uninstall-nodist_htmlDATA
|
|||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-dist_htmlDATA install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-nodist_htmlDATA \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags-am uninstall uninstall-am uninstall-dist_htmlDATA \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dist_htmlDATA install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-nodist_htmlDATA install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am uninstall uninstall-am uninstall-dist_htmlDATA \
|
||||
uninstall-nodist_htmlDATA
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
8
debian/Makefile.am
vendored
Normal file
8
debian/Makefile.am
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
EXTRA_DIST = changelog control copyright description.subst hotplug \
|
||||
nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \
|
||||
nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \
|
||||
nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \
|
||||
nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \
|
||||
nut.README.Debian nut.templates nut.TODO.Debian \
|
||||
rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \
|
||||
po/pt.po po/pt_BR.po po/templates.pot po/vi.po
|
381
debian/Makefile.in
vendored
Normal file
381
debian/Makefile.in
vendored
Normal file
|
@ -0,0 +1,381 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = packaging/debian
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
|
||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||
$(top_srcdir)/m4/nut_check_hiddev.m4 \
|
||||
$(top_srcdir)/m4/nut_check_ipv6.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||
$(top_srcdir)/m4/nut_report_feature.m4 \
|
||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFPATH = @CONFPATH@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
|
||||
HAL_FDI_PATH = @HAL_FDI_PATH@
|
||||
HAL_USER = @HAL_USER@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
|
||||
LINUX_HIDDEV = @LINUX_HIDDEV@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NETLIBS = @NETLIBS@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
SED = @SED@
|
||||
SERLIBS = @SERLIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STATEPATH = @STATEPATH@
|
||||
STRIP = @STRIP@
|
||||
SUN_LIBUSB = @SUN_LIBUSB@
|
||||
VERSION = @VERSION@
|
||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
cgiexecdir = @cgiexecdir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
driverexecdir = @driverexecdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
hotplugdir = @hotplugdir@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
udevdir = @udevdir@
|
||||
EXTRA_DIST = changelog control copyright description.subst hotplug \
|
||||
nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \
|
||||
nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \
|
||||
nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \
|
||||
nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \
|
||||
nut.README.Debian nut.templates nut.TODO.Debian \
|
||||
rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \
|
||||
po/pt.po po/pt_BR.po po/templates.pot po/vi.po
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu packaging/debian/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu packaging/debian/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
19
debian/NEWS
vendored
19
debian/NEWS
vendored
|
@ -1,19 +0,0 @@
|
|||
nut (2.7.2-2) unstable; urgency=medium
|
||||
|
||||
Since version 1.2 NUT-Monitor uses safer directory permissions when
|
||||
creating ~/.nut-monitor.
|
||||
|
||||
NUT-Monitor will now detect a pre-1.2 settings directory on startup
|
||||
and update its permissions.
|
||||
|
||||
Please note that passwords stored in NUT-Monitor prior to this change
|
||||
may have been exposed, and it is recommended that they be reset.
|
||||
|
||||
-- Michael Fincham <michael.fincham@catalyst.net.nz> Fri, 13 Feb 2015 11:57:12 +1300
|
||||
|
||||
nut (2.6.5-1) experimental; urgency=low
|
||||
|
||||
mge-shut driver has been replaced by a new implementation (newmge-shut).
|
||||
In case of issue with this new version, users can revert to oldmge-shut.
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Mon, 13 Aug 2012 00:32:18 +0200
|
618
debian/changelog
vendored
618
debian/changelog
vendored
|
@ -1,621 +1,13 @@
|
|||
nut (2.8.0-1) unstable; urgency=medium
|
||||
nut (2.4.3-1.1squeeze1) testing-proposed-updates; urgency=low
|
||||
|
||||
[ lagertonne ]
|
||||
* new upstream 2.8.0
|
||||
|
||||
-- lagertonne <mail@lagertonne.de> Wed, 29 Jun 2022 13:12:45 +0000
|
||||
|
||||
nut (2.7.4-14) unstable; urgency=medium
|
||||
|
||||
[ Jeremy Sowden ]
|
||||
* d/patches: add patch to fix FTBFS with g++-11 (closes: #984260)
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* debian/control: Bump Standards-Version to 4.6.0 (no further changes)
|
||||
* debian/source_nut.py: Change the shebang to python3
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sat, 06 Nov 2021 18:41:33 +0100
|
||||
|
||||
nut (2.7.4-13) unstable; urgency=medium
|
||||
|
||||
[ Arnaud Quette ]
|
||||
* Retirement of Arnaud Quette from the Debian project
|
||||
|
||||
[ Debian Janitor ]
|
||||
* Set upstream metadata fields: Bug-Database, Bug-Submit (from ./configure),
|
||||
Name (from ./configure), Repository, Repository-Browse.
|
||||
|
||||
[ Sergio Durigan Junior ]
|
||||
* d/libnutclient0.symbols: Update file, and fix FTBFS. (Closes: #957614)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Thu, 15 Oct 2020 12:16:34 +0200
|
||||
|
||||
nut (2.7.4-12) unstable; urgency=medium
|
||||
|
||||
* Port autopkgtests to python3, taken from Ubuntu, thanks to them and
|
||||
Dimitri John Ledkov (Closes: #937169)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Thu, 30 Jan 2020 01:06:14 +0100
|
||||
|
||||
nut (2.7.4-11) unstable; urgency=medium
|
||||
|
||||
* Remove python(2) binding and disable nut-monitor package for now as it
|
||||
depends on unmaintained pygtk (Closes: #885358, #937169)
|
||||
* debian/control: Add support for the <!nodoc> Build-Profile
|
||||
* debian/patches/0013-fix-doc-build.patch: Fix the documentation build with
|
||||
asciidoc >= 0.9
|
||||
* Disable python3-nut package for now as it's broken with python3
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 15 Dec 2019 21:22:13 +0100
|
||||
|
||||
nut (2.7.4-10) unstable; urgency=medium
|
||||
|
||||
* debian/libnutscan1.symbols: hurd-i386 is not built with ipmi support and
|
||||
thus is libnutscan is not exporting the related symbols
|
||||
* debian/libnutclient0.symbols: Add new C++ template exported on arm64 and
|
||||
x32
|
||||
* debian/tests: Import changes from the ubuntu package, thanks to them.
|
||||
Add psmisc to the dependencies as it's not installed by default in debian
|
||||
* Add the apport script coming from Ubuntu, thanks to them again
|
||||
* Add higher resolution icon for nut-monitor
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Mon, 19 Aug 2019 01:04:36 +0200
|
||||
|
||||
nut (2.7.4-9) unstable; urgency=medium
|
||||
|
||||
[ Ondřej Nový ]
|
||||
* d/changelog: Remove trailing whitespaces
|
||||
* d/control: Remove XS-Testsuite field, not needed anymore
|
||||
|
||||
[ Arnaud Quette ]
|
||||
* debian/control, debian/rules, debian/libnutscan1.install,
|
||||
debian/libnutscan-dev.install: distribute nut-scanner. (Closes: #921379
|
||||
LP: #1814314)
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* Switch from cdbs to debhelper sequence
|
||||
* Bump debhelper compatibility version to 12
|
||||
* Add libltdl-dev to the build-dependencies and fix FTBFS when it is
|
||||
installed (Closes: #831740)
|
||||
* debian/control: Bump Standards-Version to 4.4.0 (no further changes)
|
||||
* debian/control: Add libnss3-dev to the dependencies of libupsclient-dev
|
||||
* debian/tests/control: Drop python-unit and depend against python package
|
||||
instead (Closes: #908963)
|
||||
* debian/control: Fix duplicate package descriptions to please lintian
|
||||
* debian/*.symbols: Add Build-Depends-Package field
|
||||
* debian/control, debian/watch: Use https for the Homepage and download page
|
||||
* debian/libnutclient0.symbols: Adjust the symbols due to C++ changes
|
||||
* debian/patches/0011-use-pkgconfig-module.patch: Use pkg-config module
|
||||
names instead of listing the libraries, to please lintian
|
||||
* Move pidfiles from /var/run/nut to /run/nut, there is nothing else to do
|
||||
since /var/run is a symlink to /run for some times now (policy 3.9.3)
|
||||
* debian/patches/0012-add-AEG-PROTECT-NAS-support.patch: Add support for
|
||||
recent AEG PROTECT NAS UPS, from upstream (Closes: #919112)
|
||||
* debian/nut-server.lintian-overrides: Override
|
||||
package-supports-alternative-init-but-no-init.d-script
|
||||
lib/systemd/system/nut-driver.service, in LSB world, the drivers are started
|
||||
by nut-server initscript
|
||||
* debian/nut-client.lintian-overrides: Drop unused override
|
||||
* debian/nut-monitor.install: Install nut-monitor.appdata.xml in
|
||||
/usr/share/metainfo/ instead of /usr/share/appdata/
|
||||
* Simplify debian/rules, install systemd files on non-linux arch as well
|
||||
* Remove obsolete files and old upgrade paths for users coming from version
|
||||
prior to wheezy
|
||||
* debian/control: Mark -dev packages as Multi-Arch: same
|
||||
* Add debian/patches/0001-reproductible-build.patch: Try to make the
|
||||
documentation reproductible
|
||||
* debian/patches/0003-install-dev-files-in-usr.patch: Also change the prefix
|
||||
in libnutclient.pc.in for consistency
|
||||
* debian/patches/0009-fix-nutshutdown-install.patch: Use patch coming from
|
||||
upstream instead of our own patch
|
||||
* debian/rules, debian/control: Override --with-systemdshutdowndir passed to
|
||||
configure to fix FTBFS on non-linux architectures and do not build-depend
|
||||
against systemd
|
||||
* debian/rules: Install augeas lenses in /usr/share/augeas/lenses/ instead
|
||||
of /usr/share/augeas/lenses/dist/, the later seems to be reserved for
|
||||
augeas own lenses, not 3rd party ones
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 04 Aug 2019 10:34:17 +0200
|
||||
|
||||
nut (2.7.4-8) unstable; urgency=medium
|
||||
|
||||
* debian/libnutclient0.symbols: Use arch-bits=32 and arch-bits=64 instead of
|
||||
listing the architectures explicitly (Closes: #892234)
|
||||
* debian/libnutclient0.symbols: Fix FTBFS on riscv64
|
||||
* debian/control: Update the Vcs-* fields to point to the new gitlab/salsa
|
||||
machine
|
||||
* debian/control: Bump Standards-Version to 4.1.4 (no further changes)
|
||||
* debian/control: Drop X-Python-Version field, not needed anymore because
|
||||
the version is ancient
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Fri, 01 Jun 2018 17:55:25 +0200
|
||||
|
||||
nut (2.7.4-7) unstable; urgency=medium
|
||||
|
||||
* debian/libnutclient0.symbols: Fix symbols file, this should fix FTBFS on
|
||||
most architectures. (Closes: #890981)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Wed, 21 Feb 2018 12:06:16 +0100
|
||||
|
||||
nut (2.7.4-6) unstable; urgency=medium
|
||||
|
||||
* debian/control: Switch dependency from python-gobject to python-gobject-2,
|
||||
the former is a transitional package (Closes: #890158)
|
||||
* debian/libnutclient0.symbols: Update the symbols file to fix the FTBFS on
|
||||
ppc64 and sparc64 architectures
|
||||
* debian/control: Add python-notify to the recommended packages of
|
||||
nut-monitor, it can displays notification in case the UPS is on battery
|
||||
* debian/control: Bump debhelper build-dependency and drop dh-systemd
|
||||
* debian/rules: Assign DEB_HOST_ARCH_OS with ?= instead of :? to please
|
||||
lintian
|
||||
* debian/libnutclient0.symbols: Fix version of symbols introduced in last
|
||||
NMU
|
||||
* Add python3-nut package
|
||||
* debian/control: Bump Standards-Version to 4.1.3 and bump existing packages
|
||||
from the extra priority to optional as the former is deprecated
|
||||
* debian/nut-server.lintian-overrides: Add overrides for
|
||||
udev-rule-missing-subsystem, the SUBSYSTEM check is at the top of the file
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Tue, 20 Feb 2018 13:08:57 +0100
|
||||
|
||||
nut (2.7.4-5.1) unstable; urgency=medium
|
||||
|
||||
* Non-maintainer upload.
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* debian/nut-server.postinst: The udevd process is called systemd-udevd for
|
||||
quite sometimes already, properly detect whether it's running or not, this
|
||||
should fix the devices permissions for USB UPS's (LP: #1540008)
|
||||
* debian/rules: Mask ups-monitor, this is not a real LSB initscript but it's
|
||||
a symlink to the nut-client one. The purpose of this was to offer a common
|
||||
interface to shutdown the UPS in case of power loss, this is not necessary
|
||||
with systemd as this functionality is handeled by the
|
||||
/lib/systemd/system-shutdown/nutshutdown script now.
|
||||
|
||||
[ Michael Stapelberg ]
|
||||
* Update symbols file for gcc-7 (Closes: #853579)
|
||||
|
||||
-- Michael Stapelberg <stapelberg@debian.org> Wed, 23 Aug 2017 22:24:57 +0200
|
||||
|
||||
nut (2.7.4-5) unstable; urgency=medium
|
||||
|
||||
* debian/control: Build-depends against asciidoc-dblatex, Recommends are not
|
||||
pulled automatically by the buildd (Closes: #851015)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Wed, 25 Jan 2017 09:14:10 +0100
|
||||
|
||||
nut (2.7.4-4) unstable; urgency=medium
|
||||
|
||||
* debian/libnutclient0.symbols: Update the .symbols file, this should fix
|
||||
the FTBFS (Closes: #835703)
|
||||
* debian/nut-monitor.install: Install appdata file
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Tue, 27 Sep 2016 23:00:50 +0200
|
||||
|
||||
nut (2.7.4-3) unstable; urgency=medium
|
||||
|
||||
* debian/libnutclient0.symbols: Really add all the needed symbols (Closes:
|
||||
#831725)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 24 Jul 2016 16:40:24 +0200
|
||||
|
||||
nut (2.7.4-2) unstable; urgency=medium
|
||||
|
||||
* debian/libnutclient0.symbols: Adjust .symbols file for arch specific C++
|
||||
symbols (Thanks to pkgkde tools)
|
||||
* Run wrap-and-sort
|
||||
* debian/control: Add systemd to the build-dependencies, we need the
|
||||
systemd.pc file to be installed during the build
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Mon, 18 Jul 2016 17:48:25 +0200
|
||||
|
||||
nut (2.7.4-1) unstable; urgency=low
|
||||
|
||||
[ Arnaud Quette ]
|
||||
* New upstream release (Closes: #806255)
|
||||
* debian/patches/series: remove 0007-killpower-path.patch
|
||||
* debian/control: add new packages libnutclient0 and libnutclient-dev
|
||||
* debian/rules: adapted for the new packages
|
||||
* debian/libnutclient0.install, debian/libnutclient0.symbols,
|
||||
debian/libnutclient-dev.install, debian/libnutclient-dev.manpages:
|
||||
created for the new packages
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* debian/gbp.conf: Switch back the branch to the "debian" one
|
||||
* Drop d/p/0009-fix-favorites-permissions.patch, merged upstream
|
||||
* d/p/0002-nut-monitor-paths.patch, d/p/0006-ups-conf-maxretry.patch:
|
||||
Refreshed
|
||||
* debian/control: Bump Standards-Version to 3.9.8 (no further changes)
|
||||
* debian/control: Add dh-python to the build-dependencies
|
||||
* Bump debhelper compatibility to 9
|
||||
* d/p/0009-fix-nutshutdown-install.patch: Install the nutshutdown script in
|
||||
the correct path
|
||||
* debian/nut-server.install: 52-nut-usbups.rules file has been renamed to
|
||||
62-nut-usbups.rules
|
||||
* debian/libnutclient0.symbols, debian/libupsclient4.symbols: Adjust the
|
||||
.symbols files
|
||||
* debian/control: Use https:// URL's in Vcs-* fields
|
||||
* debian/nut-cgi.README.Debian: Fix typo
|
||||
* debian/control: Fix the grammar in nut-ipmi long description
|
||||
* Drop debian/nut-monitor.menu and debian/nut-monitor.xpm, not needed
|
||||
anymore per tech-ctte decision #741573
|
||||
* debian/rules: Enable hardening=+all
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Mon, 18 Jul 2016 10:58:49 +0200
|
||||
|
||||
nut (2.7.2-4) unstable; urgency=medium
|
||||
|
||||
* Really fix package initial installation when PID1 is systemd (Closes:
|
||||
#747863)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Fri, 20 Mar 2015 23:12:53 +0100
|
||||
|
||||
nut (2.7.2-3) unstable; urgency=medium
|
||||
|
||||
* debian/NEWS: Fix NEWS file syntax
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Tue, 17 Feb 2015 23:13:02 +0100
|
||||
|
||||
nut (2.7.2-2) unstable; urgency=medium
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* debian/gbp.conf: Switch to debian-jessie branch
|
||||
* debian/rules: Revert the changes made in the previous NMU, I don't think
|
||||
that dropping the .service file that late in the release cycle is a good
|
||||
idea and anyway this was causing left-over files on upgrade.
|
||||
* Add wrappers that check the MODE in /etc/nut/nut.conf to avoid starting
|
||||
the daemons if nut is not configured (Closes: #747863).
|
||||
|
||||
[ Michael Fincham ]
|
||||
* Add patch that detects and corrects unsafe permissions on ~/.nut-monitor
|
||||
left over from old installations during NUT-Monitor startup.
|
||||
(Closes: #777706)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Tue, 17 Feb 2015 09:54:11 +0100
|
||||
|
||||
nut (2.7.2-1.1) unstable; urgency=medium
|
||||
|
||||
* Non-maintainer upload.
|
||||
* Port Ubuntu change to drop upstream systemd unit files to allow
|
||||
sysvinit files for Jessie. (Closes: #747863)
|
||||
|
||||
-- Neil Williams <codehelp@debian.org> Sat, 17 Jan 2015 10:29:11 +0000
|
||||
|
||||
nut (2.7.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
- Fix the undefined references (Closes: #731156)
|
||||
- debian/patches/0004-fix-systemd-service.patch: Refreshed
|
||||
- Drop d/p/0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch:
|
||||
Merged upstream
|
||||
- debian/nut-server.install: Upstream is now installing upsdrvctl /sbin
|
||||
- Rename package libupsclient3 to libupsclient4, soname got bumped again
|
||||
* debian/rules, debian/control, d/p/0004-fix-systemd-service.patch: Use a
|
||||
symlink instead of an Alias= to mask the SysV initscript
|
||||
* debian/control: Bump Standards-Version to 3.9.5 (no further changes)
|
||||
* debian/tests/control: Add lsb-release and netcat to the dependencies
|
||||
(Closes: #733189)
|
||||
* debian/control, debian/rules: Call dh-autoreconf and pass LDFLAGS to
|
||||
minimize runtime dependencies
|
||||
* debian/patches/0008-drop-w3c-icons.patch: Remove the link to external W3C
|
||||
icons to prevent privacy breach (privacy-breach-w3c-valid-html)
|
||||
* debian/nut-server.install, debian/nut-server.manpages: Install new
|
||||
nutdrv_atcl_usb driver
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Tue, 22 Apr 2014 22:46:12 +0200
|
||||
|
||||
nut (2.7.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release (Closes: #730183)
|
||||
- Refresh debian/patches/0004-fix-systemd-service.patch
|
||||
- Rename libupsclient1 to libupsclient3 following the soname bump, rename
|
||||
libupsclient1-dev to libupsclient-dev, the package is not co-installable
|
||||
anyway
|
||||
* debian/rules, debian/control: Enable SSL support using libnss3
|
||||
* d/p/0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch,
|
||||
d/p/0006-ups-conf-maxretry.patch: By default, retry to start the drivers
|
||||
up-to three times, this should mitigate races with slow devices
|
||||
(Closes: #694717)
|
||||
* debian/nut-server.install, debian/nut-server.manpages: Install new drivers
|
||||
* Move bash-completion file to /usr/share/bash-completion/
|
||||
* debian/patches/0007-killpower-path.patch: Revert POWERDOWNFLAG back to
|
||||
/etc/killpower
|
||||
* debian/nut-client.lintian-overrides: Add override for
|
||||
systemd-no-service-for-init-script ups-monitor
|
||||
* debian/rules: Drop static ordering for the initscripts and pass
|
||||
--restart-after-upgrade option to dh_installinit and dh_systemd_start to
|
||||
minimize the downtime of the daemons
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 24 Nov 2013 20:57:51 +0100
|
||||
|
||||
nut (2.6.5-4) unstable; urgency=low
|
||||
|
||||
* debian/control: Do not build nut-ipmi on hurd-i386 as freeipmi is not
|
||||
available on that platform.
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Thu, 11 Jul 2013 12:29:58 +0200
|
||||
|
||||
nut (2.6.5-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* debian/control:
|
||||
- Move libupsclient1 package to libs Section
|
||||
- Add libgd-dev to the Build-Depends, keep the other alternatives to ease
|
||||
the backports
|
||||
- Bump Standards-Version to 3.9.4 (no further changes)
|
||||
- Add autotools-dev to the build-dependencies so config.{guess,sub} are
|
||||
getting updated during build
|
||||
- Use canonical URL for the VCS-* fields
|
||||
- Add build-dependency against dh-systemd and bump minimal cdbs version so
|
||||
systemd helpers are called during build.
|
||||
* Added dep-8-tests to improve QA (from Ubuntu, closes: #708130)
|
||||
* debian/nut-monitor.menu, nut-monitor.xpm: Add Debian menu entry (Closes:
|
||||
#708813)
|
||||
* debian/rules: Drop manual creation of .service files symlink, this should
|
||||
be handled by dh_systemd now
|
||||
* debian/patches/0004-fix-systemd-service.patch: Also add Wants/Before for
|
||||
systemd-udev-settle.service in the nut-driver.service as it got renamed
|
||||
after udev merge
|
||||
* debian/patches/0004-fix-systemd-service.patch: Fix path for upsdrvctl in
|
||||
scripts/systemd/nutshutdown.in
|
||||
|
||||
[ Ivo De Decker ]
|
||||
* debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done
|
||||
by postinst during upgrade from lenny to squeeze (Really closes: #677054)
|
||||
Thanks to Andreas Beckmann for the review.
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Thu, 11 Jul 2013 00:50:06 +0200
|
||||
|
||||
nut (2.6.5-2) experimental; urgency=low
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* debian/control: Move the nut-monitor Suggests from nut-server to
|
||||
nut-client
|
||||
* Restore proper SELinux context for runtime created /var/run/nut directory
|
||||
* debian/control: Fix typo in package description
|
||||
* debian/watch: Update watch file URL (Thanks to Bart Martens)
|
||||
* debian/rules: Alias systemd nut-monitor service file to nut-client to
|
||||
prevent it from running twice
|
||||
* d/p/0004-fix-systemd-service.patch: Fix systemd service file for Debian
|
||||
* Install tmpfiles conf files to create /run/nut directory during boot
|
||||
|
||||
[ Sébastien Villemot ]
|
||||
* debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older
|
||||
versions of the postinst (Closes: #677054)
|
||||
|
||||
[ Ivo De Decker ]
|
||||
* Only fix permissions of configfiles on first install.
|
||||
* Only remove /etc/init.d/nut from previous versions of nut in nut-server
|
||||
postinst if there are no local changes.
|
||||
* Also remove /etc/init.d/nut in nut-client postinst. Thanks to
|
||||
Laurent Bigonville for the hint.
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Thu, 31 Jan 2013 21:51:31 +0100
|
||||
|
||||
nut (2.6.5-1) experimental; urgency=low
|
||||
|
||||
[ Arnaud Quette ]
|
||||
* debian/control, debian/nut-ipmi.{install,manpages}: create IPMI
|
||||
support package
|
||||
* debian/nut-server.install: only install USB udev rules
|
||||
|
||||
[ Laurent Bigonville ]
|
||||
* New upstream release
|
||||
- Drop debian/patches/0001-fix-upsmon-regression.patch, applied upstream
|
||||
* Follow multi-arch policy
|
||||
* Install systemd .service files (Closes: #679450)
|
||||
* debian/nut-server.install: Drop newmge-shut, renamed upstream to mge-shut
|
||||
and install the old implementation (oldmge-shut) instead
|
||||
* debian/control: Drop ancient Conflicts/Provides/Replaces
|
||||
* Install all development files under /usr
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Mon, 13 Aug 2012 01:59:18 +0200
|
||||
|
||||
nut (2.6.4-2) unstable; urgency=low
|
||||
|
||||
* debian/rules: Stop the nut-client before nut-server on systems using static
|
||||
boot ordering (Closes: #679451)
|
||||
* debian/nut-server.postinst: Remove /etc/init.d/nut on upgrade
|
||||
(Closes: #677822)
|
||||
* Rename nut-server.lintian-overrides to nut-client.lintian-overrides and
|
||||
adjust overrides now that ups-monitor is shipped in nut-client package
|
||||
(Closes: #677947)
|
||||
* Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched
|
||||
regression (Taken from upstream) (Closes: #679513)
|
||||
* Move nut metapackage to Section: metapackages
|
||||
* Also create nut user when installing nut-client package and do not delete
|
||||
it on purge anymore (Closes: #682000)
|
||||
* Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration
|
||||
happends before squeeze release and this was against policy to have a
|
||||
maintainer script modifying a conffile in the first place (Closes: #684392)
|
||||
* Add dependency against adduser and lsb-base on nut-client package
|
||||
* Be sure that client is stopped before the server also when using
|
||||
dependencies based boot
|
||||
* Fix package descriptions (Closes: #678068)
|
||||
* Also install /bin/upssched-cmd in nut-client package as this script is
|
||||
referenced in default upssched.conf config file
|
||||
* debian/watch: Update watch file
|
||||
* Be sure that all maintainer scripts are returning 0 at their end
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 12 Aug 2012 20:38:52 +0200
|
||||
|
||||
nut (2.6.4-1) unstable; urgency=high
|
||||
|
||||
* New upstream release (Closes: #671444)
|
||||
* acknowledges NMU (Closes: #613643)
|
||||
* debian/nut-client.init: fix action "start" and use of log_*_*msg
|
||||
LSB log functions (Closes: #675619)
|
||||
* debian/nut-server.preinst: remove obsolete file(s) left in
|
||||
/etc/udev/rules.d and related processing: udev files are now located
|
||||
in /lib/udev/rules, and there is no reason to modify the dedicated
|
||||
USB UPS rules (52-nut-usbups.rules) (Closes: #660072)
|
||||
|
||||
-- Arnaud Quette <aquette@debian.org> Wed, 06 Jun 2012 21:03:50 +0200
|
||||
|
||||
nut (2.6.3-2) unstable; urgency=low
|
||||
|
||||
* debian/nut-server.init: rewrite to match upsd / drivers startup scope
|
||||
* debian/nut-client.init: created to match upsmon startup scope
|
||||
(Closes: #634858)
|
||||
* debian/nut.TODO.Debian, debian/Makefile.am: updated to reflect the above
|
||||
* debian/rules: install nut-client.init, and update to reflect the above
|
||||
* debian/control, debian/Makefile.am: updated to reflect the above
|
||||
* debian/control:
|
||||
- add Breaks on nut-server (<< 2.6.3-1~)
|
||||
- bump Standards-Version to 3.9.3
|
||||
* debian/nut-client.links: renamed from debian/nut-server.links, since
|
||||
ups-monitor is now provided by nut-client initscript
|
||||
* debian/nut.README.Debian: renamed from nut-server.README.Debian,
|
||||
to provide it with both client and server packages
|
||||
* debian/nut-server.install: add missing drivers (clone-outlet,
|
||||
liebert-esp2 and microdowell)
|
||||
* debian/nut-server.manpages: add missing manual pages (apcsmart-old,
|
||||
ivtscd, liebert-esp2 and microdowell)
|
||||
|
||||
-- Arnaud Quette <aquette@debian.org> Tue, 24 Jan 2012 13:14:59 +0100
|
||||
|
||||
nut (2.6.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release (Closes: #635186, #598741, #633756, #638221)
|
||||
* debian/nut-server.{install,manpages}: add richcomm_usb
|
||||
* debian/nut-server.install, debian/rules: install Avahi service file
|
||||
* debian/rules, nut-client.install: install Augeas lenses
|
||||
* debian/nut-server.README.Debian: clarify udev explanation (Closes: #529664)
|
||||
* debian/patches/0001-fix_spelling_and_typo.patch,
|
||||
debian/patches/0003-libupsclient-version.patch: removed since these are now
|
||||
fixed upstream
|
||||
* debian/patches/series: updated
|
||||
|
||||
-- Arnaud Quette <aquette@debian.org> Tue, 24 Jan 2012 13:14:59 +0100
|
||||
|
||||
nut (2.6.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release (Closes: #594989)
|
||||
* debian/control:
|
||||
- remove legacy Build-Depends for nut-hal-drivers on libdbus and libglib
|
||||
- Build-Depends-Indep on docbook-xsl for offline document
|
||||
generation (Closes: #635347)
|
||||
* debian/nut-server.install: add apcsmart-old
|
||||
* debian/nut-server.init:
|
||||
- add udev as Required-Start/Stop (Closes: #642412)
|
||||
- remove legacy support for /etc/default/nut (Closes: #638021)
|
||||
* debian/patches/0003-libupsclient-version.patch: added to fix the missing
|
||||
libupsclient version info bump
|
||||
* debian/libupsclient1-dev.links: update link name
|
||||
* debian/libupsclient1.symbols: add with upscli_tryconnect
|
||||
* debian/nut.TODO.Debian: update and complete the TODO list
|
||||
|
||||
-- Arnaud Quette <aquette@debian.org> Thu, 29 Sep 2011 18:39:16 +0200
|
||||
|
||||
nut (2.6.1-2) unstable; urgency=low
|
||||
|
||||
* debian/nut.README.Debian: Adjust udev rules naming for permissions override
|
||||
(Closes: #529664)
|
||||
* Re-add and refresh debian/patches/0001-fix_spelling_and_typo.patch:
|
||||
Some typos and spelling errors remain.
|
||||
* Split nut package into nut-client and nut-server, keep nut package as
|
||||
metapackage
|
||||
* Generate PDF and html doc and install it in nut-doc package
|
||||
* debian/rules:
|
||||
- List non-installed files
|
||||
- Includes python-module.mk
|
||||
- Add flags to build documentation and install it
|
||||
* debian/control:
|
||||
- Add python-nut package and add python build-dependency
|
||||
- Set nut-powerman-pdu priority to extras
|
||||
- Add nut-monitor package
|
||||
- Add nut-doc package and add required C/R/P
|
||||
- Add libups-nut-perl package
|
||||
* debian/nut-server.prerm: Remove /var/run/nut during removal
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 17 Jul 2011 19:03:18 +0200
|
||||
|
||||
nut (2.6.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release (Closes: #595953, #614842, #595773)
|
||||
* debian/patches/*.patch: removed since these are now fixed upstream
|
||||
[Laurent Bigonville]
|
||||
* Drop HAL package and build-dependencies (Closes: #613197)
|
||||
* debian/control:
|
||||
- Bump Standards-Version to 3.9.2 (no further changes)
|
||||
- Drop autotools build-dependencies (not needed anymore)
|
||||
- Drop non-existing build-dependencies
|
||||
* debian/rules:
|
||||
- Correctly pass flags to configure
|
||||
|
||||
-- Arnaud Quette <aquette@debian.org> Wed, 01 Jun 2011 22:34:28 +0200
|
||||
|
||||
nut (2.6.0-2) unstable; urgency=low
|
||||
|
||||
* debian/nut-snmp.docs: Distribute snmp.txt doc file (Closes: #548295)
|
||||
* d/p/0001-fix_spelling_and_typo.patch: Update and refresh
|
||||
* debian/nut.lintian-overrides: Fix typo
|
||||
* debian/patch/0002-fix_libupsclient_pc.patch: Fix libupsclient.pc (Closes:
|
||||
#624255)
|
||||
* debian/rules:
|
||||
- Switch to cdbs
|
||||
- Remove not existing configure options (Closes: #611813)
|
||||
- Drop Phony rules (Closes: #613699)
|
||||
* debian/control:
|
||||
- Add cdbs build-dependency
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Sun, 08 May 2011 21:23:46 +0200
|
||||
|
||||
nut (2.6.0-1) unstable; urgency=low
|
||||
|
||||
* New upstream release (Closes: #575176, #588648, #609597, #687985)
|
||||
* debian/patches/*.patch: removed since these are now fixed upstream
|
||||
* debian/patches/0001-fix_spelling_and_typo.patch,
|
||||
debian/patches/series: reworked to match the new upstream release
|
||||
* debian/nut.install, debian/nut.manpages: remove obsolete reference to
|
||||
megatec and megatec_usb, now respectively replaced by blazer_ser and
|
||||
blazer_usb
|
||||
* debian/nut.docs: limit distributed documentation
|
||||
|
||||
-- Arnaud Quette <aquette@debian.org> Wed, 16 Feb 2011 22:55:26 +0100
|
||||
|
||||
nut (2.4.3-3) UNRELEASED; urgency=low
|
||||
|
||||
* debian/control:
|
||||
- Wrap build-dependencies
|
||||
- Change nut-cgi Recommends to apache2 | httpd-cgi
|
||||
* debian/nut.postinst: Only trigger USB subsystem, should Closes: #574769
|
||||
* debian/patches/0002-fix_udev_action.patch: Use SUBSYSTEM instead of BUS
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Tue, 11 Jan 2011 22:24:07 +0100
|
||||
|
||||
nut (2.4.3-2) unstable; urgency=medium
|
||||
|
||||
* debian/control:
|
||||
- Bump Standards-Version to 3.9.1
|
||||
- Update Vcs-* fields to new GIT repository
|
||||
- Add myself as Uploaders
|
||||
* Switch to dpkg-source 3.0 (quilt) format (Closes: #573601)
|
||||
* debian/patches/0001-low_speed_usb_ups.patch: Use patch system for changes
|
||||
that were applied directly in the source
|
||||
* Add debian/gbp.conf file
|
||||
* debian/watch: Bump version to 3
|
||||
* Add debian/patches/0002-fix_udev_action.patch: Also set permission for
|
||||
"change" udev ACTION (Closes: #557178)
|
||||
* debian/nut.postrm: Do not try to remove nut user is deluser is not
|
||||
installed anymore
|
||||
* debian/control: Add myself as Uploaders
|
||||
* debian/nut.manpages: Install manpage nut.conf.5 (Closes: #528222)
|
||||
* debian/copyright: Fix copyright-with-old-dh-make-debian-copyright
|
||||
* Remove nut-snmp.lintian-overrides, not needed anymore
|
||||
* debian/patches/0003-fix_spelling_and_typo.patch: Fix some spelling errors
|
||||
* Add debian/libupsclient1.symbols file
|
||||
* Add debian/nut.links: Re-add /etc/init.d/ups-monitor that was lost for
|
||||
some reasons (Closes: #592351)
|
||||
* debian/nut.lintian-overrides: Add override for
|
||||
init.d-script-does-not-provide-itself /etc/init.d/ups-monitor
|
||||
* Drop libupsclient1.post{inst,rm}: ldconfig call is added automatically by
|
||||
debhelper
|
||||
* debian/libupsclient1-dev.install: Do not ship /lib/libupsclient.la anymore
|
||||
* debian/rules: Remove dpatch logic as we are using package source version
|
||||
'3.0 (quilt)'
|
||||
* debian/compat: Bump debhelper compatibility to 8
|
||||
* scripts/udev/nut-usbups.rules.in: Also set permission for "change" udev
|
||||
ACTION (Closes: #557178)
|
||||
|
||||
-- Laurent Bigonville <bigon@debian.org> Fri, 24 Dec 2010 11:46:22 +0100
|
||||
-- Laurent Bigonville <bigon@debian.org> Mon, 27 Dec 2010 14:51:02 +0100
|
||||
|
||||
nut (2.4.3-1.1) unstable; urgency=low
|
||||
|
||||
|
|
2
debian/compat
vendored
2
debian/compat
vendored
|
@ -1 +1 @@
|
|||
12
|
||||
6
|
||||
|
|
250
debian/control
vendored
250
debian/control
vendored
|
@ -1,54 +1,22 @@
|
|||
Source: nut
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Maintainer: Laurent Bigonville <bigon@debian.org>
|
||||
Build-Depends: debhelper (>= 12),
|
||||
dh-python,
|
||||
libfreeipmi-dev (>= 0.8.5) [!hurd-i386],
|
||||
libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev,
|
||||
libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386],
|
||||
libltdl-dev,
|
||||
libneon27-gnutls-dev | libneon27-dev,
|
||||
libnss3-dev,
|
||||
libpowerman0-dev (>= 2.3.3),
|
||||
libsnmp-dev | libsnmp9-dev,
|
||||
libusb-dev (>= 0.1.8),
|
||||
libwrap0-dev (>= 7.6),
|
||||
python3
|
||||
Build-Depends-Indep: asciidoc (>= 8.6.3) <!nodoc>,
|
||||
asciidoc-dblatex <!nodoc>,
|
||||
dblatex (>= 0.2.5) <!nodoc>,
|
||||
docbook-xsl <!nodoc>,
|
||||
libxml2-utils <!nodoc>
|
||||
Standards-Version: 4.6.0
|
||||
Homepage: https://networkupstools.org/
|
||||
Vcs-Browser: https://salsa.debian.org/debian/nut
|
||||
Vcs-Git: https://salsa.debian.org/debian/nut.git
|
||||
Maintainer: Arnaud Quette <aquette@debian.org>
|
||||
Uploaders: Laurent Bigonville <bigon@debian.org>
|
||||
Build-Depends: debhelper (>= 7), autoconf, automake, libtool, libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libhal-dev (>= 0.5.8), hal, libdbus-1-dev, libdbus-glib-1-dev, libglib2.0-dev, libneon27-gnutls-dev | libneon26-gnutls-dev | libneon-dev | libneon27-dev | libneon26-dev, libpowerman0-dev (>= 2.3.3), libwrap0-dev (>= 7.6)
|
||||
Standards-Version: 3.8.4
|
||||
Homepage: http://www.networkupstools.org
|
||||
Vcs-Browser: http://svn.debian.org/wsvn/nut
|
||||
Vcs-Svn: svn://svn.debian.org/nut/trunk
|
||||
|
||||
Package: nut
|
||||
Architecture: all
|
||||
Section: metapackages
|
||||
Depends: nut-client, nut-server, ${misc:Depends}
|
||||
Description: network UPS tools - metapackage
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package is a metapackage that installs both nut-server and nut-client,
|
||||
in most cases it is sufficient for a basic UPS monitoring system.
|
||||
|
||||
Package: nut-server
|
||||
Architecture: any
|
||||
Depends: adduser,
|
||||
lsb-base (>= 3.0-6),
|
||||
nut-client (= ${binary:Version}),
|
||||
udev [linux-any],
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Suggests: nut-cgi, nut-ipmi, nut-snmp, nut-xml
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}
|
||||
Recommends: bash-completion
|
||||
Suggests: nut-cgi, nut-snmp, nut-dev, nut-xml
|
||||
Provides: ups-monitor, nut-doc, nut-usb
|
||||
Conflicts: ups-monitor, nut-doc, nut-hal-drivers, nut-usb (<< 2.1.0-3), nut-dev (<< 2.2.2)
|
||||
Replaces: nut-doc
|
||||
Description: network UPS tools - core system
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -57,32 +25,15 @@ Description: network UPS tools - core system
|
|||
changes.
|
||||
.
|
||||
This package provides NUT's core system, and the serial and USB UPS
|
||||
drivers.
|
||||
|
||||
Package: nut-client
|
||||
Architecture: any
|
||||
Depends: adduser, lsb-base (>= 3.0-6), ${misc:Depends}, ${shlibs:Depends}
|
||||
Provides: ups-monitor
|
||||
Conflicts: ups-monitor
|
||||
Recommends: bash-completion
|
||||
Suggests: nut-monitor
|
||||
Replaces: ups-monitor
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Description: network UPS tools - clients
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package provides NUT's clients that allows the user to control
|
||||
and monitor the UPS.
|
||||
drivers. In most cases it is sufficient for a basic UPS monitoring
|
||||
system.
|
||||
|
||||
Package: nut-cgi
|
||||
Architecture: any
|
||||
Depends: adduser, ${misc:Depends}, ${shlibs:Depends}
|
||||
Recommends: apache2 | httpd-cgi
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
|
||||
Recommends: apache | httpd
|
||||
Suggests: nut
|
||||
Replaces: nut (<< 1.1.11)
|
||||
Description: network UPS tools - web interface
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -95,7 +46,8 @@ Description: network UPS tools - web interface
|
|||
|
||||
Package: nut-snmp
|
||||
Architecture: any
|
||||
Depends: nut (>= 1.4.1-pre1), ${misc:Depends}, ${shlibs:Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1)
|
||||
Conflicts: nut (<= 1.4.0)
|
||||
Description: network UPS tools - SNMP driver
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -107,23 +59,26 @@ Description: network UPS tools - SNMP driver
|
|||
supports various MIBs including IETF, MGE, and APC. It adds an SNMP
|
||||
Manager interface to the core NUT system.
|
||||
|
||||
Package: nut-ipmi
|
||||
Architecture: kfreebsd-any linux-any
|
||||
Depends: nut (>= 1.4.1-pre1), ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: network UPS tools - IPMI driver
|
||||
Package: nut-hal-drivers
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${udev}
|
||||
Conflicts: nut
|
||||
Provides: hal-ups-support
|
||||
Breaks: udev (<< 124-1)
|
||||
Description: network UPS tools - HAL interface
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package currently provides nut-ipmipsu, a driver which allows the user to
|
||||
monitor IPMI power supply units (PSU) found in servers of popular brands, such
|
||||
as Dell, HP, IBM. It adds an IPMI interface to the core NUT system.
|
||||
This package provides add-ons for the hardware abstraction layer (HAL) that
|
||||
allow desktop environments to monitor locally-connected UPS equipment. The
|
||||
HAL drivers cannot be used at the same time as the normal NUT upsd.
|
||||
|
||||
Package: nut-xml
|
||||
Architecture: any
|
||||
Depends: nut (>= 2.2.2), ${misc:Depends}, ${shlibs:Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.2.2)
|
||||
Description: network UPS tools - XML/HTTP driver
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -137,10 +92,7 @@ Description: network UPS tools - XML/HTTP driver
|
|||
|
||||
Package: nut-powerman-pdu
|
||||
Architecture: any
|
||||
Depends: nut (>= 2.4.0),
|
||||
powerman (>= 2.3.3),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.4.0), powerman (>= 2.3.3)
|
||||
Description: network UPS tools - PowerMan PDU driver
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -151,27 +103,9 @@ Description: network UPS tools - PowerMan PDU driver
|
|||
This package provides powerman-pdu, which allows NUT clients to communicate
|
||||
with the PowerMan daemon to support PDUs.
|
||||
|
||||
Package: nut-doc
|
||||
Architecture: all
|
||||
Section: doc
|
||||
Depends: ${misc:Depends}
|
||||
Suggests: doc-base
|
||||
Build-Profiles: <!nodoc>
|
||||
Description: network UPS tools - documentation
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package contains FAQ, user, developer and packager documentation.
|
||||
|
||||
Package: libupsclient4
|
||||
Section: libs
|
||||
Package: libupsclient1
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: network UPS tools - client library
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -181,14 +115,12 @@ Description: network UPS tools - client library
|
|||
.
|
||||
This package provides the shared client library.
|
||||
|
||||
Package: libupsclient-dev
|
||||
Package: libupsclient1-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: libnss3-dev,
|
||||
libupsclient4 (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Multi-Arch: same
|
||||
Depends: libupsclient1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
|
||||
Provides: nut-dev
|
||||
Conflicts: nut-dev (<< 2.2.2)
|
||||
Description: network UPS tools - development files
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
|
@ -197,109 +129,3 @@ Description: network UPS tools - development files
|
|||
changes.
|
||||
.
|
||||
This package provides the development files.
|
||||
|
||||
Package: libnutclient0
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Multi-Arch: same
|
||||
Description: network UPS tools - new client library
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package provides the new shared client library.
|
||||
|
||||
Package: libnutclient-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: libnutclient0 (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Multi-Arch: same
|
||||
Description: network UPS tools - development files for the new client library
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package provides the development files for the new client library.
|
||||
|
||||
Package: libnutscan1
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Multi-Arch: same
|
||||
Description: network UPS tools - scanner library
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package provides the shared scanner library.
|
||||
|
||||
Package: libnutscan-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: libnutscan1 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
|
||||
Breaks: libupsclient-dev (<< 2.7.4-9~)
|
||||
Replaces: libupsclient-dev (<< 2.7.4-9~)
|
||||
Multi-Arch: same
|
||||
Description: network UPS tools - development files for the scanner library
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package provides the development files for the scanner library.
|
||||
|
||||
#Package: python3-nut
|
||||
#Section: python
|
||||
#Architecture: all
|
||||
#Depends: ${misc:Depends}, ${python3:Depends}
|
||||
#Description: network UPS tools - Python3 bindings for NUT server
|
||||
# Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
# allows computers to share uninterruptible power supply (UPS) and
|
||||
# power distribution unit (PDU) hardware. Clients access the hardware
|
||||
# through the server, and are notified whenever the power status
|
||||
# changes.
|
||||
# .
|
||||
# This package provides Python3 bindings to connect to NUT server.
|
||||
|
||||
#Package: nut-monitor
|
||||
#Architecture: all
|
||||
#Depends: python-glade2,
|
||||
# python-gobject-2,
|
||||
# python-gtk2,
|
||||
# python-nut,
|
||||
# ${misc:Depends},
|
||||
# ${python:Depends}
|
||||
#Recommends: python-notify
|
||||
#Description: network UPS tools - GUI application to monitor UPS status
|
||||
# Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
# allows computers to share uninterruptible power supply (UPS) and
|
||||
# power distribution unit (PDU) hardware. Clients access the hardware
|
||||
# through the server, and are notified whenever the power status
|
||||
# changes.
|
||||
# .
|
||||
# This package provides nut-monitor, a GUI application to monitor UPS status.
|
||||
|
||||
Package: libups-nut-perl
|
||||
Section: perl
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${perl:Depends}
|
||||
Description: network UPS tools - Perl bindings for NUT server
|
||||
Network UPS Tools (NUT) is a client/server monitoring system that
|
||||
allows computers to share uninterruptible power supply (UPS) and
|
||||
power distribution unit (PDU) hardware. Clients access the hardware
|
||||
through the server, and are notified whenever the power status
|
||||
changes.
|
||||
.
|
||||
This package provides Perl bindings to connect to NUT server.
|
||||
|
|
4
debian/copyright
vendored
4
debian/copyright
vendored
|
@ -65,5 +65,5 @@ Licenses:
|
|||
may be found in /usr/share/common-licenses/GPL-3.
|
||||
|
||||
|
||||
The Debian packaging is Copyright (C) 2008, Arnaud Quette <aquette@debian.org>
|
||||
and is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
|
||||
The Debian packaging is (C) 2008, Arnaud Quette <aquette@debian.org> and
|
||||
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
|
||||
|
|
1
debian/description.subst
vendored
Normal file
1
debian/description.subst
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
description=nut is a client/server uninterruptible power supply (UPS) monitoring system${Newline}${Space}that permits the sharing of one (or more) UPS between several machines. The${Newline}${Space}'server' monitors the UPS and notifies the 'clients' when the UPS is on${Newline}${Space}battery or has a low battery.
|
8
debian/gbp.conf
vendored
8
debian/gbp.conf
vendored
|
@ -1,8 +0,0 @@
|
|||
[DEFAULT]
|
||||
debian-branch = debian
|
||||
upstream-branch = upstream
|
||||
pristine-tar = True
|
||||
|
||||
[git-buildpackage]
|
||||
tarball-dir = ../tarballs/
|
||||
export-dir = ../build-area/
|
24
debian/hotplug
vendored
Normal file
24
debian/hotplug
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
# taken from libgphoto2
|
||||
|
||||
GROUP=nut
|
||||
|
||||
# for previous udev versions
|
||||
if [ "$ACTION" = "add" ] && [ -f "$DEVICE" ]
|
||||
then
|
||||
# check if $GROUP really exists
|
||||
if getent group $GROUP > /dev/null; then
|
||||
chmod 660 "$DEVICE"
|
||||
chown root:$GROUP "$DEVICE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# for recent udev versions
|
||||
if [ "$ACTION" = "add" ] && [ -r "$DEVNAME" ]
|
||||
then
|
||||
# check if $GROUP really exists
|
||||
if getent group $GROUP > /dev/null; then
|
||||
chmod 660 "$DEVNAME"
|
||||
chown root:$GROUP "$DEVNAME"
|
||||
fi
|
||||
fi
|
4
debian/libnutclient-dev.install
vendored
4
debian/libnutclient-dev.install
vendored
|
@ -1,4 +0,0 @@
|
|||
usr/include/nutclient.h
|
||||
usr/lib/*/libnutclient.a
|
||||
usr/lib/*/libnutclient.so
|
||||
usr/lib/*/pkgconfig/libnutclient.pc
|
1
debian/libnutclient0.install
vendored
1
debian/libnutclient0.install
vendored
|
@ -1 +0,0 @@
|
|||
lib/*/libnutclient.so.*
|
199
debian/libnutclient0.symbols
vendored
199
debian/libnutclient0.symbols
vendored
|
@ -1,199 +0,0 @@
|
|||
# SymbolsHelper-Confirmed: 2.7.4-9~ amd64 arm64 armel armhf hppa i386 ia64 m68k mips mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64 x32
|
||||
libnutclient.so.0 libnutclient0 #MINVER#
|
||||
* Build-Depends-Package: libnutclient-dev
|
||||
(c++)"nut::Client::Client()@Base" 2.7.3
|
||||
(c++)"nut::Client::getDevice(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Client::getDeviceVariableValues(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Client::getDevices()@Base" 2.7.3
|
||||
(c++)"nut::Client::hasDevice(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Client::hasDeviceCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Client::hasDeviceVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Client::~Client()@Base" 2.7.3
|
||||
(c++)"nut::Command::Command(nut::Command const&)@Base" 2.7.3
|
||||
(c++)"nut::Command::Command(nut::Device*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Command::execute()@Base" 2.7.3
|
||||
(c++)"nut::Command::getDescription[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Command::getDevice() const@Base" 2.7.3
|
||||
(c++)"nut::Command::getDevice()@Base" 2.7.3
|
||||
(c++)"nut::Command::getName[abi:cxx11]() const@Base" 2.7.3
|
||||
(c++)"nut::Command::isOk() const@Base" 2.7.3
|
||||
(c++)"nut::Command::operator bool() const@Base" 2.7.3
|
||||
(c++)"nut::Command::operator!() const@Base" 2.7.3
|
||||
(c++)"nut::Command::operator<(nut::Command const&) const@Base" 2.7.3
|
||||
(c++)"nut::Command::operator==(nut::Command const&) const@Base" 2.7.3
|
||||
(c++)"nut::Command::~Command()@Base" 2.7.3
|
||||
(c++)"nut::Device::Device(nut::Client*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::Device(nut::Device const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::executeCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::forcedShutdown()@Base" 2.7.3
|
||||
(c++)"nut::Device::getClient() const@Base" 2.7.3
|
||||
(c++)"nut::Device::getClient()@Base" 2.7.3
|
||||
(c++)"nut::Device::getCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::getCommandNames[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Device::getCommands()@Base" 2.7.3
|
||||
(c++)"nut::Device::getDescription[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Device::getName[abi:cxx11]() const@Base" 2.7.3
|
||||
(c++)"nut::Device::getNumLogins()@Base" 2.7.3
|
||||
(c++)"nut::Device::getRWVariableNames[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Device::getRWVariables()@Base" 2.7.3
|
||||
(c++)"nut::Device::getVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::getVariableNames[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Device::getVariableValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::getVariableValues[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Device::getVariables()@Base" 2.7.3
|
||||
(c++)"nut::Device::isOk() const@Base" 2.7.3
|
||||
(c++)"nut::Device::login()@Base" 2.7.3
|
||||
(c++)"nut::Device::master()@Base" 2.7.3
|
||||
(c++)"nut::Device::operator bool() const@Base" 2.7.3
|
||||
(c++)"nut::Device::operator!() const@Base" 2.7.3
|
||||
(c++)"nut::Device::operator<(nut::Device const&) const@Base" 2.7.3
|
||||
(c++)"nut::Device::operator==(nut::Device const&) const@Base" 2.7.3
|
||||
(c++)"nut::Device::setVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::setVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 2.7.3
|
||||
(c++)"nut::Device::~Device()@Base" 2.7.3
|
||||
(c++)"nut::IOException::~IOException()@Base" 2.7.3
|
||||
(c++)"nut::NotConnectedException::NotConnectedException()@Base" 2.7.3
|
||||
(c++)"nut::NotConnectedException::~NotConnectedException()@Base" 2.7.3
|
||||
(c++)"nut::NutException::NutException(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::NutException::str[abi:cxx11]() const@Base" 2.7.3
|
||||
(c++)"nut::NutException::what() const@Base" 2.7.3
|
||||
(c++)"nut::NutException::~NutException()@Base" 2.7.3
|
||||
(c++)"nut::SystemException::SystemException()@Base" 2.7.3
|
||||
(c++)"nut::SystemException::err[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::SystemException::~SystemException()@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::TcpClient()@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::TcpClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::authenticate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::connect()@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::detectError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::deviceForcedShutdown(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::deviceGetNumLogins(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::deviceLogin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::deviceMaster(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::disconnect()@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::escape(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::executeDeviceCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++|arch-bits=32)"nut::TcpClient::explode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)@Base" 2.7.4
|
||||
(c++|arch-bits=64)"nut::TcpClient::explode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long)@Base" 2.7.4
|
||||
(c++)"nut::TcpClient::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDevice(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceCommandDescription(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceCommandNames(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceDescription(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceNames[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceRWVariableNames(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceVariableDescription(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceVariableNames(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceVariableValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getDeviceVariableValues(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getHost[abi:cxx11]() const@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getPort() const@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::getTimeout() const@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::isConnected() const@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::list(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::logout()@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::sendQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::setDeviceVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::setDeviceVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::setTimeout(long)@Base" 2.7.3
|
||||
(c++)"nut::TcpClient::~TcpClient()@Base" 2.7.3
|
||||
(c++)"nut::TimeoutException::TimeoutException()@Base" 2.7.3
|
||||
(c++)"nut::TimeoutException::~TimeoutException()@Base" 2.7.3
|
||||
(c++)"nut::UnknownHostException::UnknownHostException()@Base" 2.7.3
|
||||
(c++)"nut::UnknownHostException::~UnknownHostException()@Base" 2.7.3
|
||||
(c++)"nut::Variable::Variable(nut::Device*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Variable::Variable(nut::Variable const&)@Base" 2.7.3
|
||||
(c++)"nut::Variable::getDescription[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Variable::getDevice() const@Base" 2.7.3
|
||||
(c++)"nut::Variable::getDevice()@Base" 2.7.3
|
||||
(c++)"nut::Variable::getName[abi:cxx11]() const@Base" 2.7.3
|
||||
(c++)"nut::Variable::getValue[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::Variable::isOk() const@Base" 2.7.3
|
||||
(c++)"nut::Variable::operator bool() const@Base" 2.7.3
|
||||
(c++)"nut::Variable::operator!() const@Base" 2.7.3
|
||||
(c++)"nut::Variable::operator<(nut::Variable const&) const@Base" 2.7.3
|
||||
(c++)"nut::Variable::operator==(nut::Variable const&) const@Base" 2.7.3
|
||||
(c++)"nut::Variable::setValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"nut::Variable::setValues(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 2.7.3
|
||||
(c++)"nut::Variable::~Variable()@Base" 2.7.3
|
||||
(c++)"nut::internal::Socket::Socket()@Base" 2.7.3
|
||||
(c++)"nut::internal::Socket::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 2.7.3
|
||||
(c++)"nut::internal::Socket::disconnect()@Base" 2.7.3
|
||||
(c++)"nut::internal::Socket::isConnected() const@Base" 2.7.3
|
||||
(c++|arch-bits=32)"nut::internal::Socket::read(void*, unsigned int)@Base" 2.7.4
|
||||
(c++|arch-bits=64)"nut::internal::Socket::read(void*, unsigned long)@Base" 2.7.4
|
||||
(c++)"nut::internal::Socket::read[abi:cxx11]()@Base" 2.7.3
|
||||
(c++)"nut::internal::Socket::setTimeout(long)@Base" 2.7.3
|
||||
(c++)"nut::internal::Socket::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++|arch-bits=32)"nut::internal::Socket::write(void const*, unsigned int)@Base" 2.7.4
|
||||
(c++|arch-bits=64)"nut::internal::Socket::write(void const*, unsigned long)@Base" 2.7.4
|
||||
nutclient_authenticate@Base 2.7.3
|
||||
nutclient_destroy@Base 2.7.3
|
||||
nutclient_device_forced_shutdown@Base 2.7.3
|
||||
nutclient_device_login@Base 2.7.3
|
||||
nutclient_device_master@Base 2.7.3
|
||||
nutclient_execute_device_command@Base 2.7.3
|
||||
nutclient_get_device_command_description@Base 2.7.3
|
||||
nutclient_get_device_commands@Base 2.7.3
|
||||
nutclient_get_device_description@Base 2.7.3
|
||||
nutclient_get_device_num_logins@Base 2.7.3
|
||||
nutclient_get_device_rw_variables@Base 2.7.3
|
||||
nutclient_get_device_variable_description@Base 2.7.3
|
||||
nutclient_get_device_variable_values@Base 2.7.3
|
||||
nutclient_get_device_variables@Base 2.7.3
|
||||
nutclient_get_devices@Base 2.7.3
|
||||
nutclient_has_device@Base 2.7.3
|
||||
nutclient_has_device_command@Base 2.7.3
|
||||
nutclient_has_device_variable@Base 2.7.3
|
||||
nutclient_logout@Base 2.7.3
|
||||
nutclient_set_device_variable_value@Base 2.7.3
|
||||
nutclient_set_device_variable_values@Base 2.7.3
|
||||
nutclient_tcp_create_client@Base 2.7.3
|
||||
nutclient_tcp_disconnect@Base 2.7.3
|
||||
nutclient_tcp_get_timeout@Base 2.7.3
|
||||
nutclient_tcp_is_connected@Base 2.7.3
|
||||
nutclient_tcp_reconnect@Base 2.7.3
|
||||
nutclient_tcp_set_timeout@Base 2.7.3
|
||||
(c++)"std::_Rb_tree<nut::Device, nut::Device, std::_Identity<nut::Device>, std::less<nut::Device>, std::allocator<nut::Device> >::_M_erase(std::_Rb_tree_node<nut::Device>*)@Base" 2.7.3
|
||||
(c++)"std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_erase(std::_Rb_tree_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*)@Base" 2.7.3
|
||||
(c++)"std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >::_M_erase(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >*)@Base" 2.7.3
|
||||
(c++|optional=templinst)"std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.4
|
||||
(c++)"std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >::_M_get_insert_unique_pos(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.3
|
||||
(c++)"std::pair<std::_Rb_tree_iterator<nut::Variable>, bool> std::_Rb_tree<nut::Variable, nut::Variable, std::_Identity<nut::Variable>, std::less<nut::Variable>, std::allocator<nut::Variable> >::_M_insert_unique<nut::Variable>(nut::Variable&&)@Base" 2.7.3
|
||||
(c++)"std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator=(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 2.7.3
|
||||
(c++)"std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~vector()@Base" 2.7.3
|
||||
(c++)"std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::~vector()@Base" 2.7.3
|
||||
strarr_alloc@Base 2.7.3
|
||||
strarr_free@Base 2.7.3
|
||||
(c++)"typeinfo for nut::Client@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::IOException@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::NotConnectedException@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::NutException@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::SystemException@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::TcpClient@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::TimeoutException@Base" 2.7.3
|
||||
(c++)"typeinfo for nut::UnknownHostException@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::Client@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::IOException@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::NotConnectedException@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::NutException@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::SystemException@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::TcpClient@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::TimeoutException@Base" 2.7.3
|
||||
(c++)"typeinfo name for nut::UnknownHostException@Base" 2.7.3
|
||||
(c++|optional=templinst)"void std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_realloc_insert<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.4
|
||||
(c++|optional=templinst)"void std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::_M_realloc_insert<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >(__gnu_cxx::__normal_iterator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&&)@Base" 2.7.4
|
||||
(c++)"vtable for nut::Client@Base" 2.7.3
|
||||
(c++)"vtable for nut::IOException@Base" 2.7.3
|
||||
(c++)"vtable for nut::NotConnectedException@Base" 2.7.3
|
||||
(c++)"vtable for nut::NutException@Base" 2.7.3
|
||||
(c++)"vtable for nut::SystemException@Base" 2.7.3
|
||||
(c++)"vtable for nut::TcpClient@Base" 2.7.3
|
||||
(c++)"vtable for nut::TimeoutException@Base" 2.7.3
|
||||
(c++)"vtable for nut::UnknownHostException@Base" 2.7.3
|
||||
(c++|optional=templinst)"void std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_realloc_insert<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)@Base" 2.7.4
|
||||
(c++|optional=templinst|arch=s390x mipsel armhf)"std::pair<std::_Rb_tree_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, bool> std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_insert_unique<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.4
|
||||
(c++|optional=templinst|arch=!s390x !mipsel !armhf)"std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 2.7.4
|
6
debian/libnutscan-dev.install
vendored
6
debian/libnutscan-dev.install
vendored
|
@ -1,6 +0,0 @@
|
|||
usr/include/nut-scan.h
|
||||
usr/include/nutscan-device.h
|
||||
usr/include/nutscan-init.h
|
||||
usr/include/nutscan-ip.h
|
||||
usr/lib/*/libnutscan.so
|
||||
usr/lib/*/pkgconfig/libnutscan.pc
|
1
debian/libnutscan1.install
vendored
1
debian/libnutscan1.install
vendored
|
@ -1 +0,0 @@
|
|||
lib/*/libnutscan.so.*
|
157
debian/libnutscan1.symbols
vendored
157
debian/libnutscan1.symbols
vendored
|
@ -1,157 +0,0 @@
|
|||
libnutscan.so.1 libnutscan1 #MINVER#
|
||||
* Build-Depends-Package: libnutscan-dev
|
||||
AUT@Base 2.7.4-9~
|
||||
UPS_VERSION@Base 2.7.4-9~
|
||||
altpidpath@Base 2.7.4-9~
|
||||
background@Base 2.7.4-9~
|
||||
become_user@Base 2.7.4-9~
|
||||
calc_checksum@Base 2.7.4-9~
|
||||
checksum_test@Base 2.7.4-9~
|
||||
chroot_start@Base 2.7.4-9~
|
||||
comm_upsdrv_info@Base 2.7.4-9~
|
||||
command_read_sequence@Base 2.7.4-9~
|
||||
command_write_sequence@Base 2.7.4-9~
|
||||
confpath@Base 2.7.4-9~
|
||||
device_path@Base 2.7.4-9~
|
||||
device_portname@Base 2.7.4-9~
|
||||
dflt_statepath@Base 2.7.4-9~
|
||||
do_lock_port@Base 2.7.4-9~
|
||||
exit_flag@Base 2.7.4-9~
|
||||
fatal_with_errno@Base 2.7.4-9~
|
||||
fatalx@Base 2.7.4-9~
|
||||
g_usec_timeout@Base 2.7.4-9~
|
||||
get_answer@Base 2.7.4-9~
|
||||
get_libname@Base 2.7.4-9~
|
||||
get_user_pwent@Base 2.7.4-9~
|
||||
getval@Base 2.7.4-9~
|
||||
(arch=!hurd-i386)is_ipmi_device_supported@Base 2.7.4-9~
|
||||
nut_debug_level@Base 2.7.4-9~
|
||||
nut_log_level@Base 2.7.4-9~
|
||||
nut_snmp_add_null_var@Base 2.7.4-9~
|
||||
nutscan_add_device_to_device@Base 2.7.4-9~
|
||||
nutscan_add_option_to_device@Base 2.7.4-9~
|
||||
nutscan_avail_avahi@Base 2.7.4-9~
|
||||
nutscan_avail_ipmi@Base 2.7.4-9~
|
||||
nutscan_avail_nut@Base 2.7.4-9~
|
||||
nutscan_avail_snmp@Base 2.7.4-9~
|
||||
nutscan_avail_usb@Base 2.7.4-9~
|
||||
nutscan_avail_xml_http@Base 2.7.4-9~
|
||||
nutscan_cidr_to_ip@Base 2.7.4-9~
|
||||
nutscan_device_type_string@Base 2.7.4-9~
|
||||
nutscan_device_type_strings@Base 2.7.4-9~
|
||||
nutscan_display_parsable@Base 2.7.4-9~
|
||||
nutscan_display_ups_conf@Base 2.7.4-9~
|
||||
nutscan_free@Base 2.7.4-9~
|
||||
nutscan_free_device@Base 2.7.4-9~
|
||||
nutscan_get_serial_ports_list@Base 2.7.4-9~
|
||||
nutscan_init@Base 2.7.4-9~
|
||||
nutscan_ip_iter_inc@Base 2.7.4-9~
|
||||
nutscan_ip_iter_init@Base 2.7.4-9~
|
||||
(arch=!hurd-i386)nutscan_load_ipmi_library@Base 2.7.4-9~
|
||||
nutscan_load_neon_library@Base 2.7.4-9~
|
||||
nutscan_load_snmp_library@Base 2.7.4-9~
|
||||
nutscan_load_upsclient_library@Base 2.7.4-9~
|
||||
nutscan_load_usb_library@Base 2.7.4-9~
|
||||
nutscan_new_device@Base 2.7.4-9~
|
||||
nutscan_rewind_device@Base 2.7.4-9~
|
||||
nutscan_scan_avahi@Base 2.7.4-9~
|
||||
nutscan_scan_eaton_serial@Base 2.7.4-9~
|
||||
nutscan_scan_eaton_serial_q1@Base 2.7.4-9~
|
||||
nutscan_scan_eaton_serial_shut@Base 2.7.4-9~
|
||||
nutscan_scan_eaton_serial_xcp@Base 2.7.4-9~
|
||||
nutscan_scan_ipmi@Base 2.7.4-9~
|
||||
nutscan_scan_nut@Base 2.7.4-9~
|
||||
nutscan_scan_snmp@Base 2.7.4-9~
|
||||
nutscan_scan_usb@Base 2.7.4-9~
|
||||
nutscan_scan_xml_http@Base 2.7.4-9~
|
||||
open_syslog@Base 2.7.4-9~
|
||||
pw_baud_rates@Base 2.7.4-9~
|
||||
pw_comm_setup@Base 2.7.4-9~
|
||||
search_paths@Base 2.7.4-9~
|
||||
select_read@Base 2.7.4-9~
|
||||
select_write@Base 2.7.4-9~
|
||||
send_read_command@Base 2.7.4-9~
|
||||
send_write_command@Base 2.7.4-9~
|
||||
sendsignal@Base 2.7.4-9~
|
||||
sendsignalfn@Base 2.7.4-9~
|
||||
ser_close@Base 2.7.4-9~
|
||||
ser_comm_fail@Base 2.7.4-9~
|
||||
ser_comm_good@Base 2.7.4-9~
|
||||
ser_flush_in@Base 2.7.4-9~
|
||||
ser_flush_io@Base 2.7.4-9~
|
||||
ser_get_buf@Base 2.7.4-9~
|
||||
ser_get_buf_len@Base 2.7.4-9~
|
||||
ser_get_char@Base 2.7.4-9~
|
||||
ser_get_cts@Base 2.7.4-9~
|
||||
ser_get_dcd@Base 2.7.4-9~
|
||||
ser_get_dsr@Base 2.7.4-9~
|
||||
ser_get_line@Base 2.7.4-9~
|
||||
ser_get_line_alert@Base 2.7.4-9~
|
||||
ser_open@Base 2.7.4-9~
|
||||
ser_open_nf@Base 2.7.4-9~
|
||||
ser_send@Base 2.7.4-9~
|
||||
ser_send_buf@Base 2.7.4-9~
|
||||
ser_send_buf_pace@Base 2.7.4-9~
|
||||
ser_send_char@Base 2.7.4-9~
|
||||
ser_send_pace@Base 2.7.4-9~
|
||||
ser_set_dtr@Base 2.7.4-9~
|
||||
ser_set_rts@Base 2.7.4-9~
|
||||
ser_set_speed@Base 2.7.4-9~
|
||||
ser_set_speed_nf@Base 2.7.4-9~
|
||||
shut_synchronise@Base 2.7.4-9~
|
||||
snprintfcat@Base 2.7.4-9~
|
||||
str_is_double@Base 2.7.4-9~
|
||||
str_is_double_strict@Base 2.7.4-9~
|
||||
str_is_int@Base 2.7.4-9~
|
||||
str_is_int_strict@Base 2.7.4-9~
|
||||
str_is_long@Base 2.7.4-9~
|
||||
str_is_long_strict@Base 2.7.4-9~
|
||||
str_is_short@Base 2.7.4-9~
|
||||
str_is_short_strict@Base 2.7.4-9~
|
||||
str_is_uint@Base 2.7.4-9~
|
||||
str_is_uint_strict@Base 2.7.4-9~
|
||||
str_is_ulong@Base 2.7.4-9~
|
||||
str_is_ulong_strict@Base 2.7.4-9~
|
||||
str_is_ushort@Base 2.7.4-9~
|
||||
str_is_ushort_strict@Base 2.7.4-9~
|
||||
str_ltrim@Base 2.7.4-9~
|
||||
str_ltrim_m@Base 2.7.4-9~
|
||||
str_ltrim_space@Base 2.7.4-9~
|
||||
str_rtrim@Base 2.7.4-9~
|
||||
str_rtrim_m@Base 2.7.4-9~
|
||||
str_rtrim_space@Base 2.7.4-9~
|
||||
str_to_double@Base 2.7.4-9~
|
||||
str_to_double_strict@Base 2.7.4-9~
|
||||
str_to_int@Base 2.7.4-9~
|
||||
str_to_int_strict@Base 2.7.4-9~
|
||||
str_to_long@Base 2.7.4-9~
|
||||
str_to_long_strict@Base 2.7.4-9~
|
||||
str_to_short@Base 2.7.4-9~
|
||||
str_to_short_strict@Base 2.7.4-9~
|
||||
str_to_uint@Base 2.7.4-9~
|
||||
str_to_uint_strict@Base 2.7.4-9~
|
||||
str_to_ulong@Base 2.7.4-9~
|
||||
str_to_ulong_strict@Base 2.7.4-9~
|
||||
str_to_ushort@Base 2.7.4-9~
|
||||
str_to_ushort_strict@Base 2.7.4-9~
|
||||
str_trim@Base 2.7.4-9~
|
||||
str_trim_m@Base 2.7.4-9~
|
||||
str_trim_space@Base 2.7.4-9~
|
||||
syslogbit_set@Base 2.7.4-9~
|
||||
upsdebug_ascii@Base 2.7.4-9~
|
||||
upsdebug_hex@Base 2.7.4-9~
|
||||
upsdebug_with_errno@Base 2.7.4-9~
|
||||
upsdebugx@Base 2.7.4-9~
|
||||
upsdrv_cleanup@Base 2.7.4-9~
|
||||
upsdrv_comm_good@Base 2.7.4-9~
|
||||
upsdrv_initups@Base 2.7.4-9~
|
||||
upsdrv_reconnect@Base 2.7.4-9~
|
||||
upsfd@Base 2.7.4-9~
|
||||
upslog_with_errno@Base 2.7.4-9~
|
||||
upslogx@Base 2.7.4-9~
|
||||
writepid@Base 2.7.4-9~
|
||||
xbasename@Base 2.7.4-9~
|
||||
xcalloc@Base 2.7.4-9~
|
||||
xmalloc@Base 2.7.4-9~
|
||||
xrealloc@Base 2.7.4-9~
|
||||
xstrdup@Base 2.7.4-9~
|
1
debian/libups-nut-perl.install
vendored
1
debian/libups-nut-perl.install
vendored
|
@ -1 +0,0 @@
|
|||
scripts/perl/Nut.pm /usr/share/perl5/UPS/
|
5
debian/libupsclient-dev.install
vendored
5
debian/libupsclient-dev.install
vendored
|
@ -1,5 +0,0 @@
|
|||
usr/include/parseconf.h
|
||||
usr/include/upsclient.h
|
||||
usr/lib/*/libupsclient.a
|
||||
usr/lib/*/libupsclient.so
|
||||
usr/lib/*/pkgconfig/libupsclient.pc
|
1
debian/libupsclient1-dev.dirs
vendored
Normal file
1
debian/libupsclient1-dev.dirs
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/lib
|
5
debian/libupsclient1-dev.install
vendored
Normal file
5
debian/libupsclient1-dev.install
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
debian/tmp/lib/libupsclient.so
|
||||
debian/tmp/lib/libupsclient.a
|
||||
debian/tmp/lib/libupsclient.la
|
||||
debian/tmp/usr/lib/pkgconfig/
|
||||
debian/tmp/usr/include
|
1
debian/libupsclient1-dev.links
vendored
Normal file
1
debian/libupsclient1-dev.links
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/lib/libupsclient.so.1.0.0 /usr/lib/libupsclient.so
|
1
debian/libupsclient1-dev.manpages
vendored
Normal file
1
debian/libupsclient1-dev.manpages
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
debian/tmp/usr/share/man/man3/*.3
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue