Compare commits
309 commits
upstream-w
...
nll-2.8.0
Author | SHA1 | Date | |
---|---|---|---|
|
ba45b20c34 | ||
|
0b5b61097a | ||
|
ab3256f51e | ||
|
b2b0c9995a | ||
|
fc7f4b43c1 | ||
|
a9054f1936 | ||
|
9830c31430 | ||
|
d0e2223474 | ||
|
889a404ef5 | ||
|
c3b8fd580f | ||
|
2cbeab144c | ||
|
57937877b1 | ||
|
82a1e36d60 | ||
|
9f7a21edb3 | ||
|
7e3876e1c6 | ||
|
b0cb2b77bb | ||
|
f308b5c62d | ||
|
dcb5203681 | ||
|
5c60ced7db | ||
|
0d0ddec735 | ||
|
f1c2ba9882 | ||
|
a4d3d4fb1e | ||
|
64f3199582 | ||
|
daac55b6a9 | ||
|
866682d442 | ||
|
6d1061719e | ||
|
034bb3e28f | ||
|
e878bd34ba | ||
|
c4835ea1a1 | ||
|
1d0f417e29 | ||
|
f421c8ecc7 | ||
|
2a297829ee | ||
|
c71fa5912e | ||
|
d07de5b2ba | ||
|
e15be88231 | ||
|
ed73672c7c | ||
|
e8aa8ec3ff | ||
|
247c516a79 | ||
|
34f0448c77 | ||
|
50d4a418ef | ||
|
bda57ab3dc | ||
|
9efb9cdb3c | ||
|
59582e793c | ||
|
3115b529b2 | ||
|
9aba586fa8 | ||
|
1f4f8540a3 | ||
|
c1e987a09c | ||
|
3ecd26d7cc | ||
|
57fac761d2 | ||
|
0808410404 | ||
|
714bfb0ea4 | ||
|
c714f33799 | ||
|
b2c9649823 | ||
|
b11ef489f7 | ||
|
b493284ac5 | ||
|
4e84429b69 | ||
|
963a7372d2 | ||
|
5772786c65 | ||
|
35532f2132 | ||
|
aea535dcba | ||
|
c4e9d7ecff | ||
|
68880dfdfd | ||
|
6169fe541f | ||
|
2ac85b39ea | ||
|
14ba36ebf2 | ||
|
df751bd197 | ||
|
e437c6972c | ||
|
08288b6a7f | ||
|
740190eb6a | ||
|
3aa359a7dd | ||
|
4bcbcd8fde | ||
|
ac21d98f99 | ||
|
b6aa79cc73 | ||
|
42af1644dc | ||
|
81a8df71f8 | ||
|
02aecd43d3 | ||
|
cbd94344af | ||
|
7ccca60883 | ||
|
c4bec2820e | ||
|
68231aaa9a | ||
|
6c18e2ba35 | ||
|
1b2fe33bfd | ||
|
3cf6fe4225 | ||
|
2ae8cfe7da | ||
|
82f4838526 | ||
|
e3cc4871ce | ||
|
4a1eddd34b | ||
|
165febf8fc | ||
|
849ad1a39e | ||
|
f1c7249233 | ||
|
76e6e1d4e5 | ||
|
32c3d8aac0 | ||
|
5f612a9a0f | ||
|
08d39e662c | ||
|
d31c6dcb9b | ||
|
21b0ce7971 | ||
|
627b1dd6ea | ||
|
8d6492f968 | ||
|
bd298ee052 | ||
|
75c8125f8a | ||
|
0549a71851 | ||
|
10dfed1de3 | ||
|
1476985c4c | ||
|
5b5df2aac1 | ||
|
e01f1100e2 | ||
|
ba41628644 | ||
|
d755c8b023 | ||
|
f9eefb910b | ||
|
3780d53734 | ||
|
d4195945c0 | ||
|
4ffde4deaa | ||
|
6cee8926ae | ||
|
8c5af82247 | ||
|
0512813b41 | ||
|
c9cb2187ee | ||
|
237be91ad9 | ||
|
b0b61548a4 | ||
|
1a30e36c57 | ||
|
38537675ba | ||
|
79b4afb095 | ||
|
b762a3580e | ||
|
e948707093 | ||
|
85836f6836 | ||
|
f07d79cd65 | ||
|
f5439265c8 | ||
|
cf7db8a9f1 | ||
|
c2a1ac8f1f | ||
|
7ca12c8e25 | ||
|
a980444360 | ||
|
fd413a3168 | ||
|
564becd819 | ||
|
5dc71af109 | ||
|
64e656ba48 | ||
|
47e0e45e35 | ||
|
f8cfca1b18 | ||
|
1563b485dc | ||
|
241119d464 | ||
|
fedf671e4d | ||
|
f07df515f5 | ||
|
819cab0654 | ||
|
c57ad7e897 | ||
|
165791ea2a | ||
|
d504d61101 | ||
|
1e664224b2 | ||
|
f26715942d | ||
|
8bd57e3e01 | ||
|
d551399f97 | ||
|
6621b7de39 | ||
|
c94a1d80c6 | ||
|
a766575eca | ||
|
d0947d03cc | ||
|
8a985c46f3 | ||
|
a356b56d11 | ||
|
106ff01fcf | ||
|
032745e879 | ||
|
9b564eb7df | ||
|
e02d926691 | ||
|
bbd9f7852b | ||
|
c68443d795 | ||
|
bd7c860a72 | ||
|
cbf85f6779 | ||
|
0389780de8 | ||
|
a62d95150d | ||
|
8e8886fd95 | ||
|
3bac34e788 | ||
|
74efce57eb | ||
|
0469bcf177 | ||
|
1b8376079e | ||
|
0121794af9 | ||
|
9b4acffd6c | ||
|
8157c709a1 | ||
|
4c61ee613e | ||
|
154f28c325 | ||
|
fd9b4809ec | ||
|
38742dde53 | ||
|
a60005575f | ||
|
65234e6c7b | ||
|
476bccbdb3 | ||
|
f313323738 | ||
|
cc689212ad | ||
|
c51fe5965a | ||
|
d5939980c1 | ||
|
fc374550b2 | ||
|
8e1c6bce0d | ||
|
623a7f2f69 | ||
|
e8e497bcf4 | ||
|
2f87baa5a4 | ||
|
11b7980da6 | ||
|
47044fe3b0 | ||
|
853f3503ce | ||
|
715368e54f | ||
|
d54dd54840 | ||
|
68adcbdb65 | ||
|
caf09b3d58 | ||
|
a80da4998d | ||
|
c79bcd71af | ||
|
5b99c93354 | ||
|
3f5ae0e4fb | ||
|
2904bfac3c | ||
|
b8b31887a5 | ||
|
7903ed56c2 | ||
|
4730afcab2 | ||
|
b5e16725fa | ||
|
ce071bf6d9 | ||
|
4c70406ad9 | ||
|
a1fa151fc7 | ||
|
0d1e4a2dcc | ||
|
8141cb7297 | ||
|
e25bc18d96 | ||
|
d518f66985 | ||
|
d634a9971d | ||
|
37fc917325 | ||
|
b13692c4ba | ||
|
fa2376d331 | ||
|
a7e6c2affc | ||
|
6c85678343 | ||
|
5d4e219ae8 | ||
|
04703f7239 | ||
|
0429bb5294 | ||
|
a6634bc58e | ||
|
1cd02baa2d | ||
|
dbeaea56b0 | ||
|
a9f5fa9b6f | ||
|
51c7f9422f | ||
|
f50e269016 | ||
|
357d77d1f2 | ||
|
82fda8eb40 | ||
|
ca0de194e2 | ||
|
39a7ae33fb | ||
|
112d9a7c99 | ||
|
848fe6dc74 | ||
|
e16f76b337 | ||
|
8b4a877ae9 | ||
|
a97c472533 | ||
|
f4447a2e78 | ||
|
19bb945c64 | ||
|
dafbfe8075 | ||
|
1aa25b671d | ||
|
926c972a29 | ||
|
ba62773351 | ||
|
40fd3ef098 | ||
|
0d4527e4ff | ||
|
bd91941eb2 | ||
|
39af1601d0 | ||
|
968d86eb02 | ||
|
e69a4460bb | ||
|
e75060ac30 | ||
|
18de36389b | ||
|
56b9da25f1 | ||
|
eb01d7e338 | ||
|
6be08da846 | ||
|
9d7ae928f5 | ||
|
2ffa6bd479 | ||
|
1e45c0d270 | ||
|
dfa7599f33 | ||
|
63f12aa09f | ||
|
14ffb4d76b | ||
|
46c56a3a13 | ||
|
ad6a04226d | ||
|
910934027d | ||
|
1106c880a1 | ||
|
85d2d1a10a | ||
|
1b2269cf22 | ||
|
7424f22810 | ||
|
0acf1f781a | ||
|
ba4d85c19c | ||
|
3059d08dfd | ||
|
8cc62ab670 | ||
|
b98ff51068 | ||
|
21f8749a47 | ||
|
9f5431316b | ||
|
06a2c09071 | ||
|
3323ee6303 | ||
|
facb367831 | ||
|
8aa07bb6f9 | ||
|
92977d203d | ||
|
db7ab48e75 | ||
|
a876e1ab6d | ||
|
6e28b57f51 | ||
|
9584e8dd52 | ||
|
405017598b | ||
|
6d0c7e7b30 | ||
|
4d1040666f | ||
|
eed8994e1e | ||
|
89058c95d8 | ||
|
0e20f2aa14 | ||
|
7bcbb63286 | ||
|
4670a72fca | ||
|
c3894a1752 | ||
|
c38582d5c2 | ||
|
a180d2ab55 | ||
|
7320befdae | ||
|
5b1840b8ff | ||
|
996a34e6b6 | ||
|
44b38c4ff6 | ||
|
0b9baae4e9 | ||
|
45abd239cf | ||
|
9675a8feb9 | ||
|
582ac2bbfd | ||
|
9a6e44c40b | ||
|
58a98cfddc | ||
|
00b3b334a9 | ||
|
fbab08eae5 | ||
|
2f40c02cd5 | ||
|
d71a946e56 | ||
|
f3d62f1302 | ||
|
5bc443a878 | ||
|
69151f849c | ||
|
31a319d731 |
1013 changed files with 207653 additions and 43978 deletions
38
.drone.yml
Normal file
38
.drone.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
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: {}
|
4
AUTHORS
4
AUTHORS
|
@ -170,3 +170,7 @@ D: pwmib support for snmp-ups
|
||||||
N: Kjell Claesson
|
N: Kjell Claesson
|
||||||
E: Kjell.claesson@epost.tidanet.se
|
E: Kjell.claesson@epost.tidanet.se
|
||||||
D: Author of bcmxcp driver, 3-phase work.
|
D: Author of bcmxcp driver, 3-phase work.
|
||||||
|
|
||||||
|
N: Giuseppe Corbelli
|
||||||
|
E: giuseppe.corbelli@copanitalia.com
|
||||||
|
D: Author of asem driver
|
||||||
|
|
662
INSTALL
662
INSTALL
|
@ -1,320 +1,368 @@
|
||||||
Installation instructions
|
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
|
||||||
|
================
|
||||||
|
|
||||||
This chapter describe the various methods for installing Network UPS Tools.
|
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.
|
||||||
|
|
||||||
Whenever it is possible, prefer <<Installing_packages, installing from packages>>.
|
Defining Variables
|
||||||
Packagers have done an excellent and hard work at improving NUT integration into
|
==================
|
||||||
their system.
|
|
||||||
|
|
||||||
[[Installing_source]]
|
Variables not defined in a site shell script can be set in the
|
||||||
Installing from source
|
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:
|
||||||
|
|
||||||
These are the essential steps for compiling and installing this software.
|
./configure CC=/usr/local2/bin/gcc
|
||||||
|
|
||||||
The NUT linkdoc:packager-guide[Packager Guide], which presents the best
|
causes the specified 'gcc' to be used as the C compiler (unless it is
|
||||||
practices for installing and integrating NUT, is also a good reading.
|
overridden in the site shell script).
|
||||||
|
|
||||||
[NOTE]
|
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
|
||||||
.Keep in mind that...
|
Autoconf limitation. Until the limitation is lifted, you can use this
|
||||||
================================================================================
|
workaround:
|
||||||
|
|
||||||
- the paths shown below are the default values you get by just calling
|
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||||
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
|
'configure' Invocation
|
||||||
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>
|
'configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
- if your favorite system offers up to date binary packages, you should always
|
'--help'
|
||||||
prefer these over a source installation. Along with the known advantages of such
|
'-h'
|
||||||
systems for installation, upgrade and removal, there are many integration issues
|
Print a summary of all of the options to 'configure', and exit.
|
||||||
that have been addressed.
|
|
||||||
|
|
||||||
================================================================================
|
'--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.
|
||||||
|
|
||||||
|
'--version'
|
||||||
|
'-V'
|
||||||
|
Print the version of Autoconf used to generate the 'configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
Prepare your system
|
'--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
|
||||||
System User creation
|
disable caching.
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
'--config-cache'
|
||||||
Create at least one system user and a group for running this software. You
|
'-C'
|
||||||
might call them "ups" and "nut". The exact names aren't important as
|
Alias for '--cache-file=config.cache'.
|
||||||
long as you are consistent.
|
|
||||||
|
'--quiet'
|
||||||
The process for doing this varies from one system to the next, and
|
'--silent'
|
||||||
explaining how to add users is beyond the scope of this document.
|
'-q'
|
||||||
|
Do not print messages saying which checks are being made. To
|
||||||
For the purposes of this document, the user name and group name
|
suppress all normal output, redirect it to '/dev/null' (any error
|
||||||
will be 'ups' and 'nut' respectively.
|
messages will still be shown).
|
||||||
|
|
||||||
Be sure the new user is a member of the new group! If you forget to
|
'--srcdir=DIR'
|
||||||
do this, you will have problems later on when you try to start upsd.
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
'configure' can determine that directory automatically.
|
||||||
|
|
||||||
Build and install
|
'--prefix=DIR'
|
||||||
~~~~~~~~~~~~~~~~~
|
Use DIR as the installation prefix. *note Installation Names:: for
|
||||||
|
more details, including other options available for fine-tuning the
|
||||||
[[Configuration]]
|
installation locations.
|
||||||
Configuration
|
|
||||||
^^^^^^^^^^^^^
|
'--no-create'
|
||||||
|
'-n'
|
||||||
Configure the source tree for your system. Add the '--with-user' and
|
Run the configure checks, but stop before creating any output
|
||||||
'--with-group' switch to set the user name and group that you created
|
files.
|
||||||
above.
|
|
||||||
|
'configure' also accepts some other, not widely useful, options. Run
|
||||||
./configure --with-user=ups --with-group=nut
|
'configure --help' for more details.
|
||||||
|
|
||||||
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
|
|
||||||
owned by the 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 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.
|
|
||||||
|
|
||||||
|
|
||||||
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 prefered method (apt-get, aptitude, Synaptic, ...), install
|
|
||||||
the 'nut' package, and optionaly 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
|
|
||||||
- nut-hal-drivers
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
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 prefered 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.
|
|
||||||
|
|
||||||
Optionaly, 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 optionaly 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 prefered 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.
|
|
||||||
|
|
||||||
Optionaly, 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 the main component, use the following command:
|
|
||||||
|
|
||||||
# pkg_add -r nut
|
|
||||||
|
|
||||||
Port
|
|
||||||
^^^^
|
|
||||||
|
|
||||||
The port is located under /usr/ports/sysutils/nut.
|
|
||||||
To install it, use the following command:
|
|
||||||
|
|
||||||
# cd /usr/ports/sysutils/nut/ && make install clean
|
|
||||||
|
|
||||||
You have to define WITH_NUT_CGI to build the optional CGI scripts.
|
|
||||||
|
|
||||||
Optionaly, you can also install the following ports:
|
|
||||||
|
|
||||||
- sysutils/nut-snmp, for the SNMP driver,
|
|
||||||
- sysutils/nut-usb, for the USB drivers,
|
|
||||||
- sysutils/nut-libupsclient, for the upsclient library.
|
|
||||||
|
|
||||||
|
|
||||||
You are now ready to configure NUT, and start testing and using it.
|
|
||||||
|
|
||||||
You can jump directly to the
|
|
||||||
<<Configuration_notes,NUT configuration>>.
|
|
||||||
|
|
350
INSTALL.nut
Normal file
350
INSTALL.nut
Normal file
|
@ -0,0 +1,350 @@
|
||||||
|
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>>.
|
|
@ -38,13 +38,17 @@ S: Maintained: apcsmart, belkin, bestups, cyberpower, dummycons,
|
||||||
P: Arnaud Quette
|
P: Arnaud Quette
|
||||||
M: aquette.dev@gmail.com
|
M: aquette.dev@gmail.com
|
||||||
M: ArnaudQuette@eaton.com
|
M: ArnaudQuette@eaton.com
|
||||||
S: Maintained or Supported: dummy-ups, usbhid-ups, mge-shut, newmge-shut
|
S: Maintained or Supported: dummy-ups, usbhid-ups, mge-shut
|
||||||
mge-utalk, snmp-ups, ...
|
mge-utalk, snmp-ups, ...
|
||||||
|
|
||||||
P: Fabio Di Niro
|
P: Fabio Di Niro
|
||||||
M: blaxwan@users.sourceforge.net
|
M: blaxwan@users.sourceforge.net
|
||||||
S: Maintained: metasys
|
S: Maintained: metasys
|
||||||
|
|
||||||
|
P: Kirill Smelkov
|
||||||
|
M: kirr@mns.spb.ru
|
||||||
|
S: Maintained: al175
|
||||||
|
|
||||||
Packaging
|
Packaging
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
290
Makefile.am
290
Makefile.am
|
@ -5,28 +5,44 @@ ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
# subdirectories to build and distribute. The order matters, as
|
# subdirectories to build and distribute. The order matters, as
|
||||||
# several subdirectories depend on stuff in "common" or tools being built first
|
# several subdirectories depend on stuff in "common" or tools being built first
|
||||||
SUBDIRS = include common clients conf data tools docs drivers \
|
SUBDIRS = include common clients conf data docs drivers tools \
|
||||||
lib scripts server
|
lib scripts server tests
|
||||||
|
|
||||||
|
# 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.
|
# COPYING is included automatically.
|
||||||
EXTRA_DIST = LICENSE-GPL2 LICENSE-GPL3 MAINTAINERS UPGRADING
|
EXTRA_DIST = INSTALL.nut LICENSE-GPL2 LICENSE-GPL3 MAINTAINERS UPGRADING
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# flags to pass to ./configure when calling "make distcheck" and "make
|
# flags to pass to ./configure when calling "make distcheck" and "make
|
||||||
# distcheck-light". Try to check as many features as possible! Also
|
# distcheck-light". Try to check as many features as possible! Also
|
||||||
# need to give hotplug-dir and udev-dir, so that staged install does
|
# need to give augeas-lenses-dir, hotplug-dir and udev-dir, so that
|
||||||
# not fail.
|
# staged install does not fail.
|
||||||
|
|
||||||
DISTCHECK_FLAGS = --with-all --with-ssl --with-doc=auto
|
DISTCHECK_FLAGS = --with-all --with-ssl --with-doc=auto
|
||||||
DISTCHECK_LIGHT_FLAGS = --with-all=auto --with-ssl=auto --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_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \
|
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-hotplug-dir='$${prefix}/etc/hotplug' \
|
||||||
--with-udev-dir='$${prefix}/etc/udev'
|
--with-udev-dir='$${prefix}/etc/udev' \
|
||||||
|
--with-devd-dir='$${prefix}/etc/devd'
|
||||||
|
|
||||||
distcheck-light:
|
distcheck-light:
|
||||||
$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck
|
$(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
|
# workaround the dist generated files that are also part of the distribution
|
||||||
# Note that distcleancheck is disabled for now, while waiting for a proper
|
# Note that distcleancheck is disabled for now, while waiting for a proper
|
||||||
# solution, that do not break older unix systems
|
# solution, that do not break older unix systems
|
||||||
|
@ -35,25 +51,184 @@ distcheck-light:
|
||||||
distcleancheck:
|
distcleancheck:
|
||||||
@:
|
@:
|
||||||
|
|
||||||
# Automatically generate the ChangeLog from SVN logs:
|
# Quick alias for root dir recipe:
|
||||||
MAINTAINERCLEAN_FILES = ChangeLog
|
realclean: maintainer-clean
|
||||||
# Force ChangeLog regeneration upon make dist (due to inexistant 'dummy-stamp'),
|
|
||||||
# in case it has already been generated previously
|
|
||||||
dummy-stamp:
|
|
||||||
ChangeLog: tools/svn2cl.authors dummy-stamp
|
|
||||||
svn2cl --group-by-day --include-rev --authors=$< --reparagraph --revision 'HEAD:2332' --output=$@ || \
|
|
||||||
echo "svn2cl failed to generate the ChangeLog. See http://trac.networkupstools.org/projects/nut/timeline" > $@
|
|
||||||
|
|
||||||
if HAVE_ASCIIDOC
|
# Files made by our targets:
|
||||||
website:
|
CLEANFILES = *-spellchecked cppcheck*.xml
|
||||||
cd docs; $(MAKE) $(AM_MAKEFLAGS) website
|
DISTCLEANFILES = ChangeLog
|
||||||
cd docs/man; $(MAKE) $(AM_MAKEFLAGS) html-man
|
|
||||||
cd tools; $(MAKE) $(AM_MAKEFLAGS) website
|
# Most of the files generated by custom rules in the configure script
|
||||||
cd docs/website; $(MAKE) $(AM_MAKEFLAGS) website
|
# or by autogen.sh are cleaned by the Makefile.am in their directories.
|
||||||
else !HAVE_ASCIIDOC
|
# Files below are re-created by running `configure` script and may be
|
||||||
website:
|
# wiped by a `make distclean`:
|
||||||
@echo "Not building website since 'asciidoc' was not found."
|
DISTCLEANFILES += config.log configure~
|
||||||
endif !HAVE_ASCIIDOC
|
#???# 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
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# targets from old build system (pre-automake).
|
# targets from old build system (pre-automake).
|
||||||
|
@ -93,14 +268,14 @@ install-dirs:
|
||||||
@echo "Warning: 'make install-dirs' is deprecated."
|
@echo "Warning: 'make install-dirs' is deprecated."
|
||||||
@echo "Use 'make installdirs' instead."
|
@echo "Use 'make installdirs' instead."
|
||||||
@echo $(WARN)
|
@echo $(WARN)
|
||||||
make installdirs
|
$(MAKE) installdirs
|
||||||
cgi build-cgi install-cgi install-cgi-dir install-cgi-bin \
|
cgi build-cgi install-cgi install-cgi-dir install-cgi-bin \
|
||||||
install-cgi-man install-cgi-conf install-cgi-html:
|
install-cgi-man install-cgi-conf install-cgi-html:
|
||||||
@echo "Error: 'make $@' no longer exists."
|
@echo "Error: 'make $@' no longer exists."
|
||||||
@echo "Use './configure --with-cgi' instead."
|
@echo "Use './configure --with-cgi' instead."
|
||||||
install-lib:
|
install-lib:
|
||||||
@echo "Error: 'make $@' no longer exists."
|
@echo "Error: 'make $@' no longer exists."
|
||||||
@echo "Use './configure --with-lib' instead."
|
@echo "Use './configure --with-dev' instead."
|
||||||
usb build-usb install-usb:
|
usb build-usb install-usb:
|
||||||
@echo "Error: 'make $@' no longer exists."
|
@echo "Error: 'make $@' no longer exists."
|
||||||
@echo "Use './configure --with-usb' instead."
|
@echo "Use './configure --with-usb' instead."
|
||||||
|
@ -109,4 +284,65 @@ snmp build-snmp install-snmp install-snmp-mgr install-snmp-man:
|
||||||
@echo "Use './configure --with-snmp' instead."
|
@echo "Use './configure --with-snmp' instead."
|
||||||
setver:
|
setver:
|
||||||
@echo "Error: 'make setver' no longer exists."
|
@echo "Error: 'make setver' no longer exists."
|
||||||
@echo "Edit configure.in to set version number."
|
@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
|
||||||
|
|
795
Makefile.in
795
Makefile.in
File diff suppressed because it is too large
Load diff
109
README
109
README
|
@ -102,7 +102,7 @@ This package is broken down into several categories:
|
||||||
- *clients* - They talk to upsd and do things with the status data.
|
- *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.
|
- *cgi-bin* - Special class of clients that you can use with your web server.
|
||||||
- *scripts* - Contains various scripts, like the Perl and Python binding,
|
- *scripts* - Contains various scripts, like the Perl and Python binding,
|
||||||
integration bits and applications.
|
integration bits and applications.
|
||||||
|
|
||||||
Drivers
|
Drivers
|
||||||
-------
|
-------
|
||||||
|
@ -120,16 +120,28 @@ The entry in `ups.conf` looks like this:
|
||||||
driver = apcsmart
|
driver = apcsmart
|
||||||
port = /dev/ttyS1
|
port = /dev/ttyS1
|
||||||
|
|
||||||
To start and stop drivers, use upsdrvctl. By default, it will start or
|
To start and stop drivers, use upsdrvctl of upsdrvsvcctl (installed on
|
||||||
stop every UPS in the config file:
|
operating systems with a service management framework supported by NUT).
|
||||||
|
By default, it will start or stop every UPS in the config file:
|
||||||
|
|
||||||
/usr/local/ups/bin/upsdrvctl start
|
/usr/local/ups/sbin/upsdrvctl start
|
||||||
/usr/local/ups/bin/upsdrvctl stop
|
/usr/local/ups/sbin/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/bin/upsdrvctl start sparky
|
/usr/local/ups/sbin/upsdrvctl start sparky
|
||||||
/usr/local/ups/bin/upsdrvctl stop sparky
|
/usr/local/ups/sbin/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 find the driver name for your device, refer to the section below
|
||||||
called "HARDWARE SUPPORT TABLE".
|
called "HARDWARE SUPPORT TABLE".
|
||||||
|
@ -142,7 +154,7 @@ 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.
|
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
|
For example, the usbhid-ups driver allows you to use USB serial numbers to
|
||||||
distingish between units via the "serial" configuration option. To use this
|
distinguish between units via the "serial" configuration option. To use this
|
||||||
feature, just add another line to your ups.conf section for that UPS:
|
feature, just add another line to your ups.conf section for that UPS:
|
||||||
|
|
||||||
[sparky]
|
[sparky]
|
||||||
|
@ -209,6 +221,11 @@ and networked PDU, along with Blade and IPMI enabled servers.
|
||||||
See the linkman:powerman-pdu[8] man page for more
|
See the linkman:powerman-pdu[8] man page for more
|
||||||
information.
|
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.
|
||||||
|
|
||||||
UPS Shutdowns
|
UPS Shutdowns
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
@ -218,8 +235,8 @@ upsdrvctl can also shut down (power down) all of your UPS hardware.
|
||||||
WARNING: if you play around with this command, expect your filesystems
|
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:
|
to die. Don't power off your computers unless they're ready for it:
|
||||||
|
|
||||||
/usr/local/ups/bin/upsdrvctl shutdown
|
/usr/local/ups/sbin/upsdrvctl shutdown
|
||||||
/usr/local/ups/bin/upsdrvctl shutdown sparky
|
/usr/local/ups/sbin/upsdrvctl shutdown sparky
|
||||||
|
|
||||||
You should read the <<UPS_shutdown,Configuring automatic UPS shutdowns>>
|
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
|
chapter to learn more about when to use this feature. If called at the wrong
|
||||||
|
@ -231,8 +248,8 @@ Power distribution unit management
|
||||||
|
|
||||||
NUT also provides an advanced support for power distribution units.
|
NUT also provides an advanced support for power distribution units.
|
||||||
|
|
||||||
You should read the <<Outlets_PDU_notes,Configuring automatic UPS shutdowns>>
|
You should read the <<outlet_management,NUT outlets management and PDU notes>>
|
||||||
chapter to learn more about when to use this feature.
|
chapter to learn more about when to use this feature.
|
||||||
|
|
||||||
Network Server
|
Network Server
|
||||||
--------------
|
--------------
|
||||||
|
@ -256,32 +273,52 @@ separate section in the documentation since it is so important.
|
||||||
|
|
||||||
You configure it by telling it about UPSes that you want to monitor in
|
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:
|
upsmon.conf. Each UPS can be defined as one of two possible types:
|
||||||
|
a "primary" or "secondary".
|
||||||
|
|
||||||
Master
|
Primary
|
||||||
~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
This UPS supplies power to the system running `upsmon`, and this system is also
|
The monitored UPS possibly supplies power to this system running `upsmon`,
|
||||||
responsible for shutting it down when the battery is depleted. This occurs
|
but more importantly -- this system can manage the UPS (typically, this
|
||||||
after any slave systems have disconnected safely.
|
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).
|
||||||
|
|
||||||
If your UPS is plugged directly into a system's serial port, the `upsmon`
|
The shutdown of this (primary) system itself, as well as eventually an
|
||||||
process on that system should define that UPS as a master.
|
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 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).
|
||||||
|
|
||||||
For a typical home user, there's one computer connected to one UPS.
|
For a typical home user, there's one computer connected to one UPS.
|
||||||
That means you run a driver, `upsd`, and `upsmon` in master mode.
|
That means you would run on the same computer the whole NUT stack --
|
||||||
|
a suitable driver, `upsd`, and `upsmon` in primary mode.
|
||||||
|
|
||||||
Slave
|
Secondary
|
||||||
~~~~~
|
~~~~~~~~~
|
||||||
|
|
||||||
This UPS may supply power to the system running `upsmon`, but this system can't
|
The monitored UPS may supply power to the system running `upsmon` (or
|
||||||
shut it down directly.
|
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
|
Use this mode when you run multiple computers on the same UPS.
|
||||||
one can be connected to the serial port on the UPS, and that system is the
|
Obviously, only one can be connected to the serial or USB port
|
||||||
master. Everything else is a slave.
|
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.
|
For a typical home user, there's one computer connected to one UPS.
|
||||||
That means you run a driver, upsd, and upsmon in master mode.
|
That means you run a driver, `upsd`, and `upsmon` in primary mode.
|
||||||
|
|
||||||
Additional Information
|
Additional Information
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -471,7 +508,11 @@ 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,
|
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
|
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
|
branch anymore since the code is available through a revision control
|
||||||
system (namely Subversion) and snapshots.
|
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.
|
||||||
|
|
||||||
Major release jumps are mostly due to large changes to the features
|
Major release jumps are mostly due to large changes to the features
|
||||||
list. There have also been a number of architectural changes which
|
list. There have also been a number of architectural changes which
|
||||||
|
@ -481,11 +522,11 @@ may not be noticeable to most users, but which can impact developers.
|
||||||
Backwards and Forwards Compatibility
|
Backwards and Forwards Compatibility
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
The old network code spans a range from about 0.41.1 when TCP support
|
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
|
was introduced up to the recent 1.4 series. It used variable names
|
||||||
like STATUS, UTILITY, and LOADPCT. Many of these names go back to the
|
like STATUS, UTILITY, and LOADPCT. Many of these names go back to the
|
||||||
earliest prototypes of this software from 1997. At that point there
|
earliest prototypes of this software from 1997. At that point there
|
||||||
was no way to know that so many drivers would come along and introduce
|
was no way to know that so many drivers would come along and introduce
|
||||||
so many new variables and commands. The resulting mess grew out of
|
so many new variables and commands. The resulting mess grew out of
|
||||||
control over the years.
|
control over the years.
|
||||||
|
|
||||||
|
@ -517,9 +558,9 @@ Here's a table to make it easier to visualize:
|
||||||
|=============================================
|
|=============================================
|
||||||
|
|
||||||
Version 2.0, and more recent, do not contain backwards compatibility for
|
Version 2.0, and more recent, do not contain backwards compatibility for
|
||||||
the old protocol and variable/command names. As a result, 2.0 clients can't
|
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
|
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"
|
fetch "STATUS", it will fail. You'll have to ask for "ups.status"
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
Authors of separate monitoring programs should have used the 1.4 series
|
Authors of separate monitoring programs should have used the 1.4 series
|
||||||
|
|
4
TODO
4
TODO
|
@ -13,7 +13,7 @@ Roadmap
|
||||||
^^^
|
^^^
|
||||||
|
|
||||||
This release is focused on the website and documentation rewrite, using
|
This release is focused on the website and documentation rewrite, using
|
||||||
the excellent link:http://www.methods.co.nz/asciidoc[AsciiDoc].
|
the excellent link:https://asciidoc.org/[AsciiDoc].
|
||||||
|
|
||||||
2.8
|
2.8
|
||||||
^^^
|
^^^
|
||||||
|
@ -113,6 +113,6 @@ and https://alioth.debian.org/tracker/?atid=411545&group_id=30602&func=browse[fe
|
||||||
solar panel driver, and the powerman internal approach of a generic engine with
|
solar panel driver, and the powerman internal approach of a generic engine with
|
||||||
a scripting interface is a cool idea.
|
a scripting interface is a cool idea.
|
||||||
Ref http://powerman.svn.sourceforge.net/viewvc/powerman/trunk/etc/apcpdu.dev?revision=969&view=markup
|
Ref http://powerman.svn.sourceforge.net/viewvc/powerman/trunk/etc/apcpdu.dev?revision=969&view=markup
|
||||||
- integrate the (future) new powerman LUA engine (maybe/mustbe used for the driver above?)
|
- integrate the (future) new powerman LUA engine (maybe/must-be used for the driver above?)
|
||||||
for native PDU support
|
for native PDU support
|
||||||
- see how we can help and collaborate with DeviceKit-power
|
- see how we can help and collaborate with DeviceKit-power
|
||||||
|
|
219
UPGRADING
219
UPGRADING
|
@ -7,11 +7,222 @@ This file lists changes that affect users who installed older versions
|
||||||
of this software. When upgrading from an older version, be sure to
|
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.
|
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
|
Changes from 2.6.3 to 2.6.4
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
- users are encouraged to update to NUT 2.6.4, to fix upsd vulnerability
|
- users are encouraged to update to NUT 2.6.4, to fix upsd vulnerability
|
||||||
(CVE-2012-2944: upsd can be remotely crashed)
|
(CVE-2012-2944: upsd can be remotely crashed).
|
||||||
- users of the bestups driver are encouraged to switch to blazer_ser,
|
- users of the bestups driver are encouraged to switch to blazer_ser,
|
||||||
since bestups will soon be deprecated.
|
since bestups will soon be deprecated.
|
||||||
|
|
||||||
|
@ -86,7 +297,7 @@ Changes from 2.2.1 to 2.2.2
|
||||||
This enable the additional build and distribution of the static
|
This enable the additional build and distribution of the static
|
||||||
version of libupsclient, along with the pkg-config helper and manual
|
version of libupsclient, along with the pkg-config helper and manual
|
||||||
pages. The default configure option is to distribute only the shared
|
pages. The default configure option is to distribute only the shared
|
||||||
version of libupsclient. This can be overriden by using the
|
version of libupsclient. This can be overridden by using the
|
||||||
"--disable-shared" configure option (distribute static only binaries).
|
"--disable-shared" configure option (distribute static only binaries).
|
||||||
- The UPS poweroff handling of the usbhid-ups driver has been reworked.
|
- The UPS poweroff handling of the usbhid-ups driver has been reworked.
|
||||||
Though regression is not expected, users of this driver are
|
Though regression is not expected, users of this driver are
|
||||||
|
@ -97,7 +308,7 @@ Changes from 2.2.0 to 2.2.1
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
- nothing that affects upgraded systems.
|
- nothing that affects upgraded systems.
|
||||||
(The below message is repetead due to previous omission)
|
(The below message is repeated due to previous omission)
|
||||||
- Developers of external client application using libupsclient are
|
- Developers of external client application using libupsclient are
|
||||||
encouraged to rename their "UPSCONN" client structure to "UPSCONN_t"
|
encouraged to rename their "UPSCONN" client structure to "UPSCONN_t"
|
||||||
since the former will disappear by the release of NUT 2.4.
|
since the former will disappear by the release of NUT 2.4.
|
||||||
|
@ -122,7 +333,7 @@ automake). Refer to packaging/debian/ for an example of migration.
|
||||||
ie not using upsdrvctl.
|
ie not using upsdrvctl.
|
||||||
- Developers of external client application using libupsclient are
|
- Developers of external client application using libupsclient are
|
||||||
encouraged to rename the "UPSCONN" client structure to "UPSCONN_t"
|
encouraged to rename the "UPSCONN" client structure to "UPSCONN_t"
|
||||||
since the former will disapear by the release of NUT 2.4.
|
since the former will disappear by the release of NUT 2.4.
|
||||||
|
|
||||||
Changes from 2.0.4 to 2.0.5
|
Changes from 2.0.4 to 2.0.5
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
1246
aclocal.m4
vendored
1246
aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,19 @@
|
||||||
# Network UPS Tools: clients
|
# 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
|
# by default, link programs in this directory with libcommon.a
|
||||||
LDADD = ../common/libcommon.la libupsclient.la $(NETLIBS)
|
LDADD = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS)
|
||||||
if WITH_SSL
|
if WITH_SSL
|
||||||
LDADD += $(LIBSSL_LIBS)
|
LDADD += $(LIBSSL_LIBS)
|
||||||
endif
|
endif
|
||||||
|
@ -21,8 +33,12 @@ bin_PROGRAMS = upsc upslog upsrw upscmd
|
||||||
dist_bin_SCRIPTS = upssched-cmd
|
dist_bin_SCRIPTS = upssched-cmd
|
||||||
sbin_PROGRAMS = upsmon upssched
|
sbin_PROGRAMS = upsmon upssched
|
||||||
lib_LTLIBRARIES = libupsclient.la
|
lib_LTLIBRARIES = libupsclient.la
|
||||||
|
if HAVE_CXX11
|
||||||
|
lib_LTLIBRARIES += libnutclient.la
|
||||||
|
lib_LTLIBRARIES += libnutclientstub.la
|
||||||
|
endif
|
||||||
if WITH_DEV
|
if WITH_DEV
|
||||||
include_HEADERS = upsclient.h ../include/parseconf.h
|
include_HEADERS = upsclient.h ../include/parseconf.h nutclient.h nutclientmem.h
|
||||||
endif
|
endif
|
||||||
if WITH_CGI
|
if WITH_CGI
|
||||||
cgiexec_PROGRAMS = upsstats.cgi upsimage.cgi upsset.cgi
|
cgiexec_PROGRAMS = upsstats.cgi upsimage.cgi upsset.cgi
|
||||||
|
@ -35,7 +51,7 @@ upslog_SOURCES = upslog.c upsclient.h upslog.h
|
||||||
upsmon_SOURCES = upsmon.c upsmon.h upsclient.h
|
upsmon_SOURCES = upsmon.c upsmon.h upsclient.h
|
||||||
|
|
||||||
upssched_SOURCES = upssched.c upssched.h
|
upssched_SOURCES = upssched.c upssched.h
|
||||||
upssched_LDADD = ../common/libcommon.la ../common/libparseconf.la $(NETLIBS)
|
upssched_LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS)
|
||||||
|
|
||||||
upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
|
upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
|
||||||
upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)
|
upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)
|
||||||
|
@ -46,8 +62,44 @@ upsstats_cgi_SOURCES = upsstats.c upsclient.h status.h upsstats.h \
|
||||||
|
|
||||||
# not LDADD.
|
# not LDADD.
|
||||||
libupsclient_la_SOURCES = upsclient.c upsclient.h
|
libupsclient_la_SOURCES = upsclient.c upsclient.h
|
||||||
libupsclient_la_LIBADD = ../common/libparseconf.la
|
libupsclient_la_LIBADD = $(top_builddir)/common/libcommonclient.la
|
||||||
if WITH_SSL
|
if WITH_SSL
|
||||||
libupsclient_la_LIBADD += $(LIBSSL_LIBS)
|
libupsclient_la_LIBADD += $(LIBSSL_LIBS)
|
||||||
endif
|
endif
|
||||||
libupsclient_la_LDFLAGS = -version-info 2:0:1
|
|
||||||
|
# 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
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -46,9 +46,12 @@ static char *unescape(char *buf)
|
||||||
hex[1] = buf[++i];
|
hex[1] = buf[++i];
|
||||||
hex[2] = '\0';
|
hex[2] = '\0';
|
||||||
if (!isxdigit((unsigned char) hex[0])
|
if (!isxdigit((unsigned char) hex[0])
|
||||||
|| !isxdigit((unsigned char) hex[0]))
|
|| !isxdigit((unsigned char) hex[1]))
|
||||||
fatalx(EXIT_FAILURE, "bad escape char");
|
fatalx(EXIT_FAILURE, "bad escape char");
|
||||||
ch = strtol(hex, NULL, 16);
|
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... */
|
||||||
|
|
||||||
if ((ch == 10) || (ch == 13))
|
if ((ch == 10) || (ch == 13))
|
||||||
ch = ' ';
|
ch = ' ';
|
||||||
|
@ -89,7 +92,7 @@ void extractcgiargs(void)
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
*eq = '\0';
|
*eq = '\0';
|
||||||
value = eq + 1;
|
value = eq + 1;
|
||||||
amp = strchr(value, '&');
|
amp = strchr(value, '&');
|
||||||
|
@ -101,7 +104,7 @@ void extractcgiargs(void)
|
||||||
ptr = NULL;
|
ptr = NULL;
|
||||||
|
|
||||||
cleanvar = unescape(varname);
|
cleanvar = unescape(varname);
|
||||||
cleanval = unescape(value);
|
cleanval = unescape(value);
|
||||||
parsearg(cleanvar, cleanval);
|
parsearg(cleanvar, cleanval);
|
||||||
free(cleanvar);
|
free(cleanvar);
|
||||||
free(cleanval);
|
free(cleanval);
|
||||||
|
@ -199,4 +202,4 @@ int checkhost(const char *host, char **desc)
|
||||||
pconf_finish(&ctx);
|
pconf_finish(&ctx);
|
||||||
|
|
||||||
return 0; /* not found: access denied */
|
return 0; /* not found: access denied */
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,15 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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() ... */
|
/* other programs that link to this should provide parsearg() ... */
|
||||||
void parsearg(char *var, char *value);
|
void parsearg(char *var, char *value);
|
||||||
|
|
||||||
|
@ -29,3 +38,10 @@ void extractpostargs(void);
|
||||||
/* see if a host is allowed per the hosts.conf */
|
/* see if a host is allowed per the hosts.conf */
|
||||||
int checkhost(const char *host, char **desc);
|
int checkhost(const char *host, char **desc);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_CGILIB_H_SEEN */
|
||||||
|
|
2055
clients/nutclient.cpp
Normal file
2055
clients/nutclient.cpp
Normal file
File diff suppressed because it is too large
Load diff
1072
clients/nutclient.h
Normal file
1072
clients/nutclient.h
Normal file
File diff suppressed because it is too large
Load diff
252
clients/nutclientmem.cpp
Normal file
252
clients/nutclientmem.cpp
Normal file
|
@ -0,0 +1,252 @@
|
||||||
|
/* 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" */
|
118
clients/nutclientmem.h
Normal file
118
clients/nutclientmem.h
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
/* 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,7 +17,19 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct {
|
#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 {
|
||||||
char *name;
|
char *name;
|
||||||
char *desc;
|
char *desc;
|
||||||
int severity;
|
int severity;
|
||||||
|
@ -35,3 +47,11 @@ struct {
|
||||||
{ "BYPASS", "BYPASS", 2 },
|
{ "BYPASS", "BYPASS", 2 },
|
||||||
{ NULL, NULL, 0 }
|
{ NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_STATUS_H_SEEN */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* upsc - simple "client" to test communications
|
/* upsc - simple "client" to test communications
|
||||||
|
|
||||||
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
|
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
|
||||||
Copyright (C) 2012 Arnaud Quette <arnaud.quette@free.fr>
|
Copyright (C) 2012 Arnaud Quette <arnaud.quette@free.fr>
|
||||||
|
@ -19,11 +19,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "nut_platform.h"
|
||||||
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include "nut_stdint.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
|
|
||||||
static char *upsname = NULL, *hostname = NULL;
|
static char *upsname = NULL, *hostname = NULL;
|
||||||
|
@ -57,7 +59,7 @@ static void usage(const char *prog)
|
||||||
static void printvar(const char *var)
|
static void printvar(const char *var)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -85,7 +87,7 @@ static void printvar(const char *var)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numa < numq) {
|
if (numa < numq) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least %d)", numa, numq);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least %zu)", numa, numq);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s\n", answer[3]);
|
printf("%s\n", answer[3]);
|
||||||
|
@ -94,7 +96,7 @@ static void printvar(const char *var)
|
||||||
static void list_vars(void)
|
static void list_vars(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -118,7 +120,7 @@ static void list_vars(void)
|
||||||
|
|
||||||
/* VAR <upsname> <varname> <val> */
|
/* VAR <upsname> <varname> <val> */
|
||||||
if (numa < 4) {
|
if (numa < 4) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 4)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s: %s\n", answer[2], answer[3]);
|
printf("%s: %s\n", answer[2], answer[3]);
|
||||||
|
@ -128,7 +130,7 @@ static void list_vars(void)
|
||||||
static void list_upses(int verbose)
|
static void list_upses(int verbose)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -136,7 +138,7 @@ static void list_upses(int verbose)
|
||||||
numq = 1;
|
numq = 1;
|
||||||
|
|
||||||
ret = upscli_list_start(ups, numq, query);
|
ret = upscli_list_start(ups, numq, query);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
/* check for an old upsd */
|
/* check for an old upsd */
|
||||||
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
|
if (upscli_upserror(ups) == UPSCLI_ERR_UNKCOMMAND) {
|
||||||
|
@ -150,7 +152,7 @@ static void list_upses(int verbose)
|
||||||
|
|
||||||
/* UPS <upsname> <description> */
|
/* UPS <upsname> <description> */
|
||||||
if (numa < 3) {
|
if (numa < 3) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 3)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 3)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(verbose) {
|
if(verbose) {
|
||||||
|
@ -164,7 +166,7 @@ static void list_upses(int verbose)
|
||||||
static void list_clients(const char *devname)
|
static void list_clients(const char *devname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -187,7 +189,7 @@ static void list_clients(const char *devname)
|
||||||
|
|
||||||
/* CLIENT <upsname> <address> */
|
/* CLIENT <upsname> <address> */
|
||||||
if (numa < 3) {
|
if (numa < 3) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 3)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 3)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s\n", answer[2]);
|
printf("%s\n", answer[2]);
|
||||||
|
@ -207,7 +209,8 @@ static void clean_exit(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, port;
|
int i;
|
||||||
|
uint16_t port;
|
||||||
int varlist = 0, clientlist = 0, verbose = 0;
|
int varlist = 0, clientlist = 0, verbose = 0;
|
||||||
const char *prog = xbasename(argv[0]);
|
const char *prog = xbasename(argv[0]);
|
||||||
|
|
||||||
|
@ -217,7 +220,9 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
case 'L':
|
case 'L':
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
|
goto fallthrough_case_l;
|
||||||
case 'l':
|
case 'l':
|
||||||
|
fallthrough_case_l:
|
||||||
varlist = 1;
|
varlist = 1;
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
|
@ -226,6 +231,9 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
fatalx(EXIT_SUCCESS, "Network UPS Tools upscmd %s", UPS_VERSION);
|
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':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
|
@ -274,3 +282,11 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
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,9 +20,25 @@
|
||||||
#ifndef UPSCLIENT_H_SEEN
|
#ifndef UPSCLIENT_H_SEEN
|
||||||
#define UPSCLIENT_H_SEEN
|
#define UPSCLIENT_H_SEEN
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef WITH_OPENSSL
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/ssl.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>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -38,7 +54,7 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *host;
|
char *host;
|
||||||
int port;
|
uint16_t port;
|
||||||
int fd;
|
int fd;
|
||||||
int flags;
|
int flags;
|
||||||
int upserror;
|
int upserror;
|
||||||
|
@ -49,13 +65,13 @@ typedef struct {
|
||||||
|
|
||||||
char errbuf[UPSCLI_ERRBUF_LEN];
|
char errbuf[UPSCLI_ERRBUF_LEN];
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef WITH_OPENSSL
|
||||||
SSL_CTX *ssl_ctx;
|
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
#else
|
#elif defined(WITH_NSS) /* WITH_OPENSSL */
|
||||||
void *ssl_ctx;
|
PRFileDesc *ssl;
|
||||||
void *ssl;
|
#else /* WITH_OPENSSL | WITH_NSS */
|
||||||
#endif
|
void *ssl;
|
||||||
|
#endif /* WITH_OPENSSL | WITH_NSS */
|
||||||
|
|
||||||
char readbuf[64];
|
char readbuf[64];
|
||||||
size_t readlen;
|
size_t readlen;
|
||||||
|
@ -65,30 +81,34 @@ typedef struct {
|
||||||
|
|
||||||
const char *upscli_strerror(UPSCONN_t *ups);
|
const char *upscli_strerror(UPSCONN_t *ups);
|
||||||
|
|
||||||
int upscli_tryconnect(UPSCONN_t *ups, const char *host, int port, int flags, struct timeval *tv);
|
int upscli_init(int certverify, const char *certpath, const char *certname, const char *certpasswd);
|
||||||
|
int upscli_cleanup(void);
|
||||||
|
|
||||||
int upscli_connect(UPSCONN_t *ups, const char *host, int port, int flags);
|
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);
|
||||||
|
|
||||||
/* --- functions that only use the new names --- */
|
/* --- functions that only use the new names --- */
|
||||||
|
|
||||||
int upscli_get(UPSCONN_t *ups, unsigned int numq, const char **query,
|
int upscli_get(UPSCONN_t *ups, size_t numq, const char **query,
|
||||||
unsigned int *numa, char ***answer);
|
size_t *numa, char ***answer);
|
||||||
|
|
||||||
int upscli_list_start(UPSCONN_t *ups, unsigned int numq, const char **query);
|
int upscli_list_start(UPSCONN_t *ups, size_t numq, const char **query);
|
||||||
|
|
||||||
int upscli_list_next(UPSCONN_t *ups, unsigned int numq, const char **query,
|
int upscli_list_next(UPSCONN_t *ups, size_t numq, const char **query,
|
||||||
unsigned int *numa, char ***answer);
|
size_t *numa, char ***answer);
|
||||||
|
|
||||||
int upscli_sendline(UPSCONN_t *ups, const char *buf, size_t buflen);
|
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_readline(UPSCONN_t *ups, 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_splitname(const char *buf, char **upsname, char **hostname,
|
int upscli_splitname(const char *buf, char **upsname, char **hostname,
|
||||||
int *port);
|
uint16_t *port);
|
||||||
|
|
||||||
int upscli_splitaddr(const char *buf, char **hostname, int *port);
|
int upscli_splitaddr(const char *buf, char **hostname, uint16_t *port);
|
||||||
|
|
||||||
int upscli_sslcert(UPSCONN_t *ups, const char *file, const char *path, int verify);
|
|
||||||
|
|
||||||
int upscli_disconnect(UPSCONN_t *ups);
|
int upscli_disconnect(UPSCONN_t *ups);
|
||||||
|
|
||||||
|
@ -98,7 +118,7 @@ int upscli_fd(UPSCONN_t *ups);
|
||||||
int upscli_upserror(UPSCONN_t *ups);
|
int upscli_upserror(UPSCONN_t *ups);
|
||||||
|
|
||||||
/* returns 1 if SSL mode is active for this connection */
|
/* returns 1 if SSL mode is active for this connection */
|
||||||
int upscli_ssl(UPSCONN_t *ups);
|
int upscli_ssl(UPSCONN_t *ups);
|
||||||
|
|
||||||
/* upsclient error list */
|
/* upsclient error list */
|
||||||
|
|
||||||
|
@ -156,10 +176,11 @@ int upscli_ssl(UPSCONN_t *ups);
|
||||||
|
|
||||||
/* flags for use with upscli_connect */
|
/* flags for use with upscli_connect */
|
||||||
|
|
||||||
#define UPSCLI_CONN_TRYSSL 0x0001 /* try SSL, OK if not supported */
|
#define UPSCLI_CONN_TRYSSL 0x0001 /* try SSL, OK if not supported */
|
||||||
#define UPSCLI_CONN_REQSSL 0x0002 /* try SSL, fail if not supported */
|
#define UPSCLI_CONN_REQSSL 0x0002 /* try SSL, fail if not supported */
|
||||||
#define UPSCLI_CONN_INET 0x0004 /* IPv4 only */
|
#define UPSCLI_CONN_INET 0x0004 /* IPv4 only */
|
||||||
#define UPSCLI_CONN_INET6 0x0008 /* IPv6 only */
|
#define UPSCLI_CONN_INET6 0x0008 /* IPv6 only */
|
||||||
|
#define UPSCLI_CONN_CERTVERIF 0x0010 /* Verify certificates for SSL */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
|
157
clients/upscmd.c
157
clients/upscmd.c
|
@ -1,6 +1,8 @@
|
||||||
/* upscmd - simple "client" to test instant commands via upsd
|
/* upscmd - simple "client" to test instant commands via upsd
|
||||||
|
|
||||||
Copyright (C) 2000 Russell Kroll <rkroll@exploits.org>
|
Copyright (C)
|
||||||
|
2000 Russell Kroll <rkroll@exploits.org>
|
||||||
|
2019 EATON (author: Arnaud Quette <ArnaudQuette@eaton.com>)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "nut_platform.h"
|
||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
@ -25,10 +28,13 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include "nut_stdint.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
|
|
||||||
static char *upsname = NULL, *hostname = NULL;
|
static char *upsname = NULL, *hostname = NULL;
|
||||||
static UPSCONN_t *ups = NULL;
|
static UPSCONN_t *ups = NULL;
|
||||||
|
static int tracking_enabled = 0;
|
||||||
|
static unsigned int timeout = DEFAULT_TRACKING_TIMEOUT;
|
||||||
|
|
||||||
struct list_t {
|
struct list_t {
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -40,13 +46,16 @@ static void usage(const char *prog)
|
||||||
printf("Network UPS Tools upscmd %s\n\n", UPS_VERSION);
|
printf("Network UPS Tools upscmd %s\n\n", UPS_VERSION);
|
||||||
printf("usage: %s [-h]\n", prog);
|
printf("usage: %s [-h]\n", prog);
|
||||||
printf(" %s [-l <ups>]\n", prog);
|
printf(" %s [-l <ups>]\n", prog);
|
||||||
printf(" %s [-u <username>] [-p <password>] <ups> <command> [<value>]\n\n", prog);
|
printf(" %s [-u <username>] [-p <password>] [-w] [-t <timeout>] <ups> <command> [<value>]\n\n", prog);
|
||||||
printf("Administration program to initiate instant commands on UPS hardware.\n");
|
printf("Administration program to initiate instant commands on UPS hardware.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" -h display this help text\n");
|
printf(" -h display this help text\n");
|
||||||
printf(" -l <ups> show available commands on UPS <ups>\n");
|
printf(" -l <ups> show available commands on UPS <ups>\n");
|
||||||
printf(" -u <username> set username for command authentication\n");
|
printf(" -u <username> set username for command authentication\n");
|
||||||
printf(" -p <password> set password 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("\n");
|
||||||
printf(" <ups> UPS identifier - <upsname>[@<hostname>[:<port>]]\n");
|
printf(" <ups> UPS identifier - <upsname>[@<hostname>[:<port>]]\n");
|
||||||
printf(" <command> Valid instant command - test.panel.start, etc.\n");
|
printf(" <command> Valid instant command - test.panel.start, etc.\n");
|
||||||
|
@ -56,7 +65,7 @@ static void usage(const char *prog)
|
||||||
static void print_cmd(char *cmdname)
|
static void print_cmd(char *cmdname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -79,7 +88,7 @@ static void print_cmd(char *cmdname)
|
||||||
static void listcmds(void)
|
static void listcmds(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
struct list_t *lhead = NULL, *llast = NULL, *ltmp, *lnext;
|
struct list_t *lhead = NULL, *llast = NULL, *ltmp, *lnext;
|
||||||
|
@ -104,7 +113,7 @@ static void listcmds(void)
|
||||||
|
|
||||||
/* CMD <upsname> <cmdname> */
|
/* CMD <upsname> <cmdname> */
|
||||||
if (numa < 3) {
|
if (numa < 3) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 3)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 3)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we must first read the entire list of commands,
|
/* we must first read the entire list of commands,
|
||||||
|
@ -135,9 +144,21 @@ 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)
|
static void do_cmd(char **argv, const int argc)
|
||||||
{
|
{
|
||||||
|
int cmd_complete = 0;
|
||||||
char buf[SMALLBUF];
|
char buf[SMALLBUF];
|
||||||
|
char tracking_id[UUID4_LEN];
|
||||||
|
time_t start, now;
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
snprintf(buf, sizeof(buf), "INSTCMD %s %s %s\n", upsname, argv[0], argv[1]);
|
snprintf(buf, sizeof(buf), "INSTCMD %s %s %s\n", upsname, argv[0], argv[1]);
|
||||||
|
@ -153,13 +174,88 @@ static void do_cmd(char **argv, const int argc)
|
||||||
fatalx(EXIT_FAILURE, "Instant command failed: %s", upscli_strerror(ups));
|
fatalx(EXIT_FAILURE, "Instant command failed: %s", upscli_strerror(ups));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FUTURE: status cookies will tie in here */
|
/* verify answer */
|
||||||
if (strncmp(buf, "OK", 2) != 0) {
|
if (strncmp(buf, "OK", 2) != 0) {
|
||||||
fatalx(EXIT_FAILURE, "Unexpected response from upsd: %s", buf);
|
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);
|
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)
|
static void clean_exit(void)
|
||||||
{
|
{
|
||||||
|
@ -174,12 +270,14 @@ static void clean_exit(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, ret, port;
|
int i;
|
||||||
|
uint16_t port;
|
||||||
|
ssize_t ret;
|
||||||
int have_un = 0, have_pw = 0, cmdlist = 0;
|
int have_un = 0, have_pw = 0, cmdlist = 0;
|
||||||
char buf[SMALLBUF], username[SMALLBUF], password[SMALLBUF];
|
char buf[SMALLBUF * 2], username[SMALLBUF], password[SMALLBUF];
|
||||||
const char *prog = xbasename(argv[0]);
|
const char *prog = xbasename(argv[0]);
|
||||||
|
|
||||||
while ((i = getopt(argc, argv, "+lhu:p:V")) != -1) {
|
while ((i = getopt(argc, argv, "+lhu:p:t:wV")) != -1) {
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
|
@ -197,8 +295,20 @@ int main(int argc, char **argv)
|
||||||
have_pw = 1;
|
have_pw = 1;
|
||||||
break;
|
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':
|
case 'V':
|
||||||
fatalx(EXIT_SUCCESS, "Network UPS Tools upscmd %s", UPS_VERSION);
|
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':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
|
@ -312,7 +422,34 @@ int main(int argc, char **argv)
|
||||||
fatalx(EXIT_FAILURE, "Set password failed: %s", upscli_strerror(ups));
|
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);
|
do_cmd(&argv[1], argc - 1);
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
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,6 +37,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "nut_stdint.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
#include "cgilib.h"
|
#include "cgilib.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
|
|
||||||
static char *monhost = NULL, *cmd = NULL;
|
static char *monhost = NULL, *cmd = NULL;
|
||||||
|
|
||||||
static int port;
|
static uint16_t port;
|
||||||
static char *upsname, *hostname;
|
static char *upsname, *hostname;
|
||||||
static UPSCONN_t ups;
|
static UPSCONN_t ups;
|
||||||
|
|
||||||
|
@ -60,7 +61,7 @@ static UPSCONN_t ups;
|
||||||
|
|
||||||
void parsearg(char *var, char *value)
|
void parsearg(char *var, char *value)
|
||||||
{
|
{
|
||||||
int i, v;
|
long long i, v; /* Be big enough to fit all expected inputs; truncate later */
|
||||||
|
|
||||||
/* avoid bogus junk from evil people */
|
/* avoid bogus junk from evil people */
|
||||||
if ((strlen(var) > MAX_CGI_STRLEN) || (strlen(value) > MAX_CGI_STRLEN))
|
if ((strlen(var) > MAX_CGI_STRLEN) || (strlen(value) > MAX_CGI_STRLEN))
|
||||||
|
@ -82,17 +83,20 @@ void parsearg(char *var, char *value)
|
||||||
for (i = 0; imgarg[i].name != NULL; i++) {
|
for (i = 0; imgarg[i].name != NULL; i++) {
|
||||||
if (!strcmp(imgarg[i].name, var)) {
|
if (!strcmp(imgarg[i].name, var)) {
|
||||||
if (!strncmp(value, "0x", 2))
|
if (!strncmp(value, "0x", 2))
|
||||||
v = strtoul(value + 2, (char **)NULL, 16);
|
v = (long long)strtoul(value + 2, (char **)NULL, 16);
|
||||||
else
|
else
|
||||||
v = atoi(value);
|
v = (long long)atoi(value);
|
||||||
|
|
||||||
/* avoid false numbers from bad people */
|
/* avoid false numbers from bad people */
|
||||||
if (v < imgarg[i].min)
|
if (v < imgarg[i].min)
|
||||||
imgarg[i].val = imgarg[i].min;
|
imgarg[i].val = imgarg[i].min;
|
||||||
else if (v > imgarg[i].max)
|
else if (v > imgarg[i].max)
|
||||||
imgarg[i].val = imgarg[i].max;
|
imgarg[i].val = imgarg[i].max;
|
||||||
else
|
else {
|
||||||
imgarg[i].val = v;
|
assert (v < INT_MAX);
|
||||||
|
assert (v > INT_MIN);
|
||||||
|
imgarg[i].val = (int)v;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,6 +115,9 @@ static int get_imgarg(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write the HTML header then have gd dump the image */
|
/* write the HTML header then have gd dump the image */
|
||||||
|
static void drawimage(gdImagePtr im)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void drawimage(gdImagePtr im)
|
static void drawimage(gdImagePtr im)
|
||||||
{
|
{
|
||||||
printf("Pragma: no-cache\n");
|
printf("Pragma: no-cache\n");
|
||||||
|
@ -191,7 +198,7 @@ static void drawscale(
|
||||||
if (level % step5 == 0)
|
if (level % step5 == 0)
|
||||||
gdImageLine(im, 5, y, width - 5, y, col2);
|
gdImageLine(im, 5, y, width - 5, y, col2);
|
||||||
else
|
else
|
||||||
gdImageLine(im, 10, y, width - 10, y, col2);
|
gdImageLine(im, 10, y, width - 10, y, col2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,13 +207,25 @@ static void drawscale(
|
||||||
if (level % step10 == 0) {
|
if (level % step10 == 0) {
|
||||||
y = scale_height * (lvlhi - level) / range;
|
y = scale_height * (lvlhi - level) / range;
|
||||||
snprintf(lbltxt, sizeof(lbltxt), "%d", level);
|
snprintf(lbltxt, sizeof(lbltxt), "%d", level);
|
||||||
gdImageString(im, gdFontMediumBold, width - strlen(lbltxt)*gdFontMediumBold->w, y,
|
gdImageString(im, gdFontMediumBold,
|
||||||
(unsigned char *) lbltxt, scale_num_color);
|
width - (int)(strlen(lbltxt)) * gdFontMediumBold->w,
|
||||||
|
y, (unsigned char *) lbltxt, scale_num_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws the bar style indicator */
|
/* 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(
|
static void drawbar(
|
||||||
int lvllo, int lvlhi, /* min and max numbers on the scale */
|
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 step, int step5, int step10, /* steps for minor, submajor and major dashes */
|
||||||
|
@ -240,7 +259,7 @@ static void drawbar(
|
||||||
summary_color = color_alloc(im, get_imgarg("summary_col"));
|
summary_color = color_alloc(im, get_imgarg("summary_col"));
|
||||||
|
|
||||||
/* rescale UPS value to fit in the scale */
|
/* rescale UPS value to fit in the scale */
|
||||||
bar_y = (1 - (value - lvllo) / (lvlhi - lvllo)) * scale_height;
|
bar_y = (int)((1.0 - (value - lvllo) / (lvlhi - lvllo)) * scale_height);
|
||||||
|
|
||||||
/* sanity checks: */
|
/* sanity checks: */
|
||||||
|
|
||||||
|
@ -257,9 +276,21 @@ static void drawbar(
|
||||||
bar_color);
|
bar_color);
|
||||||
|
|
||||||
/* stick the text version of the value at the bottom center */
|
/* 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);
|
snprintf(text, sizeof(text), format, value);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
gdImageString(im, gdFontMediumBold,
|
gdImageString(im, gdFontMediumBold,
|
||||||
(width - strlen(text)*gdFontMediumBold->w)/2,
|
(width - (int)(strlen(text))*gdFontMediumBold->w)/2,
|
||||||
height - gdFontMediumBold->h,
|
height - gdFontMediumBold->h,
|
||||||
(unsigned char *) text, summary_color);
|
(unsigned char *) text, summary_color);
|
||||||
|
|
||||||
|
@ -269,6 +300,9 @@ static void drawbar(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws the error image */
|
/* draws the error image */
|
||||||
|
static void noimage(const char *fmt, ...)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void noimage(const char *fmt, ...)
|
static void noimage(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
gdImagePtr im;
|
gdImagePtr im;
|
||||||
|
@ -278,7 +312,19 @@ static void noimage(const char *fmt, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
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);
|
vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
width = get_imgarg("width");
|
width = get_imgarg("width");
|
||||||
|
@ -293,17 +339,23 @@ static void noimage(const char *fmt, ...)
|
||||||
|
|
||||||
if (width > height)
|
if (width > height)
|
||||||
gdImageString(im, gdFontMediumBold,
|
gdImageString(im, gdFontMediumBold,
|
||||||
(width - strlen(msg)*gdFontMediumBold->w)/2,
|
(width - (int)(strlen(msg))*gdFontMediumBold->w)/2,
|
||||||
(height - gdFontMediumBold->h)/2,
|
(height - gdFontMediumBold->h)/2,
|
||||||
(unsigned char *) msg, summary_color);
|
(unsigned char *) msg, summary_color);
|
||||||
else
|
else
|
||||||
gdImageStringUp(im, gdFontMediumBold,
|
gdImageStringUp(im, gdFontMediumBold,
|
||||||
(width - gdFontMediumBold->h)/2,
|
(width - gdFontMediumBold->h)/2,
|
||||||
(height + strlen(msg)*gdFontMediumBold->w)/2,
|
(height + (int)(strlen(msg))*gdFontMediumBold->w)/2,
|
||||||
(unsigned char *) msg, summary_color);
|
(unsigned char *) msg, summary_color);
|
||||||
|
|
||||||
drawimage(im);
|
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 */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,6 +363,10 @@ static void noimage(const char *fmt, ...)
|
||||||
UPS variable can be determined.
|
UPS variable can be determined.
|
||||||
deviation < 0 means that values below nom should be grey instead of
|
deviation < 0 means that values below nom should be grey instead of
|
||||||
green */
|
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,
|
static void drawgeneralbar(double var, int min, int nom, int max,
|
||||||
int deviation, const char *format)
|
int deviation, const char *format)
|
||||||
{
|
{
|
||||||
|
@ -370,6 +426,10 @@ static void drawgeneralbar(double var, int min, int nom, int max,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws input and output voltage bar style indicators */
|
/* 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,
|
static void draw_utility(double var, int min, int nom, int max,
|
||||||
int deviation, const char *format)
|
int deviation, const char *format)
|
||||||
{
|
{
|
||||||
|
@ -405,7 +465,7 @@ static void draw_utility(double var, int min, int nom, int max,
|
||||||
|
|
||||||
/* Acceptable range of voltage is 85%-110% of nominal voltage
|
/* Acceptable range of voltage is 85%-110% of nominal voltage
|
||||||
* in EU at least. Be conservative and say +-10% */
|
* in EU at least. Be conservative and say +-10% */
|
||||||
deviation = nom*0.1;
|
deviation = (int)(nom * 0.1);
|
||||||
|
|
||||||
drawgeneralbar(var, min, nom, max, deviation, format);
|
drawgeneralbar(var, min, nom, max, deviation, format);
|
||||||
|
|
||||||
|
@ -413,9 +473,17 @@ static void draw_utility(double var, int min, int nom, int max,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws battery.percent bar style indicator */
|
/* draws battery.percent bar style indicator */
|
||||||
static void draw_battpct(double var, int min, int nom, int max,
|
static void draw_battpct(double var, int min, int nom,
|
||||||
int deviation, const char *format)
|
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)
|
||||||
{
|
{
|
||||||
|
NUT_UNUSED_VARIABLE(nom);
|
||||||
|
NUT_UNUSED_VARIABLE(max);
|
||||||
|
NUT_UNUSED_VARIABLE(deviation);
|
||||||
|
|
||||||
if (min < 0) {
|
if (min < 0) {
|
||||||
min = 50;
|
min = 50;
|
||||||
}
|
}
|
||||||
|
@ -424,6 +492,10 @@ static void draw_battpct(double var, int min, int nom, int max,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws battery.voltage bar style indicator */
|
/* 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,
|
static void draw_battvolt(double var, int min, int nom, int max,
|
||||||
int deviation, const char *format)
|
int deviation, const char *format)
|
||||||
{
|
{
|
||||||
|
@ -450,18 +522,17 @@ static void draw_battvolt(double var, int min, int nom, int max,
|
||||||
}
|
}
|
||||||
|
|
||||||
if(min == -1) {
|
if(min == -1) {
|
||||||
min = nom/2*1.6+1; /* Assume a 2V cell is dead at 1.6V */
|
min = (int)(nom/2*1.6+1); /* Assume a 2V cell is dead at 1.6V */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(max == -1) {
|
if(max == -1) {
|
||||||
max = nom/2*2.3+1; /* Assume 2.3V float charge voltage */
|
max = (int)(nom/2*2.3+1); /* Assume 2.3V float charge voltage */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nom < min || nom > max)
|
if (nom < min || nom > max)
|
||||||
nom = -1;
|
nom = -1;
|
||||||
|
|
||||||
|
deviation = (int)(-nom*0.05); /* 5% deviation from nominal voltage */
|
||||||
deviation = -(nom*0.05); /* 5% deviation from nominal voltage */
|
|
||||||
if(deviation==0) {
|
if(deviation==0) {
|
||||||
deviation = -1;
|
deviation = -1;
|
||||||
}
|
}
|
||||||
|
@ -470,33 +541,57 @@ static void draw_battvolt(double var, int min, int nom, int max,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws ups.load bar style indicator */
|
/* draws ups.load bar style indicator */
|
||||||
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)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
|
static void draw_upsload(double var, int min,
|
||||||
|
int nom, int max,
|
||||||
int deviation, const char *format)
|
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);
|
drawbar(0, 125, 5, 5, 25, 100, 125, -1, -1, 0, 50, var, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws temperature bar style indicator */
|
/* 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,
|
static void draw_temperature(double var, int min, int nom, int max,
|
||||||
int deviation, const char *format)
|
int deviation, const char *format)
|
||||||
{
|
{
|
||||||
int hi = get_imgarg("tempmax");
|
int hi = get_imgarg("tempmax");
|
||||||
int lo = get_imgarg("tempmin");
|
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);
|
drawbar(lo, hi, 1, 5, 10, lo, min, max, hi, -1, -1, var, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws humidity bar style indicator */
|
/* 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,
|
static void draw_humidity(double var, int min, int nom, int max,
|
||||||
int deviation, const char *format)
|
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);
|
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)
|
static int get_var(const char *var, char *buf, size_t buflen)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -523,6 +618,8 @@ int main(int argc, char **argv)
|
||||||
char str[SMALLBUF];
|
char str[SMALLBUF];
|
||||||
int i, min, nom, max;
|
int i, min, nom, max;
|
||||||
double var = 0;
|
double var = 0;
|
||||||
|
NUT_UNUSED_VARIABLE(argc);
|
||||||
|
NUT_UNUSED_VARIABLE(argv);
|
||||||
|
|
||||||
extractcgiargs();
|
extractcgiargs();
|
||||||
|
|
||||||
|
@ -537,13 +634,17 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
if (upscli_splitname(monhost, &upsname, &hostname, &port) != 0) {
|
if (upscli_splitname(monhost, &upsname, &hostname, &port) != 0) {
|
||||||
noimage("Invalid UPS definition (upsname[@hostname[:port]])\n");
|
noimage("Invalid UPS definition (upsname[@hostname[:port]])\n");
|
||||||
exit(EXIT_FAILURE);
|
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||||
|
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upscli_connect(&ups, hostname, port, 0) < 0) {
|
if (upscli_connect(&ups, hostname, port, 0) < 0) {
|
||||||
noimage("Can't connect to server:\n%s\n",
|
noimage("Can't connect to server:\n%s\n",
|
||||||
upscli_strerror(&ups));
|
upscli_strerror(&ups));
|
||||||
exit(EXIT_FAILURE);
|
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||||
|
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; imgvar[i].name; i++)
|
for (i = 0; imgvar[i].name; i++)
|
||||||
|
@ -553,7 +654,9 @@ int main(int argc, char **argv)
|
||||||
registered with this variable */
|
registered with this variable */
|
||||||
if (!imgvar[i].drawfunc) {
|
if (!imgvar[i].drawfunc) {
|
||||||
noimage("Draw function N/A");
|
noimage("Draw function N/A");
|
||||||
exit(EXIT_FAILURE);
|
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||||
|
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the variable value */
|
/* get the variable value */
|
||||||
|
@ -564,7 +667,9 @@ int main(int argc, char **argv)
|
||||||
snprintf(str, sizeof(str), "%s N/A",
|
snprintf(str, sizeof(str), "%s N/A",
|
||||||
imgvar[i].name);
|
imgvar[i].name);
|
||||||
noimage(str);
|
noimage(str);
|
||||||
exit(EXIT_FAILURE);
|
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||||
|
exit(EXIT_FAILURE); /* Should not get here in practice, but compiler is afraid we can fall through */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* when getting minimum, nominal and maximum values,
|
/* when getting minimum, nominal and maximum values,
|
||||||
|
@ -617,7 +722,9 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
noimage("Unknown display");
|
noimage("Unknown display");
|
||||||
|
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
imgvar_t imgvar[] = {
|
imgvar_t imgvar[] = {
|
||||||
|
|
|
@ -17,19 +17,32 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct {
|
#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 {
|
||||||
char *name;
|
char *name;
|
||||||
int val; /* hex digits, ala HTML */
|
int val; /* hex digits, ala HTML */
|
||||||
int min; /* minimum reasonable value */
|
int min; /* minimum reasonable value */
|
||||||
int max; /* maximum reasonable value */
|
int max; /* maximum reasonable value */
|
||||||
} imgarg[] =
|
} imgarg[] =
|
||||||
{
|
{
|
||||||
{ "width", 100, 50, 200 },
|
{ "width", 100, 50, 200 },
|
||||||
{ "height", 350, 100, 500 },
|
{ "height", 350, 100, 500 },
|
||||||
{ "scale_height", 300, 100, 500 },
|
{ "scale_height", 300, 100, 500 },
|
||||||
{ "back_col", 0x000000, 0x000000, 0xffffff },
|
{ "back_col", 0x000000, 0x000000, 0xffffff },
|
||||||
{ "scale_num_col", 0xffff00, 0x000000, 0xffffff },
|
{ "scale_num_col", 0xffff00, 0x000000, 0xffffff },
|
||||||
{ "summary_col", 0xffff00, 0x000000, 0xffffff },
|
{ "summary_col", 0xffff00, 0x000000, 0xffffff },
|
||||||
{ "ok_zone_maj_col", 0x00ff00, 0x000000, 0xffffff },
|
{ "ok_zone_maj_col", 0x00ff00, 0x000000, 0xffffff },
|
||||||
{ "ok_zone_min_col", 0x007800, 0x000000, 0xffffff },
|
{ "ok_zone_min_col", 0x007800, 0x000000, 0xffffff },
|
||||||
{ "neutral_zone_maj_col", 0xffffff, 0x000000, 0xffffff },
|
{ "neutral_zone_maj_col", 0xffffff, 0x000000, 0xffffff },
|
||||||
|
@ -41,20 +54,28 @@ struct {
|
||||||
{ "tempmax", 40, -100, 150 },
|
{ "tempmax", 40, -100, 150 },
|
||||||
{ "nom_in_freq", 50, 0, 100 },
|
{ "nom_in_freq", 50, 0, 100 },
|
||||||
{ "nom_out_freq", 50, 0, 100 },
|
{ "nom_out_freq", 50, 0, 100 },
|
||||||
{ NULL, 0, 0, 0 }
|
{ NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name; /* name of the UPS variable */
|
char *name; /* name of the UPS variable */
|
||||||
char *minimum; /* name of minimum value UPS variable
|
char *minimum; /* name of minimum value UPS variable
|
||||||
or variable in imgarg table */
|
or variable in imgarg table */
|
||||||
char *nominal; /* as above, only for nominal value */
|
char *nominal; /* as above, only for nominal value */
|
||||||
char *maximum; /* as above, only for maximum value */
|
char *maximum; /* as above, only for maximum value */
|
||||||
int deviation; /* variable deviation - width of green zone */
|
int deviation; /* variable deviation - width of green zone */
|
||||||
char *format; /* format string to generate summary text */
|
char *format; /* format string to generate summary text */
|
||||||
|
|
||||||
/* pointer to drawing function */
|
/* pointer to drawing function */
|
||||||
void (*drawfunc)(double, int, int, int, int, const char*);
|
void (*drawfunc)(double, int, int, int, int, const char*);
|
||||||
} imgvar_t;
|
} imgvar_t;
|
||||||
|
|
||||||
extern imgvar_t imgvar[];
|
extern imgvar_t imgvar[];
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_UPSIMAGEARG_H_SEEN */
|
||||||
|
|
|
@ -20,25 +20,28 @@
|
||||||
/* Basic theory of operation:
|
/* Basic theory of operation:
|
||||||
*
|
*
|
||||||
* First we go through and parse as much of the status format string as
|
* First we go through and parse as much of the status format string as
|
||||||
* possible. We used to do this parsing run every time, but that's a
|
* possible. We used to do this parsing run every time, but that's a
|
||||||
* waste of CPU since it can't change during the program's run.
|
* waste of CPU since it can't change during the program's run.
|
||||||
*
|
*
|
||||||
* This version does the parsing pass once, and creates a linked list of
|
* This version does the parsing pass once, and creates a linked list of
|
||||||
* pointers to the functions that do the work and the arg they get.
|
* pointers to the functions that do the work and the arg they get.
|
||||||
*
|
*
|
||||||
* That means the main loop just has to run the linked list and call
|
* That means the main loop just has to run the linked list and call
|
||||||
* anything it finds in there. Everything happens from there, and we
|
* anything it finds in there. Everything happens from there, and we
|
||||||
* don't have to pointlessly reparse the string every time around.
|
* don't have to pointlessly reparse the string every time around.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "nut_platform.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "timehead.h"
|
#include "timehead.h"
|
||||||
|
#include "nut_stdint.h"
|
||||||
#include "upslog.h"
|
#include "upslog.h"
|
||||||
|
|
||||||
static int port, reopen_flag = 0, exit_flag = 0;
|
static int reopen_flag = 0, exit_flag = 0;
|
||||||
|
static uint16_t port;
|
||||||
static char *upsname, *hostname;
|
static char *upsname, *hostname;
|
||||||
static UPSCONN_t ups;
|
static UPSCONN_t ups;
|
||||||
|
|
||||||
|
@ -76,6 +79,13 @@ static void set_exit_flag(int sig)
|
||||||
exit_flag = 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 */
|
/* handlers: reload on HUP, exit on INT/QUIT/TERM */
|
||||||
static void setup_signals(void)
|
static void setup_signals(void)
|
||||||
{
|
{
|
||||||
|
@ -96,8 +106,15 @@ static void setup_signals(void)
|
||||||
fatal_with_errno(EXIT_FAILURE, "Can't install SIGQUIT handler");
|
fatal_with_errno(EXIT_FAILURE, "Can't install SIGQUIT handler");
|
||||||
if (sigaction(SIGTERM, &sa, NULL) < 0)
|
if (sigaction(SIGTERM, &sa, NULL) < 0)
|
||||||
fatal_with_errno(EXIT_FAILURE, "Can't install SIGTERM handler");
|
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)
|
static void help(const char *prog)
|
||||||
{
|
{
|
||||||
printf("UPS status logger.\n");
|
printf("UPS status logger.\n");
|
||||||
|
@ -108,7 +125,9 @@ static void help(const char *prog)
|
||||||
printf(" -f <format> - Log format. See below for details.\n");
|
printf(" -f <format> - Log format. See below for details.\n");
|
||||||
printf(" - Use -f \"<format>\" so your shell doesn't break it up.\n");
|
printf(" - Use -f \"<format>\" so your shell doesn't break it up.\n");
|
||||||
printf(" -i <interval> - Time between updates, in seconds\n");
|
printf(" -i <interval> - Time between updates, in seconds\n");
|
||||||
printf(" -l <logfile> - Log file name, or - for stdout\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(" -p <pidbase> - Base name for PID file (defaults to \"%s\")\n", prog);
|
||||||
printf(" -s <ups> - Monitor UPS <ups> - <upsname>@<host>[:<port>]\n");
|
printf(" -s <ups> - Monitor UPS <ups> - <upsname>@<host>[:<port>]\n");
|
||||||
printf(" - Example: -s myups@server\n");
|
printf(" - Example: -s myups@server\n");
|
||||||
|
@ -136,6 +155,7 @@ static void do_host(const char *arg)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char hn[LARGEBUF];
|
char hn[LARGEBUF];
|
||||||
|
NUT_UNUSED_VARIABLE(arg);
|
||||||
|
|
||||||
ret = gethostname(hn, sizeof(hn));
|
ret = gethostname(hn, sizeof(hn));
|
||||||
|
|
||||||
|
@ -149,11 +169,15 @@ static void do_host(const char *arg)
|
||||||
|
|
||||||
static void do_upshost(const char *arg)
|
static void do_upshost(const char *arg)
|
||||||
{
|
{
|
||||||
|
NUT_UNUSED_VARIABLE(arg);
|
||||||
|
|
||||||
snprintfcat(logbuffer, sizeof(logbuffer), "%s", monhost);
|
snprintfcat(logbuffer, sizeof(logbuffer), "%s", monhost);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_pid(const char *arg)
|
static void do_pid(const char *arg)
|
||||||
{
|
{
|
||||||
|
NUT_UNUSED_VARIABLE(arg);
|
||||||
|
|
||||||
snprintfcat(logbuffer, sizeof(logbuffer), "%ld", (long)getpid());
|
snprintfcat(logbuffer, sizeof(logbuffer), "%ld", (long)getpid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,6 +186,7 @@ static void do_time(const char *arg)
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
char timebuf[SMALLBUF], *format;
|
char timebuf[SMALLBUF], *format;
|
||||||
time_t tod;
|
time_t tod;
|
||||||
|
struct tm tmbuf;
|
||||||
|
|
||||||
format = xstrdup(arg);
|
format = xstrdup(arg);
|
||||||
|
|
||||||
|
@ -171,7 +196,7 @@ static void do_time(const char *arg)
|
||||||
format[i] = '%';
|
format[i] = '%';
|
||||||
|
|
||||||
time(&tod);
|
time(&tod);
|
||||||
strftime(timebuf, sizeof(timebuf), format, localtime(&tod));
|
strftime(timebuf, sizeof(timebuf), format, localtime_r(&tod, &tmbuf));
|
||||||
|
|
||||||
snprintfcat(logbuffer, sizeof(logbuffer), "%s", timebuf);
|
snprintfcat(logbuffer, sizeof(logbuffer), "%s", timebuf);
|
||||||
|
|
||||||
|
@ -181,7 +206,7 @@ static void do_time(const char *arg)
|
||||||
static void getvar(const char *var)
|
static void getvar(const char *var)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -225,6 +250,7 @@ static void do_var(const char *arg)
|
||||||
static void do_etime(const char *arg)
|
static void do_etime(const char *arg)
|
||||||
{
|
{
|
||||||
time_t tod;
|
time_t tod;
|
||||||
|
NUT_UNUSED_VARIABLE(arg);
|
||||||
|
|
||||||
time(&tod);
|
time(&tod);
|
||||||
snprintfcat(logbuffer, sizeof(logbuffer), "%ld", (unsigned long) tod);
|
snprintfcat(logbuffer, sizeof(logbuffer), "%ld", (unsigned long) tod);
|
||||||
|
@ -259,7 +285,7 @@ static void add_call(void (*fptr)(const char *arg), const char *arg)
|
||||||
tmp->next = NULL;
|
tmp->next = NULL;
|
||||||
|
|
||||||
if (last)
|
if (last)
|
||||||
last->next = tmp;
|
last->next = tmp;
|
||||||
else
|
else
|
||||||
fhead = tmp;
|
fhead = tmp;
|
||||||
}
|
}
|
||||||
|
@ -267,8 +293,9 @@ static void add_call(void (*fptr)(const char *arg), const char *arg)
|
||||||
/* turn the format string into a list of function calls with args */
|
/* turn the format string into a list of function calls with args */
|
||||||
static void compile_format(void)
|
static void compile_format(void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
size_t i;
|
||||||
int j, found, ofs;
|
int j, found;
|
||||||
|
size_t ofs;
|
||||||
char *cmd, *arg, *ptr;
|
char *cmd, *arg, *ptr;
|
||||||
|
|
||||||
for (i = 0; i < strlen(logformat); i++) {
|
for (i = 0; i < strlen(logformat); i++) {
|
||||||
|
@ -320,7 +347,7 @@ static void compile_format(void)
|
||||||
/* see if we know how to handle this command */
|
/* see if we know how to handle this command */
|
||||||
|
|
||||||
for (j = 0; logcmds[j].name != NULL; j++) {
|
for (j = 0; logcmds[j].name != NULL; j++) {
|
||||||
if (strncasecmp(cmd, logcmds[j].name,
|
if (strncasecmp(cmd, logcmds[j].name,
|
||||||
strlen(logcmds[j].name)) == 0) {
|
strlen(logcmds[j].name)) == 0) {
|
||||||
|
|
||||||
add_call(logcmds[j].func, arg);
|
add_call(logcmds[j].func, arg);
|
||||||
|
@ -368,7 +395,7 @@ static void run_flist(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int interval = 30, i;
|
int interval = 30, i, foreground = -1;
|
||||||
const char *prog = xbasename(argv[0]);
|
const char *prog = xbasename(argv[0]);
|
||||||
time_t now, nextpoll = 0;
|
time_t now, nextpoll = 0;
|
||||||
const char *user = NULL;
|
const char *user = NULL;
|
||||||
|
@ -380,11 +407,13 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
|
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
|
||||||
|
|
||||||
while ((i = getopt(argc, argv, "+hs:l:i:f:u:Vp:")) != -1) {
|
while ((i = getopt(argc, argv, "+hs:l:i:f:u:Vp:FB")) != -1) {
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case 'h':
|
case 'h':
|
||||||
help(prog);
|
help(prog);
|
||||||
|
#ifndef HAVE___ATTRIBUTE__NORETURN
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
monhost = optarg;
|
monhost = optarg;
|
||||||
|
@ -412,6 +441,14 @@ int main(int argc, char **argv)
|
||||||
case 'p':
|
case 'p':
|
||||||
pidfilebase = optarg;
|
pidfilebase = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'F':
|
||||||
|
foreground = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'B':
|
||||||
|
foreground = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +489,7 @@ int main(int argc, char **argv)
|
||||||
if (!logformat)
|
if (!logformat)
|
||||||
fatalx(EXIT_FAILURE, "No format defined - but this should be impossible");
|
fatalx(EXIT_FAILURE, "No format defined - but this should be impossible");
|
||||||
|
|
||||||
printf("logging status of %s to %s (%is intervals)\n",
|
printf("logging status of %s to %s (%is intervals)\n",
|
||||||
monhost, logfn, interval);
|
monhost, logfn, interval);
|
||||||
|
|
||||||
if (upscli_splitname(monhost, &upsname, &hostname, &port) != 0) {
|
if (upscli_splitname(monhost, &upsname, &hostname, &port) != 0) {
|
||||||
|
@ -460,7 +497,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upscli_connect(&ups, hostname, port, UPSCLI_CONN_TRYSSL) < 0)
|
if (upscli_connect(&ups, hostname, port, UPSCLI_CONN_TRYSSL) < 0)
|
||||||
fprintf(stderr, "Warning: initial connect failed: %s\n",
|
fprintf(stderr, "Warning: initial connect failed: %s\n",
|
||||||
upscli_strerror(&ups));
|
upscli_strerror(&ups));
|
||||||
|
|
||||||
if (strcmp(logfn, "-") == 0)
|
if (strcmp(logfn, "-") == 0)
|
||||||
|
@ -474,10 +511,19 @@ int main(int argc, char **argv)
|
||||||
/* now drop root if we have it */
|
/* now drop root if we have it */
|
||||||
new_uid = get_user_pwent(user);
|
new_uid = get_user_pwent(user);
|
||||||
|
|
||||||
open_syslog(prog);
|
open_syslog(prog);
|
||||||
|
|
||||||
if (logfile != stdout)
|
if (foreground < 0) {
|
||||||
|
if (logfile == stdout) {
|
||||||
|
foreground = 1;
|
||||||
|
} else {
|
||||||
|
foreground = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foreground) {
|
||||||
background();
|
background();
|
||||||
|
}
|
||||||
|
|
||||||
setup_signals();
|
setup_signals();
|
||||||
|
|
||||||
|
@ -492,7 +538,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
if (nextpoll > now) {
|
if (nextpoll > now) {
|
||||||
/* there is still time left, so sleep it off */
|
/* there is still time left, so sleep it off */
|
||||||
sleep(difftime(nextpoll, now));
|
sleep((unsigned int)(difftime(nextpoll, now)));
|
||||||
nextpoll += interval;
|
nextpoll += interval;
|
||||||
} else {
|
} else {
|
||||||
/* we spent more time in polling than the interval allows */
|
/* we spent more time in polling than the interval allows */
|
||||||
|
@ -500,7 +546,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reopen_flag) {
|
if (reopen_flag) {
|
||||||
upslogx(LOG_INFO, "Signal %d: reopening log file",
|
upslogx(LOG_INFO, "Signal %d: reopening log file",
|
||||||
reopen_flag);
|
reopen_flag);
|
||||||
reopen_log();
|
reopen_log();
|
||||||
reopen_flag = 0;
|
reopen_flag = 0;
|
||||||
|
@ -525,6 +571,14 @@ int main(int argc, char **argv)
|
||||||
fclose(logfile);
|
fclose(logfile);
|
||||||
|
|
||||||
upscli_disconnect(&ups);
|
upscli_disconnect(&ups);
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
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,5 +1,14 @@
|
||||||
/* upslog.h - table of functions for handling various logging functions */
|
/* 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 */
|
/* function list */
|
||||||
typedef struct flist_s {
|
typedef struct flist_s {
|
||||||
void (*fptr)(const char *arg);
|
void (*fptr)(const char *arg);
|
||||||
|
@ -14,7 +23,10 @@ static void do_time(const char *arg);
|
||||||
static void do_var(const char *arg);
|
static void do_var(const char *arg);
|
||||||
static void do_etime(const char *arg);
|
static void do_etime(const char *arg);
|
||||||
|
|
||||||
struct {
|
/* This is only used in upslog.c, but refers to routines declared here...
|
||||||
|
* To move or not to move?..
|
||||||
|
*/
|
||||||
|
static struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
void (*func)(const char *arg);
|
void (*func)(const char *arg);
|
||||||
} logcmds[] =
|
} logcmds[] =
|
||||||
|
@ -25,5 +37,13 @@ struct {
|
||||||
{ "TIME", do_time },
|
{ "TIME", do_time },
|
||||||
{ "VAR", do_var },
|
{ "VAR", do_var },
|
||||||
{ "ETIME", do_etime },
|
{ "ETIME", do_etime },
|
||||||
{ NULL, (void(*)())(NULL) }
|
{ NULL, (void(*)(const char*))(NULL) }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_UPSLOG_H_SEEN */
|
||||||
|
|
671
clients/upsmon.c
671
clients/upsmon.c
File diff suppressed because it is too large
Load diff
|
@ -17,18 +17,29 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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 */
|
/* flags for ups->status */
|
||||||
|
|
||||||
#define ST_ONLINE (1 << 0) /* UPS is on line (OL) */
|
#define ST_ONLINE (1 << 0) /* UPS is on line (OL) */
|
||||||
#define ST_ONBATT (1 << 1) /* UPS is on battery (OB) */
|
#define ST_ONBATT (1 << 1) /* UPS is on battery (OB) */
|
||||||
#define ST_LOWBATT (1 << 2) /* UPS has a low battery (LB) */
|
#define ST_LOWBATT (1 << 2) /* UPS has a low battery (LB) */
|
||||||
#define ST_FSD (1 << 3) /* master has set forced shutdown flag */
|
#define ST_FSD (1 << 3) /* primary has set forced shutdown flag */
|
||||||
#define ST_MASTER (1 << 4) /* we are the master on this UPS */
|
#define ST_PRIMARY (1 << 4) /* we are the primary (manager) of this UPS */
|
||||||
#define ST_LOGIN (1 << 5) /* we are logged into this UPS */
|
#define ST_MASTER ST_PRIMARY /* legacy alias */
|
||||||
#define ST_CONNECTED (1 << 6) /* upscli_connect returned OK */
|
#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) */
|
||||||
|
|
||||||
/* required contents of flag file */
|
/* required contents of flag file */
|
||||||
#define SDMAGIC "upsmon-shutdown-file"
|
#define SDMAGIC "upsmon-shutdown-file"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
extern "C" {
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* UPS tracking structure */
|
/* UPS tracking structure */
|
||||||
|
|
||||||
|
@ -38,9 +49,9 @@ typedef struct {
|
||||||
char *sys; /* raw system name from .conf */
|
char *sys; /* raw system name from .conf */
|
||||||
char *upsname; /* just upsname */
|
char *upsname; /* just upsname */
|
||||||
char *hostname; /* just hostname */
|
char *hostname; /* just hostname */
|
||||||
int port; /* just the port */
|
uint16_t port; /* just the port */
|
||||||
|
|
||||||
int pv; /* power value from conf */
|
unsigned int pv; /* power value from conf */
|
||||||
char *un; /* username (optional for now) */
|
char *un; /* username (optional for now) */
|
||||||
char *pw; /* password from conf */
|
char *pw; /* password from conf */
|
||||||
int status; /* status (see flags above) */
|
int status; /* status (see flags above) */
|
||||||
|
@ -59,16 +70,17 @@ typedef struct {
|
||||||
|
|
||||||
/* notify identifiers */
|
/* notify identifiers */
|
||||||
|
|
||||||
#define NOTIFY_ONLINE 0 /* UPS went on-line */
|
#define NOTIFY_ONLINE 0 /* UPS went on-line */
|
||||||
#define NOTIFY_ONBATT 1 /* UPS went on battery */
|
#define NOTIFY_ONBATT 1 /* UPS went on battery */
|
||||||
#define NOTIFY_LOWBATT 2 /* UPS went to low battery */
|
#define NOTIFY_LOWBATT 2 /* UPS went to low battery */
|
||||||
#define NOTIFY_FSD 3 /* Master upsmon set FSD flag */
|
#define NOTIFY_FSD 3 /* Primary upsmon set FSD flag */
|
||||||
#define NOTIFY_COMMOK 4 /* Communication established */
|
#define NOTIFY_COMMOK 4 /* Communication established */
|
||||||
#define NOTIFY_COMMBAD 5 /* Communication lost */
|
#define NOTIFY_COMMBAD 5 /* Communication lost */
|
||||||
#define NOTIFY_SHUTDOWN 6 /* System shutdown in progress */
|
#define NOTIFY_SHUTDOWN 6 /* System shutdown in progress */
|
||||||
#define NOTIFY_REPLBATT 7 /* UPS battery needs to be replaced */
|
#define NOTIFY_REPLBATT 7 /* UPS battery needs to be replaced */
|
||||||
#define NOTIFY_NOCOMM 8 /* UPS hasn't been contacted in awhile */
|
#define NOTIFY_NOCOMM 8 /* UPS hasn't been contacted in a while */
|
||||||
#define NOTIFY_NOPARENT 9 /* privileged parent process died */
|
#define NOTIFY_NOPARENT 9 /* privileged parent process died */
|
||||||
|
#define NOTIFY_CAL 10 /* UPS is performing calibration */
|
||||||
|
|
||||||
/* notify flag values */
|
/* notify flag values */
|
||||||
|
|
||||||
|
@ -80,7 +92,10 @@ typedef struct {
|
||||||
/* flags are set to NOTIFY_SYSLOG | NOTIFY_WALL at program init */
|
/* flags are set to NOTIFY_SYSLOG | NOTIFY_WALL at program init */
|
||||||
/* the user can override with NOTIFYFLAGS in the upsmon.conf */
|
/* the user can override with NOTIFYFLAGS in the upsmon.conf */
|
||||||
|
|
||||||
struct {
|
/* This is only used in upsmon.c, but might it also have external consumers?..
|
||||||
|
* To move or not to move?..
|
||||||
|
*/
|
||||||
|
static struct {
|
||||||
int type;
|
int type;
|
||||||
const char *name;
|
const char *name;
|
||||||
char *msg; /* NULL until overridden */
|
char *msg; /* NULL until overridden */
|
||||||
|
@ -98,6 +113,7 @@ struct {
|
||||||
{ NOTIFY_REPLBATT, "REPLBATT", NULL, "UPS %s battery needs to be replaced", NOTIFY_SYSLOG | NOTIFY_WALL },
|
{ 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_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_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 }
|
{ 0, NULL, NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,3 +126,11 @@ struct {
|
||||||
/* various constants */
|
/* various constants */
|
||||||
|
|
||||||
#define NET_TIMEOUT 10 /* wait 10 seconds max for upsd to respond */
|
#define NET_TIMEOUT 10 /* wait 10 seconds max for upsd to respond */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_UPSMON_H_SEEN */
|
||||||
|
|
239
clients/upsrw.c
239
clients/upsrw.c
|
@ -1,6 +1,8 @@
|
||||||
/* upsrw - simple client for read/write variable access (formerly upsct2)
|
/* upsrw - simple client for read/write variable access (formerly upsct2)
|
||||||
|
|
||||||
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
|
Copyright (C)
|
||||||
|
1999 Russell Kroll <rkroll@exploits.org>
|
||||||
|
2019 EATON (author: Arnaud Quette <ArnaudQuette@eaton.com>)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -18,16 +20,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "nut_platform.h"
|
||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include "nut_stdint.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
|
#include "extstate.h"
|
||||||
|
|
||||||
static char *upsname = NULL, *hostname = NULL;
|
static char *upsname = NULL, *hostname = NULL;
|
||||||
static UPSCONN_t *ups = NULL;
|
static UPSCONN_t *ups = NULL;
|
||||||
|
static int tracking_enabled = 0;
|
||||||
|
static unsigned int timeout = DEFAULT_TRACKING_TIMEOUT;
|
||||||
|
|
||||||
struct list_t {
|
struct list_t {
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -38,18 +45,22 @@ static void usage(const char *prog)
|
||||||
{
|
{
|
||||||
printf("Network UPS Tools %s %s\n\n", prog, UPS_VERSION);
|
printf("Network UPS Tools %s %s\n\n", prog, UPS_VERSION);
|
||||||
printf("usage: %s [-h]\n", prog);
|
printf("usage: %s [-h]\n", prog);
|
||||||
printf(" %s [-s <variable>] [-u <username>] [-p <password>] <ups>\n\n", prog);
|
printf(" %s [-s <variable>] [-u <username>] [-p <password>] [-w] [-t <timeout>] <ups>\n\n", prog);
|
||||||
printf("Demo program to set variables within UPS hardware.\n");
|
printf("Demo program to set variables within UPS hardware.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf(" -h display this help text\n");
|
printf(" -h display this help text\n");
|
||||||
printf(" -s <variable> specify variable to be changed\n");
|
printf(" -s <variable> specify variable to be changed\n");
|
||||||
printf(" use -s VAR=VALUE to avoid prompting for value\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(" -u <username> set username for command authentication\n");
|
||||||
printf(" -p <password> set password 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("\n");
|
||||||
printf(" <ups> UPS identifier - <upsname>[@<hostname>[:<port>]]\n");
|
printf(" <ups> UPS identifier - <upsname>[@<hostname>[:<port>]]\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Call without -s to show all possible read/write variables.\n");
|
printf("Call without -s to show all possible read/write variables (same as -l).\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clean_exit(void)
|
static void clean_exit(void)
|
||||||
|
@ -63,9 +74,21 @@ static void clean_exit(void)
|
||||||
free(ups);
|
free(ups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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 void do_set(const char *varname, const char *newval)
|
||||||
{
|
{
|
||||||
|
int cmd_complete = 0;
|
||||||
char buf[SMALLBUF], enc[SMALLBUF];
|
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)));
|
||||||
|
|
||||||
|
@ -77,17 +100,92 @@ static void do_set(const char *varname, const char *newval)
|
||||||
fatalx(EXIT_FAILURE, "Set variable failed: %s", upscli_strerror(ups));
|
fatalx(EXIT_FAILURE, "Set variable failed: %s", upscli_strerror(ups));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FUTURE: status cookies will tie in here */
|
/* verify answer */
|
||||||
if (strncmp(buf, "OK", 2) != 0) {
|
if (strncmp(buf, "OK", 2) != 0) {
|
||||||
fatalx(EXIT_FAILURE, "Unexpected response from upsd: %s", buf);
|
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);
|
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 do_setvar(const char *varname, char *uin, const char *pass)
|
static void do_setvar(const char *varname, char *uin, const char *pass)
|
||||||
{
|
{
|
||||||
char newval[SMALLBUF], temp[SMALLBUF], user[SMALLBUF], *ptr;
|
char newval[SMALLBUF], temp[SMALLBUF * 2], user[SMALLBUF], *ptr;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
|
|
||||||
if (uin) {
|
if (uin) {
|
||||||
|
@ -176,13 +274,32 @@ static void do_setvar(const char *varname, char *uin, const char *pass)
|
||||||
fatalx(EXIT_FAILURE, "Error: old variable names are not supported");
|
fatalx(EXIT_FAILURE, "Error: old variable names are not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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);
|
do_set(varname, newval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *get_data(const char *type, const char *varname)
|
static const char *get_data(const char *type, const char *varname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
char **answer;
|
char **answer;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
|
|
||||||
|
@ -202,7 +319,7 @@ static const char *get_data(const char *type, const char *varname)
|
||||||
return answer[3];
|
return answer[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_string(const char *varname)
|
static void do_string(const char *varname, const long len)
|
||||||
{
|
{
|
||||||
const char *val;
|
const char *val;
|
||||||
|
|
||||||
|
@ -213,13 +330,34 @@ static void do_string(const char *varname)
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Type: STRING\n");
|
printf("Type: STRING\n");
|
||||||
|
printf("Maximum length: %ld\n", len);
|
||||||
printf("Value: %s\n", val);
|
printf("Value: %s\n", val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_enum(const char *varname)
|
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)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
char **answer, buf[SMALLBUF];
|
char **answer, buf[SMALLBUF];
|
||||||
const char *query[4], *val;
|
const char *query[4], *val;
|
||||||
|
|
||||||
|
@ -245,14 +383,21 @@ static void do_enum(const char *varname)
|
||||||
|
|
||||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||||
|
|
||||||
printf("Type: ENUM\n");
|
/* 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) {
|
while (ret == 1) {
|
||||||
|
|
||||||
/* ENUM <upsname> <varname> <value> */
|
/* ENUM <upsname> <varname> <value> */
|
||||||
|
|
||||||
if (numa < 4) {
|
if (numa < 4) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 4)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Option: \"%s\"", answer[3]);
|
printf("Option: \"%s\"", answer[3]);
|
||||||
|
@ -270,7 +415,7 @@ static void do_enum(const char *varname)
|
||||||
static void do_range(const char *varname)
|
static void do_range(const char *varname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
char **answer;
|
char **answer;
|
||||||
const char *query[4], *val;
|
const char *query[4], *val;
|
||||||
int ival, min, max;
|
int ival, min, max;
|
||||||
|
@ -297,14 +442,15 @@ static void do_range(const char *varname)
|
||||||
|
|
||||||
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
ret = upscli_list_next(ups, numq, query, &numa, &answer);
|
||||||
|
|
||||||
printf("Type: RANGE\n");
|
/* Ranges implies a type "NUMBER" */
|
||||||
|
printf("Type: RANGE NUMBER\n");
|
||||||
|
|
||||||
while (ret == 1) {
|
while (ret == 1) {
|
||||||
|
|
||||||
/* RANGE <upsname> <varname> <min> <max> */
|
/* RANGE <upsname> <varname> <min> <max> */
|
||||||
|
|
||||||
if (numa < 5) {
|
if (numa < 5) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 4)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
min = atoi(answer[3]);
|
min = atoi(answer[3]);
|
||||||
|
@ -325,7 +471,8 @@ static void do_range(const char *varname)
|
||||||
static void do_type(const char *varname)
|
static void do_type(const char *varname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int i, numq, numa;
|
int is_enum = 0; /* 1 if ENUM; FIXME: add a boolean type in common.h */
|
||||||
|
size_t i, numq, numa;
|
||||||
char **answer;
|
char **answer;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
|
|
||||||
|
@ -337,16 +484,18 @@ static void do_type(const char *varname)
|
||||||
ret = upscli_get(ups, numq, query, &numa, &answer);
|
ret = upscli_get(ups, numq, query, &numa, &answer);
|
||||||
|
|
||||||
if ((ret < 0) || (numa < numq)) {
|
if ((ret < 0) || (numa < numq)) {
|
||||||
printf("Unknown type\n");
|
printf("Unknown type\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TYPE <upsname> <varname> <type>... */
|
/* TYPE <upsname> <varname> <type>... */
|
||||||
for (i = 3; i < numa; i++) {
|
for (i = 3; i < numa; i++) {
|
||||||
|
|
||||||
|
/* ENUM can be NUMBER or STRING
|
||||||
|
* just flag it for latter processing */
|
||||||
if (!strcasecmp(answer[i], "ENUM")) {
|
if (!strcasecmp(answer[i], "ENUM")) {
|
||||||
do_enum(varname);
|
is_enum = 1;
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(answer[i], "RANGE")) {
|
if (!strcasecmp(answer[i], "RANGE")) {
|
||||||
|
@ -355,7 +504,23 @@ static void do_type(const char *varname)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncasecmp(answer[i], "STRING:", 7)) {
|
if (!strncasecmp(answer[i], "STRING:", 7)) {
|
||||||
do_string(varname);
|
|
||||||
|
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);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,6 +531,10 @@ static void do_type(const char *varname)
|
||||||
|
|
||||||
printf("Type: %s (unrecognized)\n", answer[i]);
|
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(const char *varname)
|
||||||
|
@ -390,7 +559,7 @@ static void print_rw(const char *varname)
|
||||||
static void print_rwlist(void)
|
static void print_rwlist(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[2];
|
const char *query[2];
|
||||||
char **answer;
|
char **answer;
|
||||||
struct list_t *lhead, *llast, *ltmp, *lnext;
|
struct list_t *lhead, *llast, *ltmp, *lnext;
|
||||||
|
@ -424,7 +593,7 @@ static void print_rwlist(void)
|
||||||
|
|
||||||
/* RW <upsname> <varname> <value> */
|
/* RW <upsname> <varname> <value> */
|
||||||
if (numa < 4) {
|
if (numa < 4) {
|
||||||
fatalx(EXIT_FAILURE, "Error: insufficient data (got %d args, need at least 4)", numa);
|
fatalx(EXIT_FAILURE, "Error: insufficient data (got %zu args, need at least 4)", numa);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sock this entry away for later */
|
/* sock this entry away for later */
|
||||||
|
@ -461,22 +630,36 @@ static void print_rwlist(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, port;
|
int i;
|
||||||
|
uint16_t port;
|
||||||
const char *prog = xbasename(argv[0]);
|
const char *prog = xbasename(argv[0]);
|
||||||
char *password = NULL, *username = NULL, *setvar = NULL;
|
char *password = NULL, *username = NULL, *setvar = NULL;
|
||||||
|
|
||||||
while ((i = getopt(argc, argv, "+hs:p:u:V")) != -1) {
|
while ((i = getopt(argc, argv, "+hls:p:t:u:wV")) != -1) {
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 's':
|
case 's':
|
||||||
setvar = optarg;
|
setvar = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
if (setvar) {
|
||||||
|
upslogx(LOG_WARNING, "Listing mode requested, overriding setvar specified earlier!");
|
||||||
|
setvar = NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
password = optarg;
|
password = optarg;
|
||||||
break;
|
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':
|
case 'u':
|
||||||
username = optarg;
|
username = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'w':
|
||||||
|
tracking_enabled = 1;
|
||||||
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
|
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
@ -518,3 +701,11 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
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) */
|
||||||
|
|
|
@ -11,8 +11,19 @@
|
||||||
# from your AT lines.
|
# from your AT lines.
|
||||||
|
|
||||||
case $1 in
|
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)
|
upsgone)
|
||||||
logger -t upssched-cmd "The UPS has been gone for awhile"
|
logger -t upssched-cmd "The communication with UPS has been gone for awhile"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
logger -t upssched-cmd "Unrecognized command: $1"
|
logger -t upssched-cmd "Unrecognized command: $1"
|
||||||
|
|
|
@ -46,9 +46,12 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "upssched.h"
|
#include "upssched.h"
|
||||||
#include "timehead.h"
|
#include "timehead.h"
|
||||||
|
#include "nut_stdint.h"
|
||||||
|
|
||||||
typedef struct ttype_s {
|
typedef struct ttype_s {
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -56,14 +59,13 @@ typedef struct ttype_s {
|
||||||
struct ttype_s *next;
|
struct ttype_s *next;
|
||||||
} ttype_t;
|
} ttype_t;
|
||||||
|
|
||||||
ttype_t *thead = NULL;
|
static ttype_t *thead = NULL;
|
||||||
static conn_t *connhead = NULL;
|
static conn_t *connhead = NULL;
|
||||||
char *cmdscript = NULL, *pipefn = NULL, *lockfn = NULL;
|
static char *cmdscript = NULL, *pipefn = NULL, *lockfn = NULL;
|
||||||
int verbose = 0; /* use for debugging */
|
static int verbose = 0; /* use for debugging */
|
||||||
|
|
||||||
|
/* ups name and notify type (string) as received from upsmon */
|
||||||
/* ups name and notify type (string) as received from upsmon */
|
static const char *upsname, *notify_type;
|
||||||
const char *upsname, *notify_type;
|
|
||||||
|
|
||||||
#define PARENT_STARTED -2
|
#define PARENT_STARTED -2
|
||||||
#define PARENT_UNNECESSARY -3
|
#define PARENT_UNNECESSARY -3
|
||||||
|
@ -179,7 +181,7 @@ static void checktimers(void)
|
||||||
static void start_timer(const char *name, const char *ofsstr)
|
static void start_timer(const char *name, const char *ofsstr)
|
||||||
{
|
{
|
||||||
time_t now;
|
time_t now;
|
||||||
int ofs;
|
long ofs;
|
||||||
ttype_t *tmp, *last;
|
ttype_t *tmp, *last;
|
||||||
|
|
||||||
/* get the time */
|
/* get the time */
|
||||||
|
@ -194,7 +196,7 @@ static void start_timer(const char *name, const char *ofsstr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
upslogx(LOG_INFO, "New timer: %s (%d seconds)", name, ofs);
|
upslogx(LOG_INFO, "New timer: %s (%ld seconds)", name, ofs);
|
||||||
|
|
||||||
/* now add to the queue */
|
/* now add to the queue */
|
||||||
tmp = last = thead;
|
tmp = last = thead;
|
||||||
|
@ -240,7 +242,7 @@ static void cancel_timer(const char *name, const char *cname)
|
||||||
static void us_serialize(int op)
|
static void us_serialize(int op)
|
||||||
{
|
{
|
||||||
static int pipefd[2];
|
static int pipefd[2];
|
||||||
int ret;
|
ssize_t ret;
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
switch(op) {
|
switch(op) {
|
||||||
|
@ -270,6 +272,7 @@ static int open_sock(void)
|
||||||
int ret, fd;
|
int ret, fd;
|
||||||
struct sockaddr_un ssaddr;
|
struct sockaddr_un ssaddr;
|
||||||
|
|
||||||
|
check_unix_socket_filename(pipefn);
|
||||||
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
@ -297,6 +300,9 @@ static int open_sock(void)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
fatal_with_errno(EXIT_FAILURE, "listen(%d, %d) failed", fd, US_LISTEN_BACKLOG);
|
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;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,17 +335,40 @@ static void conn_del(conn_t *target)
|
||||||
|
|
||||||
static int send_to_one(conn_t *conn, const char *fmt, ...)
|
static int send_to_one(conn_t *conn, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
int ret;
|
ssize_t ret;
|
||||||
|
size_t buflen;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
char buf[US_SOCK_BUF_LEN];
|
char buf[US_SOCK_BUF_LEN];
|
||||||
|
|
||||||
va_start(ap, fmt);
|
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);
|
vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
ret = write(conn->fd, buf, strlen(buf));
|
buflen = strlen(buf);
|
||||||
|
if (buflen >= SSIZE_MAX) {
|
||||||
|
/* Can't compare buflen to ret */
|
||||||
|
upsdebugx(2, "send_to_one(): buffered message too large");
|
||||||
|
|
||||||
if ((ret < 1) || (ret != (int) strlen(buf))) {
|
close(conn->fd);
|
||||||
|
conn_del(conn);
|
||||||
|
|
||||||
|
return 0; /* failed */
|
||||||
|
}
|
||||||
|
ret = write(conn->fd, buf, buflen);
|
||||||
|
|
||||||
|
if ((ret < 1) || (ret != (ssize_t) buflen)) {
|
||||||
upsdebugx(2, "write to fd %d failed", conn->fd);
|
upsdebugx(2, "write to fd %d failed", conn->fd);
|
||||||
|
|
||||||
close(conn->fd);
|
close(conn->fd);
|
||||||
|
@ -356,7 +385,7 @@ static void conn_add(int sockfd)
|
||||||
int acc, ret;
|
int acc, ret;
|
||||||
conn_t *tmp, *last;
|
conn_t *tmp, *last;
|
||||||
struct sockaddr_un saddr;
|
struct sockaddr_un saddr;
|
||||||
#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
|
#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
|
||||||
int salen;
|
int salen;
|
||||||
#else
|
#else
|
||||||
socklen_t salen;
|
socklen_t salen;
|
||||||
|
@ -370,6 +399,9 @@ static void conn_add(int sockfd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* don't leak connection to CMDSCRIPT */
|
||||||
|
fcntl(acc, F_SETFD, FD_CLOEXEC);
|
||||||
|
|
||||||
/* enable nonblocking I/O */
|
/* enable nonblocking I/O */
|
||||||
|
|
||||||
ret = fcntl(acc, F_GETFL, 0);
|
ret = fcntl(acc, F_GETFL, 0);
|
||||||
|
@ -440,19 +472,20 @@ static int sock_arg(conn_t *conn)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void log_unknown(int numarg, char **arg)
|
static void log_unknown(size_t numarg, char **arg)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
upslogx(LOG_INFO, "Unknown command on socket: ");
|
upslogx(LOG_INFO, "Unknown command on socket: ");
|
||||||
|
|
||||||
for (i = 0; i < numarg; i++)
|
for (i = 0; i < numarg; i++)
|
||||||
upslogx(LOG_INFO, "arg %d: %s", i, arg[i]);
|
upslogx(LOG_INFO, "arg %zu: %s", i, arg[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sock_read(conn_t *conn)
|
static int sock_read(conn_t *conn)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i;
|
||||||
|
ssize_t ret;
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
for (i = 0; i < US_MAX_READ; i++) {
|
for (i = 0; i < US_MAX_READ; i++) {
|
||||||
|
@ -465,13 +498,19 @@ static int sock_read(conn_t *conn)
|
||||||
if ((ret == -1) && (errno == EAGAIN))
|
if ((ret == -1) && (errno == EAGAIN))
|
||||||
return 0;
|
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 */
|
/* some other problem */
|
||||||
return -1; /* error */
|
return -1; /* error */
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = pconf_char(&conn->ctx, ch);
|
ret = pconf_char(&conn->ctx, ch);
|
||||||
|
|
||||||
if (ret == 0) /* nothing to parse yet */
|
if (ret == 0) /* nothing to parse yet */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
@ -594,6 +633,8 @@ static int try_connect(void)
|
||||||
int pipefd, ret;
|
int pipefd, ret;
|
||||||
struct sockaddr_un saddr;
|
struct sockaddr_un saddr;
|
||||||
|
|
||||||
|
check_unix_socket_filename(pipefn);
|
||||||
|
|
||||||
memset(&saddr, '\0', sizeof(saddr));
|
memset(&saddr, '\0', sizeof(saddr));
|
||||||
saddr.sun_family = AF_UNIX;
|
saddr.sun_family = AF_UNIX;
|
||||||
snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s", pipefn);
|
snprintf(saddr.sun_path, sizeof(saddr.sun_path), "%s", pipefn);
|
||||||
|
@ -659,28 +700,15 @@ static int check_parent(const char *cmd, const char *arg2)
|
||||||
exit(EXIT_FAILURE);
|
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)
|
static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
||||||
{
|
{
|
||||||
int i, pipefd, ret;
|
int i, pipefd;
|
||||||
char buf[SMALLBUF], enc[SMALLBUF];
|
ssize_t ret;
|
||||||
|
size_t enclen, buflen;
|
||||||
|
char buf[SMALLBUF], enc[SMALLBUF + 8];
|
||||||
|
int ret_s;
|
||||||
|
struct timeval tv;
|
||||||
|
fd_set fdread;
|
||||||
|
|
||||||
/* insanity */
|
/* insanity */
|
||||||
if (!arg1)
|
if (!arg1)
|
||||||
|
@ -694,7 +722,15 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
||||||
snprintfcat(buf, sizeof(buf), " \"%s\"",
|
snprintfcat(buf, sizeof(buf), " \"%s\"",
|
||||||
pconf_encode(arg2, enc, sizeof(enc)));
|
pconf_encode(arg2, enc, sizeof(enc)));
|
||||||
|
|
||||||
snprintfcat(enc, sizeof(enc), "%s\n", buf);
|
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");
|
||||||
|
}
|
||||||
|
|
||||||
/* see if the parent needs to be started (and maybe start it) */
|
/* see if the parent needs to be started (and maybe start it) */
|
||||||
|
|
||||||
|
@ -703,7 +739,6 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
||||||
pipefd = check_parent(cmd, arg2);
|
pipefd = check_parent(cmd, arg2);
|
||||||
|
|
||||||
if (pipefd == PARENT_STARTED) {
|
if (pipefd == PARENT_STARTED) {
|
||||||
|
|
||||||
/* loop back and try to connect now */
|
/* loop back and try to connect now */
|
||||||
usleep(250000);
|
usleep(250000);
|
||||||
continue;
|
continue;
|
||||||
|
@ -715,23 +750,41 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
||||||
|
|
||||||
/* we're connected now */
|
/* we're connected now */
|
||||||
|
|
||||||
ret = write(pipefd, enc, strlen(enc));
|
ret = write(pipefd, enc, enclen);
|
||||||
|
|
||||||
/* if we can't send the whole thing, loop back and try again */
|
/* if we can't send the whole thing, loop back and try again */
|
||||||
if ((ret < 1) || (ret != (int) strlen(enc))) {
|
if ((ret < 1) || (ret != (ssize_t)enclen)) {
|
||||||
upslogx(LOG_ERR, "write failed, trying again");
|
upslogx(LOG_ERR, "write failed, trying again");
|
||||||
close(pipefd);
|
close(pipefd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ugh - probably should use select here... */
|
/* select on child's pipe fd */
|
||||||
setup_sigalrm();
|
do {
|
||||||
|
/* set timeout every time before call select() */
|
||||||
|
tv.tv_sec = 1;
|
||||||
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
alarm(2);
|
FD_ZERO(&fdread);
|
||||||
ret = read(pipefd, buf, sizeof(buf));
|
FD_SET(pipefd, &fdread);
|
||||||
alarm(0);
|
|
||||||
|
|
||||||
signal(SIGALRM, SIG_IGN);
|
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:
|
||||||
|
ret = read(pipefd, buf, sizeof(buf));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} while (ret_s <= 0);
|
||||||
|
|
||||||
close(pipefd);
|
close(pipefd);
|
||||||
|
|
||||||
|
@ -747,7 +800,7 @@ static void sendcmd(const char *cmd, const char *arg1, const char *arg2)
|
||||||
upslogx(LOG_ERR, "read confirmation got [%s]", buf);
|
upslogx(LOG_ERR, "read confirmation got [%s]", buf);
|
||||||
|
|
||||||
/* try again ... */
|
/* try again ... */
|
||||||
}
|
} /* loop until MAX_TRIES if no success above */
|
||||||
|
|
||||||
fatalx(EXIT_FAILURE, "Unable to connect to daemon and unable to start daemon");
|
fatalx(EXIT_FAILURE, "Unable to connect to daemon and unable to start daemon");
|
||||||
}
|
}
|
||||||
|
@ -794,7 +847,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(cmd, "EXECUTE")) {
|
if (!strcmp(cmd, "EXECUTE")) {
|
||||||
if (ca1 == '\0') {
|
if (ca1[0] == '\0') {
|
||||||
upslogx(LOG_ERR, "Empty EXECUTE command argument");
|
upslogx(LOG_ERR, "Empty EXECUTE command argument");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -809,7 +862,7 @@ static void parse_at(const char *ntype, const char *un, const char *cmd,
|
||||||
upslogx(LOG_ERR, "Invalid command: %s", cmd);
|
upslogx(LOG_ERR, "Invalid command: %s", cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int conf_arg(int numargs, char **arg)
|
static int conf_arg(size_t numargs, char **arg)
|
||||||
{
|
{
|
||||||
if (numargs < 2)
|
if (numargs < 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -900,9 +953,15 @@ static void checkconf(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *prog = xbasename(argv[0]);
|
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 */
|
verbose = 1; /* TODO: remove when done testing, or add -D */
|
||||||
|
|
||||||
/* normally we don't have stderr, so get this going to syslog early */
|
/* normally we don't have stderr, so get this going to syslog early */
|
||||||
open_syslog(prog);
|
open_syslog(prog);
|
||||||
|
|
|
@ -1,14 +1,31 @@
|
||||||
/* upssched.h - supporting structures */
|
/* upssched.h - supporting structures */
|
||||||
|
|
||||||
|
#ifndef NUT_UPSSCHED_H_SEEN
|
||||||
|
#define NUT_UPSSCHED_H_SEEN 1
|
||||||
|
|
||||||
#include <parseconf.h>
|
#include <parseconf.h>
|
||||||
|
|
||||||
#define SERIALIZE_INIT 1
|
#define SERIALIZE_INIT 1
|
||||||
#define SERIALIZE_SET 2
|
#define SERIALIZE_SET 2
|
||||||
#define SERIALIZE_WAIT 3
|
#define SERIALIZE_WAIT 3
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
extern "C" {
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* track client connections */
|
/* track client connections */
|
||||||
typedef struct conn_s {
|
typedef struct conn_s {
|
||||||
int fd;
|
int fd;
|
||||||
PCONF_CTX_t ctx;
|
PCONF_CTX_t ctx;
|
||||||
struct conn_s *next;
|
struct conn_s *next;
|
||||||
} conn_t;
|
} conn_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_UPSSCHED_H_SEEN */
|
||||||
|
|
118
clients/upsset.c
118
clients/upsset.c
|
@ -24,6 +24,7 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include "nut_stdint.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
#include "cgilib.h"
|
#include "cgilib.h"
|
||||||
#include "parseconf.h"
|
#include "parseconf.h"
|
||||||
|
@ -39,12 +40,12 @@ struct list_t {
|
||||||
#define HARD_UPSVAR_LIMIT_NUM 64
|
#define HARD_UPSVAR_LIMIT_NUM 64
|
||||||
#define HARD_UPSVAR_LIMIT_LEN 256
|
#define HARD_UPSVAR_LIMIT_LEN 256
|
||||||
|
|
||||||
char *monups, *username, *password, *function, *upscommand;
|
static char *monups, *username, *password, *function, *upscommand;
|
||||||
|
|
||||||
/* set once the MAGIC_ENABLE_STRING is found in the upsset.conf */
|
/* set once the MAGIC_ENABLE_STRING is found in the upsset.conf */
|
||||||
int magic_string_set = 0;
|
static int magic_string_set = 0;
|
||||||
|
|
||||||
static int port;
|
static uint16_t port;
|
||||||
static char *upsname, *hostname;
|
static char *upsname, *hostname;
|
||||||
static UPSCONN_t ups;
|
static UPSCONN_t ups;
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ typedef struct {
|
||||||
void *next;
|
void *next;
|
||||||
} uvtype_t;
|
} uvtype_t;
|
||||||
|
|
||||||
uvtype_t *firstuv = NULL;
|
static uvtype_t *firstuv = NULL;
|
||||||
|
|
||||||
void parsearg(char *var, char *value)
|
void parsearg(char *var, char *value)
|
||||||
{
|
{
|
||||||
|
@ -134,7 +135,7 @@ static void do_header(const char *title)
|
||||||
printf("<HTML>\n");
|
printf("<HTML>\n");
|
||||||
printf("<HEAD><TITLE>upsset: %s</TITLE></HEAD>\n", title);
|
printf("<HEAD><TITLE>upsset: %s</TITLE></HEAD>\n", title);
|
||||||
|
|
||||||
printf("<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#0000EE\" VLINK=\"#551A8B\">\n");
|
printf("<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#0000EE\" VLINK=\"#551A8B\">\n");
|
||||||
|
|
||||||
printf("<TABLE BGCOLOR=\"#50A0A0\" ALIGN=\"CENTER\">\n");
|
printf("<TABLE BGCOLOR=\"#50A0A0\" ALIGN=\"CENTER\">\n");
|
||||||
printf("<TR><TD>\n");
|
printf("<TR><TD>\n");
|
||||||
|
@ -144,7 +145,7 @@ static void start_table(void)
|
||||||
{
|
{
|
||||||
printf("<TABLE CELLPADDING=\"5\" CELLSPACING=\"0\" ALIGN=\"CENTER\" WIDTH=\"100%%\">\n");
|
printf("<TABLE CELLPADDING=\"5\" CELLSPACING=\"0\" ALIGN=\"CENTER\" WIDTH=\"100%%\">\n");
|
||||||
printf("<TR><TH COLSPAN=2 BGCOLOR=\"#60B0B0\">\n");
|
printf("<TR><TH COLSPAN=2 BGCOLOR=\"#60B0B0\">\n");
|
||||||
printf("<FONT SIZE=\"+2\">Network UPS Tools upsset %s</FONT>\n",
|
printf("<FONT SIZE=\"+2\">Network UPS Tools upsset %s</FONT>\n",
|
||||||
UPS_VERSION);
|
UPS_VERSION);
|
||||||
printf("</TH></TR>\n");
|
printf("</TH></TR>\n");
|
||||||
}
|
}
|
||||||
|
@ -158,12 +159,12 @@ static void do_hidden(const char *next)
|
||||||
password);
|
password);
|
||||||
|
|
||||||
if (next)
|
if (next)
|
||||||
printf("<INPUT TYPE=\"HIDDEN\" NAME=\"function\" VALUE=\"%s\">\n",
|
printf("<INPUT TYPE=\"HIDDEN\" NAME=\"function\" VALUE=\"%s\">\n",
|
||||||
next);
|
next);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate SELECT chooser from hosts.conf entries */
|
/* generate SELECT chooser from hosts.conf entries */
|
||||||
static void upslist_arg(int numargs, char **arg)
|
static void upslist_arg(size_t numargs, char **arg)
|
||||||
{
|
{
|
||||||
if (numargs < 3)
|
if (numargs < 3)
|
||||||
return;
|
return;
|
||||||
|
@ -222,7 +223,7 @@ static void do_pickups(const char *currfunc)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
upslist_arg(ctx.numargs, ctx.arglist);
|
upslist_arg(ctx.numargs, ctx.arglist);
|
||||||
}
|
}
|
||||||
|
|
||||||
pconf_finish(&ctx);
|
pconf_finish(&ctx);
|
||||||
|
@ -253,6 +254,10 @@ static void do_pickups(const char *currfunc)
|
||||||
printf("</FORM>\n");
|
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,
|
static void error_page(const char *next, const char *title,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -260,7 +265,19 @@ static void error_page(const char *next, const char *title,
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
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);
|
vsnprintf(msg, sizeof(msg), fmt, ap);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
do_header(title);
|
do_header(title);
|
||||||
|
@ -282,6 +299,9 @@ static void error_page(const char *next, const char *title,
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void loginscreen(void)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void loginscreen(void)
|
static void loginscreen(void)
|
||||||
{
|
{
|
||||||
do_header("Login");
|
do_header("Login");
|
||||||
|
@ -331,7 +351,7 @@ static void upsd_connect(void)
|
||||||
static void print_cmd(const char *cmd)
|
static void print_cmd(const char *cmd)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
char **answer;
|
char **answer;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
|
|
||||||
|
@ -354,7 +374,7 @@ static void print_cmd(const char *cmd)
|
||||||
static void showcmds(void)
|
static void showcmds(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[2];
|
const char *query[2];
|
||||||
char **answer;
|
char **answer;
|
||||||
struct list_t *lhead, *llast, *ltmp, *lnext;
|
struct list_t *lhead, *llast, *ltmp, *lnext;
|
||||||
|
@ -391,7 +411,7 @@ static void showcmds(void)
|
||||||
/* CMD upsname cmdname */
|
/* CMD upsname cmdname */
|
||||||
if (numa < 3) {
|
if (numa < 3) {
|
||||||
fprintf(stderr, "Error: insufficient data "
|
fprintf(stderr, "Error: insufficient data "
|
||||||
"(got %d args, need at least 3)\n", numa);
|
"(got %zu args, need at least 3)\n", numa);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -466,7 +486,7 @@ static void showcmds(void)
|
||||||
|
|
||||||
upscli_disconnect(&ups);
|
upscli_disconnect(&ups);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle setting authentication data in the server */
|
/* handle setting authentication data in the server */
|
||||||
static void send_auth(const char *next)
|
static void send_auth(const char *next)
|
||||||
|
@ -491,7 +511,7 @@ static void send_auth(const char *next)
|
||||||
"upsd version too old - USERNAME not supported");
|
"upsd version too old - USERNAME not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page(next, "Can't set user name",
|
error_page(next, "Can't set user name",
|
||||||
"Set user name failed: %s", upscli_strerror(&ups));
|
"Set user name failed: %s", upscli_strerror(&ups));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +524,10 @@ static void send_auth(const char *next)
|
||||||
if (upscli_readline(&ups, buf, sizeof(buf)) < 0)
|
if (upscli_readline(&ups, buf, sizeof(buf)) < 0)
|
||||||
error_page(next, "Can't set password",
|
error_page(next, "Can't set password",
|
||||||
"Password set failed: %s", upscli_strerror(&ups));
|
"Password set failed: %s", upscli_strerror(&ups));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void docmd(void)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void docmd(void)
|
static void docmd(void)
|
||||||
{
|
{
|
||||||
|
@ -515,13 +538,13 @@ static void docmd(void)
|
||||||
"Access to that host is not authorized");
|
"Access to that host is not authorized");
|
||||||
|
|
||||||
/* the user is messing with us */
|
/* the user is messing with us */
|
||||||
if (!upscommand)
|
if (!upscommand)
|
||||||
error_page("showcmds", "Form error",
|
error_page("showcmds", "Form error",
|
||||||
"No instant command selected");
|
"No instant command selected");
|
||||||
|
|
||||||
/* (l)user took the default blank option */
|
/* (l)user took the default blank option */
|
||||||
if (strlen(upscommand) == 0)
|
if (strlen(upscommand) == 0)
|
||||||
error_page("showcmds", "Form error",
|
error_page("showcmds", "Form error",
|
||||||
"No instant command selected");
|
"No instant command selected");
|
||||||
|
|
||||||
upsd_connect();
|
upsd_connect();
|
||||||
|
@ -595,7 +618,7 @@ static void docmd(void)
|
||||||
static const char *get_data(const char *type, const char *varname)
|
static const char *get_data(const char *type, const char *varname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
char **answer;
|
char **answer;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
|
|
||||||
|
@ -633,7 +656,7 @@ static void do_string(const char *varname, int maxlen)
|
||||||
static void do_enum(const char *varname)
|
static void do_enum(const char *varname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
char **answer, *val;
|
char **answer, *val;
|
||||||
const char *query[4], *tmp;
|
const char *query[4], *tmp;
|
||||||
|
|
||||||
|
@ -659,8 +682,9 @@ static void do_enum(const char *varname)
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
printf("Unavailable\n");
|
printf("Unavailable\n");
|
||||||
fprintf(stderr, "Error doing ENUM %s %s: %s\n",
|
fprintf(stderr, "Error doing ENUM %s %s: %s\n",
|
||||||
upsname, varname, upscli_strerror(&ups));
|
upsname, varname, upscli_strerror(&ups));
|
||||||
|
free(val);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -674,7 +698,7 @@ static void do_enum(const char *varname)
|
||||||
|
|
||||||
if (numa < 4) {
|
if (numa < 4) {
|
||||||
fprintf(stderr, "Error: insufficient data "
|
fprintf(stderr, "Error: insufficient data "
|
||||||
"(got %d args, need at least 4)\n", numa);
|
"(got %zu args, need at least 4)\n", numa);
|
||||||
|
|
||||||
free(val);
|
free(val);
|
||||||
return;
|
return;
|
||||||
|
@ -697,7 +721,7 @@ static void do_enum(const char *varname)
|
||||||
static void do_type(const char *varname)
|
static void do_type(const char *varname)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int i, numq, numa;
|
size_t i, numq, numa;
|
||||||
char **answer;
|
char **answer;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
|
|
||||||
|
@ -709,7 +733,7 @@ static void do_type(const char *varname)
|
||||||
ret = upscli_get(&ups, numq, query, &numa, &answer);
|
ret = upscli_get(&ups, numq, query, &numa, &answer);
|
||||||
|
|
||||||
if ((ret < 0) || (numa < numq)) {
|
if ((ret < 0) || (numa < numq)) {
|
||||||
printf("Unknown type\n");
|
printf("Unknown type\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +751,9 @@ static void do_type(const char *varname)
|
||||||
/* split out the :<len> data */
|
/* split out the :<len> data */
|
||||||
ptr = strchr(answer[i], ':');
|
ptr = strchr(answer[i], ':');
|
||||||
*ptr++ = '\0';
|
*ptr++ = '\0';
|
||||||
len = strtol(ptr, (char **) NULL, 10);
|
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;
|
||||||
|
|
||||||
do_string(varname, len);
|
do_string(varname, len);
|
||||||
return;
|
return;
|
||||||
|
@ -741,10 +767,12 @@ static void do_type(const char *varname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_rw(const char *upsname, const char *varname)
|
static void print_rw(const char *arg_upsname, const char *varname)
|
||||||
{
|
{
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
|
|
||||||
|
printf("<!-- <TR><TD>Device</TD><TD>%s</TD></TR> -->\n", arg_upsname);
|
||||||
|
|
||||||
printf("<TR BGCOLOR=\"#60B0B0\" ALIGN=\"CENTER\">\n");
|
printf("<TR BGCOLOR=\"#60B0B0\" ALIGN=\"CENTER\">\n");
|
||||||
|
|
||||||
printf("<TD>");
|
printf("<TD>");
|
||||||
|
@ -765,10 +793,13 @@ static void print_rw(const char *upsname, const char *varname)
|
||||||
printf("</TR>\n");
|
printf("</TR>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void showsettings(void)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void showsettings(void)
|
static void showsettings(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[2];
|
const char *query[2];
|
||||||
char **answer, *desc = NULL;
|
char **answer, *desc = NULL;
|
||||||
struct list_t *lhead, *llast, *ltmp, *lnext;
|
struct list_t *lhead, *llast, *ltmp, *lnext;
|
||||||
|
@ -907,13 +938,16 @@ static int setvar(const char *var, const char *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* turn a form submission of settings into SET commands for upsd */
|
/* turn a form submission of settings into SET commands for upsd */
|
||||||
|
static void savesettings(void)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void savesettings(void)
|
static void savesettings(void)
|
||||||
{
|
{
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
char *desc;
|
char *desc;
|
||||||
uvtype_t *upsvar;
|
uvtype_t *upsvar;
|
||||||
|
|
||||||
if (!checkhost(monups, &desc))
|
if (!checkhost(monups, &desc))
|
||||||
error_page("showsettings", "Access denied",
|
error_page("showsettings", "Access denied",
|
||||||
"Access to that host is not authorized");
|
"Access to that host is not authorized");
|
||||||
|
|
||||||
|
@ -953,6 +987,9 @@ static void savesettings(void)
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void initial_pickups(void)
|
||||||
|
__attribute__((noreturn));
|
||||||
|
|
||||||
static void initial_pickups(void)
|
static void initial_pickups(void)
|
||||||
{
|
{
|
||||||
do_header("Select a UPS");
|
do_header("Select a UPS");
|
||||||
|
@ -1027,10 +1064,12 @@ static void check_conf(void)
|
||||||
fprintf(stderr, "upsset.conf does not permit execution\n");
|
fprintf(stderr, "upsset.conf does not permit execution\n");
|
||||||
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
NUT_UNUSED_VARIABLE(argc);
|
||||||
|
NUT_UNUSED_VARIABLE(argv);
|
||||||
username = password = function = monups = NULL;
|
username = password = function = monups = NULL;
|
||||||
|
|
||||||
printf("Content-type: text/html\n\n");
|
printf("Content-type: text/html\n\n");
|
||||||
|
@ -1040,15 +1079,16 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
/* see if there's anything waiting .. the server my not close STDIN properly */
|
/* see if there's anything waiting .. the server my not close STDIN properly */
|
||||||
if (1) {
|
if (1) {
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
FD_SET(STDIN_FILENO, &fds);
|
FD_SET(STDIN_FILENO, &fds);
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 250000; /* wait for up to 250ms for a POST response */
|
tv.tv_usec = 250000; /* wait for up to 250ms for a POST response */
|
||||||
if ((select(STDIN_FILENO+1, &fds, 0, 0, &tv)) > 0)
|
|
||||||
extractpostargs();
|
if ((select(STDIN_FILENO+1, &fds, 0, 0, &tv)) > 0)
|
||||||
|
extractpostargs();
|
||||||
}
|
}
|
||||||
if ((!username) || (!password) || (!function))
|
if ((!username) || (!password) || (!function))
|
||||||
loginscreen();
|
loginscreen();
|
||||||
|
@ -1074,6 +1114,6 @@ int main(int argc, char **argv)
|
||||||
docmd();
|
docmd();
|
||||||
|
|
||||||
printf("Error: Unhandled function name [%s]\n", function);
|
printf("Error: Unhandled function name [%s]\n", function);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "nut_stdint.h"
|
||||||
|
#include "timehead.h"
|
||||||
#include "upsclient.h"
|
#include "upsclient.h"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
#include "cgilib.h"
|
#include "cgilib.h"
|
||||||
#include "parseconf.h"
|
#include "parseconf.h"
|
||||||
#include "timehead.h"
|
|
||||||
#include "upsstats.h"
|
#include "upsstats.h"
|
||||||
#include "upsimagearg.h"
|
#include "upsimagearg.h"
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ static int use_celsius = 1, refreshdelay = -1, treemode = 0;
|
||||||
/* from cgilib's checkhost() */
|
/* from cgilib's checkhost() */
|
||||||
static char *monhostdesc = NULL;
|
static char *monhostdesc = NULL;
|
||||||
|
|
||||||
static int port;
|
static uint16_t port;
|
||||||
static char *upsname, *hostname;
|
static char *upsname, *hostname;
|
||||||
static char *upsimgpath="upsimage.cgi", *upsstatpath="upsstats.cgi";
|
static char *upsimgpath="upsimage.cgi", *upsstatpath="upsstats.cgi";
|
||||||
static UPSCONN_t ups;
|
static UPSCONN_t ups;
|
||||||
|
@ -103,7 +104,7 @@ static int check_ups_fd(int do_report)
|
||||||
static int get_var(const char *var, char *buf, size_t buflen, int verbose)
|
static int get_var(const char *var, char *buf, size_t buflen, int verbose)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -134,7 +135,7 @@ static int get_var(const char *var, char *buf, size_t buflen, int verbose)
|
||||||
if (numa < numq) {
|
if (numa < numq) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("[Invalid response]\n");
|
printf("[Invalid response]\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,9 +196,10 @@ static int do_date(const char *buf)
|
||||||
{
|
{
|
||||||
char datebuf[SMALLBUF];
|
char datebuf[SMALLBUF];
|
||||||
time_t tod;
|
time_t tod;
|
||||||
|
struct tm tmbuf;
|
||||||
|
|
||||||
time(&tod);
|
time(&tod);
|
||||||
if (strftime(datebuf, sizeof(datebuf), buf, localtime(&tod))) {
|
if (strftime(datebuf, sizeof(datebuf), buf, localtime_r(&tod, &tmbuf))) {
|
||||||
printf("%s", datebuf);
|
printf("%s", datebuf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -291,12 +293,12 @@ static int do_img(char *buf)
|
||||||
|
|
||||||
/* only allow known types through */
|
/* only allow known types through */
|
||||||
|
|
||||||
if (!strcmp(type, "input.voltage")
|
if (!strcmp(type, "input.voltage")
|
||||||
|| !strcmp(type, "input.L1-N.voltage")
|
|| !strcmp(type, "input.L1-N.voltage")
|
||||||
|| !strcmp(type, "input.L2-N.voltage")
|
|| !strcmp(type, "input.L2-N.voltage")
|
||||||
|| !strcmp(type, "input.L3-N.voltage")
|
|| !strcmp(type, "input.L3-N.voltage")
|
||||||
|| !strcmp(type, "input.L1-L2.voltage")
|
|| !strcmp(type, "input.L1-L2.voltage")
|
||||||
|| !strcmp(type, "input.L2-L3.voltage")
|
|| !strcmp(type, "input.L2-L3.voltage")
|
||||||
|| !strcmp(type, "input.L3-L1.voltage")) {
|
|| !strcmp(type, "input.L3-L1.voltage")) {
|
||||||
return get_img_val(type, "Input voltage", imgargs);
|
return get_img_val(type, "Input voltage", imgargs);
|
||||||
}
|
}
|
||||||
|
@ -308,11 +310,11 @@ static int do_img(char *buf)
|
||||||
return get_img_val(type, "Battery charge", imgargs);
|
return get_img_val(type, "Battery charge", imgargs);
|
||||||
|
|
||||||
if (!strcmp(type, "output.voltage")
|
if (!strcmp(type, "output.voltage")
|
||||||
|| !strcmp(type, "output.L1-N.voltage")
|
|| !strcmp(type, "output.L1-N.voltage")
|
||||||
|| !strcmp(type, "output.L2-N.voltage")
|
|| !strcmp(type, "output.L2-N.voltage")
|
||||||
|| !strcmp(type, "output.L3-N.voltage")
|
|| !strcmp(type, "output.L3-N.voltage")
|
||||||
|| !strcmp(type, "output.L1-L2.voltage")
|
|| !strcmp(type, "output.L1-L2.voltage")
|
||||||
|| !strcmp(type, "output.L2-L3.voltage")
|
|| !strcmp(type, "output.L2-L3.voltage")
|
||||||
|| !strcmp(type, "output.L3-L1.voltage")) {
|
|| !strcmp(type, "output.L3-L1.voltage")) {
|
||||||
return get_img_val(type, "Output voltage", imgargs);
|
return get_img_val(type, "Output voltage", imgargs);
|
||||||
}
|
}
|
||||||
|
@ -349,7 +351,7 @@ static void ups_connect(void)
|
||||||
{
|
{
|
||||||
static ulist_t *lastups = NULL;
|
static ulist_t *lastups = NULL;
|
||||||
char *newups, *newhost;
|
char *newups, *newhost;
|
||||||
int newport;
|
uint16_t newport;
|
||||||
|
|
||||||
/* try to minimize reconnects */
|
/* try to minimize reconnects */
|
||||||
if (lastups) {
|
if (lastups) {
|
||||||
|
@ -363,13 +365,13 @@ static void ups_connect(void)
|
||||||
/* see if it's just on the same host */
|
/* see if it's just on the same host */
|
||||||
newups = newhost = NULL;
|
newups = newhost = NULL;
|
||||||
|
|
||||||
if (upscli_splitname(currups->sys, &newups, &newhost,
|
if (upscli_splitname(currups->sys, &newups, &newhost,
|
||||||
&newport) != 0) {
|
&newport) != 0) {
|
||||||
printf("Unusable UPS definition [%s]\n", currups->sys);
|
printf("Unusable UPS definition [%s]\n", currups->sys);
|
||||||
fprintf(stderr, "Unusable UPS definition [%s]\n",
|
fprintf(stderr, "Unusable UPS definition [%s]\n",
|
||||||
currups->sys);
|
currups->sys);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!strcmp(newhost, hostname)) && (port == newport)) {
|
if ((!strcmp(newhost, hostname)) && (port == newport)) {
|
||||||
free(upsname);
|
free(upsname);
|
||||||
|
@ -564,7 +566,7 @@ static void do_upsimgpath(const char *s) {
|
||||||
static void do_temp(const char *var)
|
static void do_temp(const char *var)
|
||||||
{
|
{
|
||||||
char tempc[SMALLBUF];
|
char tempc[SMALLBUF];
|
||||||
float tempf;
|
double tempf;
|
||||||
|
|
||||||
if (!get_var(var, tempc, sizeof(tempc), 1))
|
if (!get_var(var, tempc, sizeof(tempc), 1))
|
||||||
return;
|
return;
|
||||||
|
@ -807,7 +809,8 @@ static int do_command(char *cmd)
|
||||||
static void parse_line(const char *buf)
|
static void parse_line(const char *buf)
|
||||||
{
|
{
|
||||||
char cmd[SMALLBUF];
|
char cmd[SMALLBUF];
|
||||||
int i, len, do_cmd = 0;
|
size_t i, len;
|
||||||
|
char do_cmd = 0;
|
||||||
|
|
||||||
for (i = 0; buf[i]; i += len) {
|
for (i = 0; buf[i]; i += len) {
|
||||||
|
|
||||||
|
@ -824,9 +827,10 @@ static void parse_line(const char *buf)
|
||||||
i++; /* skip over the '@' character */
|
i++; /* skip over the '@' character */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
assert (len < INT_MAX);
|
||||||
|
|
||||||
if (do_cmd) {
|
if (do_cmd) {
|
||||||
snprintf(cmd, sizeof(cmd), "%.*s", len, &buf[i]);
|
snprintf(cmd, sizeof(cmd), "%.*s", (int)len, &buf[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,13 +840,13 @@ static void parse_line(const char *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pass it trough */
|
/* pass it trough */
|
||||||
printf("%.*s", len, &buf[i]);
|
printf("%.*s", (int)len, &buf[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void display_template(const char *tfn)
|
static void display_template(const char *tfn)
|
||||||
{
|
{
|
||||||
char fn[SMALLBUF], buf[LARGEBUF];
|
char fn[SMALLBUF], buf[LARGEBUF];
|
||||||
|
|
||||||
snprintf(fn, sizeof(fn), "%s/%s", confpath(), tfn);
|
snprintf(fn, sizeof(fn), "%s/%s", confpath(), tfn);
|
||||||
|
|
||||||
|
@ -865,7 +869,7 @@ static void display_template(const char *tfn)
|
||||||
|
|
||||||
static void display_tree(int verbose)
|
static void display_tree(int verbose)
|
||||||
{
|
{
|
||||||
unsigned int numq, numa;
|
size_t numq, numa;
|
||||||
const char *query[4];
|
const char *query[4];
|
||||||
char **answer;
|
char **answer;
|
||||||
|
|
||||||
|
@ -890,7 +894,7 @@ static void display_tree(int verbose)
|
||||||
printf("<HTML>\n");
|
printf("<HTML>\n");
|
||||||
printf("<HEAD><TITLE>upsstat: data tree of %s</TITLE></HEAD>\n", currups->desc);
|
printf("<HEAD><TITLE>upsstat: data tree of %s</TITLE></HEAD>\n", currups->desc);
|
||||||
|
|
||||||
printf("<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#0000EE\" VLINK=\"#551A8B\">\n");
|
printf("<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#0000EE\" VLINK=\"#551A8B\">\n");
|
||||||
|
|
||||||
printf("<TABLE BGCOLOR=\"#50A0A0\" ALIGN=\"CENTER\">\n");
|
printf("<TABLE BGCOLOR=\"#50A0A0\" ALIGN=\"CENTER\">\n");
|
||||||
printf("<TR><TD>\n");
|
printf("<TR><TD>\n");
|
||||||
|
@ -910,12 +914,12 @@ static void display_tree(int verbose)
|
||||||
if (numa < 4) {
|
if (numa < 4) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("[Invalid response]\n");
|
printf("[Invalid response]\n");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("<TR BGCOLOR=\"#60B0B0\" ALIGN=\"LEFT\">\n");
|
printf("<TR BGCOLOR=\"#60B0B0\" ALIGN=\"LEFT\">\n");
|
||||||
|
|
||||||
printf("<TD>%s</TD>\n", answer[2]);
|
printf("<TD>%s</TD>\n", answer[2]);
|
||||||
printf("<TD>:</TD>\n");
|
printf("<TD>:</TD>\n");
|
||||||
printf("<TD>%s<br></TD>\n", answer[3]);
|
printf("<TD>%s<br></TD>\n", answer[3]);
|
||||||
|
@ -936,7 +940,7 @@ static void add_ups(char *sys, char *desc)
|
||||||
|
|
||||||
tmp = last = ulhead;
|
tmp = last = ulhead;
|
||||||
|
|
||||||
while (tmp) {
|
while (tmp) {
|
||||||
last = tmp;
|
last = tmp;
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
|
@ -1041,9 +1045,12 @@ static void display_single(void)
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
NUT_UNUSED_VARIABLE(argc);
|
||||||
|
NUT_UNUSED_VARIABLE(argv);
|
||||||
|
|
||||||
extractcgiargs();
|
extractcgiargs();
|
||||||
|
|
||||||
printf("Content-type: text/html\n");
|
printf("Content-type: text/html\n");
|
||||||
printf("Pragma: no-cache\n");
|
printf("Pragma: no-cache\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,25 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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 {
|
typedef struct {
|
||||||
char *sys;
|
char *sys;
|
||||||
char *desc;
|
char *desc;
|
||||||
void *next;
|
void *next;
|
||||||
} ulist_t;
|
} ulist_t;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* NUT_UPSSTATS_H_SEEN */
|
||||||
|
|
|
@ -2,14 +2,48 @@
|
||||||
|
|
||||||
AM_CFLAGS = -I$(top_srcdir)/include
|
AM_CFLAGS = -I$(top_srcdir)/include
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libparseconf.la libcommon.la
|
noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la
|
||||||
libparseconf_la_SOURCES = parseconf.c
|
libparseconf_la_SOURCES = parseconf.c
|
||||||
|
|
||||||
# do not hard depend on '../include/nut_version.h', since it blocks
|
# do not hard depend on '../include/nut_version.h', since it blocks
|
||||||
# 'dist', and is only required for actual build, in which case
|
# 'dist', and is only required for actual build, in which case
|
||||||
# BUILT_SOURCES (in ../include) will ensure nut_version.h will
|
# BUILT_SOURCES (in ../include) will ensure nut_version.h will
|
||||||
# be built before anything else
|
# be built before anything else... but do depend on its build area:
|
||||||
libcommon_la_SOURCES = common.c state.c upsconf.c
|
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
|
# ensure inclusion of local implementation of missing systems functions
|
||||||
# using LTLIBOBJS. Refer to configure.in -> AC_REPLACE_FUNCS
|
# using LTLIBOBJS. Refer to configure.in/.ac -> AC_REPLACE_FUNCS
|
||||||
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
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,9 +1,8 @@
|
||||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
@ -18,6 +17,61 @@
|
||||||
# Network UPS Tools: common
|
# Network UPS Tools: common
|
||||||
|
|
||||||
VPATH = @srcdir@
|
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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
@ -37,68 +91,152 @@ POST_UNINSTALL = :
|
||||||
build_triplet = @build@
|
build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
target_triplet = @target@
|
target_triplet = @target@
|
||||||
|
@BUILDING_IN_TREE_TRUE@am__append_1 = common.c
|
||||||
|
@BUILDING_IN_TREE_TRUE@am__append_2 = common.c
|
||||||
subdir = common
|
subdir = common
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in atexit.c \
|
|
||||||
setenv.c snprintf.c strerror.c
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.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 \
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_asciidoc.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_libavahi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libnetsnmp.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_libpowerman.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||||
$(top_srcdir)/m4/nut_config_libhal.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_report_feature.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||||
$(top_srcdir)/configure.in
|
$(top_srcdir)/configure.ac
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
|
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||||
CONFIG_CLEAN_FILES =
|
CONFIG_CLEAN_FILES =
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
CONFIG_CLEAN_VPATH_FILES =
|
||||||
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
LTLIBRARIES = $(noinst_LTLIBRARIES)
|
||||||
libcommon_la_DEPENDENCIES = libparseconf.la @LTLIBOBJS@
|
libcommon_la_DEPENDENCIES = libparseconf.la @LTLIBOBJS@
|
||||||
am_libcommon_la_OBJECTS = common.lo state.lo upsconf.lo
|
am__libcommon_la_SOURCES_DIST = state.c str.c upsconf.c common.c
|
||||||
libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS)
|
@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 =
|
libparseconf_la_LIBADD =
|
||||||
am_libparseconf_la_OBJECTS = parseconf.lo
|
am_libparseconf_la_OBJECTS = parseconf.lo
|
||||||
libparseconf_la_OBJECTS = $(am_libparseconf_la_OBJECTS)
|
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
|
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
am__depfiles_maybe = depfiles
|
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__mv = mv -f
|
am__mv = mv -f
|
||||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
$(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 =
|
||||||
CCLD = $(CC)
|
CCLD = $(CC)
|
||||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||||
$(LDFLAGS) -o $@
|
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||||
SOURCES = $(libcommon_la_SOURCES) $(libparseconf_la_SOURCES)
|
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||||
DIST_SOURCES = $(libcommon_la_SOURCES) $(libparseconf_la_SOURCES)
|
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)`
|
||||||
ETAGS = etags
|
ETAGS = etags
|
||||||
CTAGS = ctags
|
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)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
A2X = @A2X@
|
A2X = @A2X@
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
|
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
ASCIIDOC = @ASCIIDOC@
|
ASCIIDOC = @ASCIIDOC@
|
||||||
|
ASPELL = @ASPELL@
|
||||||
|
AUGPARSE = @AUGPARSE@
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
@ -109,16 +247,25 @@ CCDEPMODE = @CCDEPMODE@
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
CONFPATH = @CONFPATH@
|
CONFPATH = @CONFPATH@
|
||||||
CPP = @CPP@
|
CPP = @CPP@
|
||||||
|
CPPCHECK = @CPPCHECK@
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||||
|
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
CYGPATH_W = @CYGPATH_W@
|
CYGPATH_W = @CYGPATH_W@
|
||||||
DBLATEX = @DBLATEX@
|
DBLATEX = @DBLATEX@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
DEPDIR = @DEPDIR@
|
DEPDIR = @DEPDIR@
|
||||||
DLLTOOL = @DLLTOOL@
|
DLLTOOL = @DLLTOOL@
|
||||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||||
|
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||||
|
DRVPATH = @DRVPATH@
|
||||||
DSYMUTIL = @DSYMUTIL@
|
DSYMUTIL = @DSYMUTIL@
|
||||||
DUMPBIN = @DUMPBIN@
|
DUMPBIN = @DUMPBIN@
|
||||||
ECHO_C = @ECHO_C@
|
ECHO_C = @ECHO_C@
|
||||||
|
@ -127,11 +274,8 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
FGREP = @FGREP@
|
FGREP = @FGREP@
|
||||||
|
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||||
GREP = @GREP@
|
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@
|
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
@ -141,14 +285,15 @@ LD = @LD@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||||
|
LIBDIR = @LIBDIR@
|
||||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
|
||||||
LIBHAL_LIBS = @LIBHAL_LIBS@
|
|
||||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||||
|
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||||
|
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||||
|
@ -159,21 +304,29 @@ LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||||
|
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||||
LIBTOOL = @LIBTOOL@
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||||
|
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||||
LIPO = @LIPO@
|
LIPO = @LIPO@
|
||||||
LN_S = @LN_S@
|
LN_S = @LN_S@
|
||||||
|
LN_S_R = @LN_S_R@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||||
MAINT = @MAINT@
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
NETLIBS = @NETLIBS@
|
NETLIBS = @NETLIBS@
|
||||||
|
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||||
NM = @NM@
|
NM = @NM@
|
||||||
NMEDIT = @NMEDIT@
|
NMEDIT = @NMEDIT@
|
||||||
|
NUT_DATADIR = @NUT_DATADIR@
|
||||||
|
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||||
NUT_NETVERSION = @NUT_NETVERSION@
|
NUT_NETVERSION = @NUT_NETVERSION@
|
||||||
OBJDUMP = @OBJDUMP@
|
OBJDUMP = @OBJDUMP@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
@ -193,6 +346,9 @@ PKG_CONFIG = @PKG_CONFIG@
|
||||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||||
PORT = @PORT@
|
PORT = @PORT@
|
||||||
|
PYTHON = @PYTHON@
|
||||||
|
PYTHON2 = @PYTHON2@
|
||||||
|
PYTHON3 = @PYTHON3@
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||||
RUN_AS_USER = @RUN_AS_USER@
|
RUN_AS_USER = @RUN_AS_USER@
|
||||||
|
@ -201,24 +357,30 @@ SED = @SED@
|
||||||
SERLIBS = @SERLIBS@
|
SERLIBS = @SERLIBS@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
|
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||||
STATEPATH = @STATEPATH@
|
STATEPATH = @STATEPATH@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
SUN_LIBUSB = @SUN_LIBUSB@
|
SUN_LIBUSB = @SUN_LIBUSB@
|
||||||
TREE_VERSION = @TREE_VERSION@
|
TREE_VERSION = @TREE_VERSION@
|
||||||
|
VALGRIND = @VALGRIND@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||||
|
XMLLINT = @XMLLINT@
|
||||||
|
XSLTPROC = @XSLTPROC@
|
||||||
abs_builddir = @abs_builddir@
|
abs_builddir = @abs_builddir@
|
||||||
abs_srcdir = @abs_srcdir@
|
abs_srcdir = @abs_srcdir@
|
||||||
abs_top_builddir = @abs_top_builddir@
|
abs_top_builddir = @abs_top_builddir@
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
ac_ct_AR = @ac_ct_AR@
|
ac_ct_AR = @ac_ct_AR@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||||
am__include = @am__include@
|
am__include = @am__include@
|
||||||
am__leading_dot = @am__leading_dot@
|
am__leading_dot = @am__leading_dot@
|
||||||
am__quote = @am__quote@
|
am__quote = @am__quote@
|
||||||
am__tar = @am__tar@
|
am__tar = @am__tar@
|
||||||
am__untar = @am__untar@
|
am__untar = @am__untar@
|
||||||
|
auglensdir = @auglensdir@
|
||||||
bindir = @bindir@
|
bindir = @bindir@
|
||||||
build = @build@
|
build = @build@
|
||||||
build_alias = @build_alias@
|
build_alias = @build_alias@
|
||||||
|
@ -229,8 +391,12 @@ builddir = @builddir@
|
||||||
cgiexecdir = @cgiexecdir@
|
cgiexecdir = @cgiexecdir@
|
||||||
datadir = @datadir@
|
datadir = @datadir@
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
|
devddir = @devddir@
|
||||||
docdir = @docdir@
|
docdir = @docdir@
|
||||||
driverexecdir = @driverexecdir@
|
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@
|
dvidir = @dvidir@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
host = @host@
|
host = @host@
|
||||||
|
@ -249,18 +415,21 @@ localedir = @localedir@
|
||||||
localstatedir = @localstatedir@
|
localstatedir = @localstatedir@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
mkdir_p = @mkdir_p@
|
mkdir_p = @mkdir_p@
|
||||||
|
now = @now@
|
||||||
oldincludedir = @oldincludedir@
|
oldincludedir = @oldincludedir@
|
||||||
pdfdir = @pdfdir@
|
pdfdir = @pdfdir@
|
||||||
pkgconfigdir = @pkgconfigdir@
|
pkgconfigdir = @pkgconfigdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemdsystemshutdowndir = @systemdsystemshutdowndir@
|
systemdshutdowndir = @systemdshutdowndir@
|
||||||
systemdsystemunitdir = @systemdsystemunitdir@
|
systemdsystemunitdir = @systemdsystemunitdir@
|
||||||
|
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||||
target = @target@
|
target = @target@
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
target_cpu = @target_cpu@
|
target_cpu = @target_cpu@
|
||||||
|
@ -271,18 +440,22 @@ top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
udevdir = @udevdir@
|
udevdir = @udevdir@
|
||||||
AM_CFLAGS = -I$(top_srcdir)/include
|
AM_CFLAGS = -I$(top_srcdir)/include
|
||||||
noinst_LTLIBRARIES = libparseconf.la libcommon.la
|
noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la
|
||||||
libparseconf_la_SOURCES = parseconf.c
|
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
|
||||||
|
|
||||||
# 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
|
|
||||||
libcommon_la_SOURCES = common.c state.c upsconf.c
|
|
||||||
# ensure inclusion of local implementation of missing systems functions
|
# ensure inclusion of local implementation of missing systems functions
|
||||||
# using LTLIBOBJS. Refer to configure.in -> AC_REPLACE_FUNCS
|
# using LTLIBOBJS. Refer to configure.in/.ac -> AC_REPLACE_FUNCS
|
||||||
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
||||||
all: all-am
|
libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||||
|
all: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .c .lo .o .obj
|
.SUFFIXES: .c .lo .o .obj
|
||||||
|
@ -298,14 +471,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu common/Makefile
|
$(AUTOMAKE) --gnu common/Makefile
|
||||||
.PRECIOUS: Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
@ -319,16 +491,23 @@ $(am__aclocal_m4_deps):
|
||||||
|
|
||||||
clean-noinstLTLIBRARIES:
|
clean-noinstLTLIBRARIES:
|
||||||
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
|
||||||
@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
|
@list='$(noinst_LTLIBRARIES)'; \
|
||||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
locs=`for p in $$list; do echo $$p; done | \
|
||||||
test "$$dir" != "$$p" || dir=.; \
|
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
|
||||||
echo "rm -f \"$${dir}/so_locations\""; \
|
sort -u`; \
|
||||||
rm -f "$${dir}/so_locations"; \
|
test -z "$$locs" || { \
|
||||||
done
|
echo rm -f $${locs}; \
|
||||||
libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES)
|
rm -f $${locs}; \
|
||||||
$(LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS)
|
}
|
||||||
libparseconf.la: $(libparseconf_la_OBJECTS) $(libparseconf_la_DEPENDENCIES)
|
|
||||||
$(LINK) $(libparseconf_la_OBJECTS) $(libparseconf_la_LIBADD) $(LIBS)
|
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)
|
||||||
|
|
||||||
mostlyclean-compile:
|
mostlyclean-compile:
|
||||||
-rm -f *.$(OBJEXT)
|
-rm -f *.$(OBJEXT)
|
||||||
|
@ -336,35 +515,45 @@ mostlyclean-compile:
|
||||||
distclean-compile:
|
distclean-compile:
|
||||||
-rm -f *.tab.c
|
-rm -f *.tab.c
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/atexit.Plo@am__quote@
|
@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@
|
@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@
|
@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@
|
@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@
|
@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@
|
@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@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Plo@am__quote@ # am--include-marker
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upsconf.Plo@am__quote@
|
@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)
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||||
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||||
|
|
||||||
.c.obj:
|
.c.obj:
|
||||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||||
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||||
|
|
||||||
.c.lo:
|
.c.lo:
|
||||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||||
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
|
||||||
|
|
||||||
mostlyclean-libtool:
|
mostlyclean-libtool:
|
||||||
-rm -f *.lo
|
-rm -f *.lo
|
||||||
|
@ -372,26 +561,15 @@ mostlyclean-libtool:
|
||||||
clean-libtool:
|
clean-libtool:
|
||||||
-rm -rf .libs _libs
|
-rm -rf .libs _libs
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
ID: $(am__tagged_files)
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||||
unique=`for i in $$list; do \
|
tags: tags-am
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
TAGS: tags
|
||||||
done | \
|
|
||||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
|
||||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
|
||||||
mkid -fID $$unique
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||||
$(TAGS_FILES) $(LISP)
|
|
||||||
set x; \
|
set x; \
|
||||||
here=`pwd`; \
|
here=`pwd`; \
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
$(am__define_uniq_tagged_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; \
|
shift; \
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
@ -403,15 +581,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
$$unique; \
|
$$unique; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
ctags: CTAGS
|
ctags: ctags-am
|
||||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|
||||||
$(TAGS_FILES) $(LISP)
|
CTAGS: ctags
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||||
unique=`for i in $$list; do \
|
$(am__define_uniq_tagged_files); \
|
||||||
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" \
|
test -z "$(CTAGS_ARGS)$$unique" \
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
$$unique
|
$$unique
|
||||||
|
@ -420,11 +594,29 @@ GTAGS:
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
&& $(am__cd) $(top_srcdir) \
|
&& $(am__cd) $(top_srcdir) \
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
&& 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:
|
distclean-tags:
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
distdir: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||||
|
|
||||||
|
distdir-am: $(DISTFILES)
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
@ -455,11 +647,14 @@ distdir: $(DISTFILES)
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
check-am: all-am
|
check-am: all-am
|
||||||
check: check-am
|
check: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||||
all-am: Makefile $(LTLIBRARIES)
|
all-am: Makefile $(LTLIBRARIES)
|
||||||
installdirs:
|
installdirs:
|
||||||
install: install-am
|
install: $(BUILT_SOURCES)
|
||||||
install-exec: install-exec-am
|
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||||
|
install-exec: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) install-exec-am
|
||||||
install-data: install-data-am
|
install-data: install-data-am
|
||||||
uninstall: uninstall-am
|
uninstall: uninstall-am
|
||||||
|
|
||||||
|
@ -468,13 +663,19 @@ install-am: all-am
|
||||||
|
|
||||||
installcheck: installcheck-am
|
installcheck: installcheck-am
|
||||||
install-strip:
|
install-strip:
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
if test -z '$(STRIP)'; then \
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
`test -z '$(STRIP)' || \
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
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
|
||||||
mostlyclean-generic:
|
mostlyclean-generic:
|
||||||
|
|
||||||
clean-generic:
|
clean-generic:
|
||||||
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
distclean-generic:
|
distclean-generic:
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
@ -483,13 +684,23 @@ distclean-generic:
|
||||||
maintainer-clean-generic:
|
maintainer-clean-generic:
|
||||||
@echo "This command is intended for maintainers to use"
|
@echo "This command is intended for maintainers to use"
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
@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: clean-am
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||||
mostlyclean-am
|
mostlyclean-am
|
||||||
|
|
||||||
distclean: distclean-am
|
distclean: distclean-am
|
||||||
-rm -rf $(DEPDIR) ./$(DEPDIR)
|
-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 -f Makefile
|
-rm -f Makefile
|
||||||
distclean-am: clean-am distclean-compile distclean-generic \
|
distclean-am: clean-am distclean-compile distclean-generic \
|
||||||
distclean-tags
|
distclean-tags
|
||||||
|
@ -535,7 +746,15 @@ install-ps-am:
|
||||||
installcheck-am:
|
installcheck-am:
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
maintainer-clean: maintainer-clean-am
|
||||||
-rm -rf $(DEPDIR) ./$(DEPDIR)
|
-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 -f Makefile
|
-rm -f Makefile
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||||
|
|
||||||
|
@ -554,21 +773,45 @@ ps-am:
|
||||||
|
|
||||||
uninstall-am:
|
uninstall-am:
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
.MAKE: all check install install-am install-exec install-strip
|
||||||
|
|
||||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||||
clean-libtool clean-noinstLTLIBRARIES ctags distclean \
|
clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||||
distclean-compile distclean-generic distclean-libtool \
|
cscopelist-am ctags ctags-am distclean distclean-compile \
|
||||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||||
install install-am install-data install-data-am install-dvi \
|
dvi-am html html-am info info-am install install-am \
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
install-data install-data-am install-dvi install-dvi-am \
|
||||||
install-html-am install-info install-info-am install-man \
|
install-exec install-exec-am install-html install-html-am \
|
||||||
install-pdf install-pdf-am install-ps install-ps-am \
|
install-info install-info-am install-man install-pdf \
|
||||||
install-strip installcheck installcheck-am installdirs \
|
install-pdf-am install-ps install-ps-am install-strip \
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
installcheck installcheck-am installdirs maintainer-clean \
|
||||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||||
|
tags tags-am uninstall uninstall-am
|
||||||
|
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
|
||||||
|
|
||||||
|
# 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" "$@"
|
||||||
|
|
||||||
|
$(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
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# 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.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
656
common/common.c
656
common/common.c
|
@ -1,6 +1,7 @@
|
||||||
/* common.c - common useful functions
|
/* common.c - common useful functions
|
||||||
|
|
||||||
Copyright (C) 2000 Russell Kroll <rkroll@exploits.org>
|
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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,8 +22,11 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
|
||||||
/* the reason we define UPS_VERSION as a static string, rather than a
|
/* the reason we define UPS_VERSION as a static string, rather than a
|
||||||
macro, is to make dependency tracking easier (only common.o depends
|
macro, is to make dependency tracking easier (only common.o depends
|
||||||
|
@ -32,6 +36,52 @@
|
||||||
#include "nut_version.h"
|
#include "nut_version.h"
|
||||||
const char *UPS_VERSION = NUT_VERSION_MACRO;
|
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_debug_level = 0;
|
||||||
int nut_log_level = 0;
|
int nut_log_level = 0;
|
||||||
static int upslog_flags = UPSLOG_STDERR;
|
static int upslog_flags = UPSLOG_STDERR;
|
||||||
|
@ -51,7 +101,7 @@ static int xbit_test(int val, int flag)
|
||||||
return ((val & flag) == flag);
|
return ((val & flag) == flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable writing upslog_with_errno() and upslogx() type messages to
|
/* enable writing upslog_with_errno() and upslogx() type messages to
|
||||||
the syslog */
|
the syslog */
|
||||||
void syslogbit_set(void)
|
void syslogbit_set(void)
|
||||||
{
|
{
|
||||||
|
@ -126,7 +176,7 @@ void background(void)
|
||||||
close(1);
|
close(1);
|
||||||
close(2);
|
close(2);
|
||||||
|
|
||||||
if (pid != 0)
|
if (pid != 0)
|
||||||
_exit(EXIT_SUCCESS); /* parent */
|
_exit(EXIT_SUCCESS); /* parent */
|
||||||
|
|
||||||
/* child */
|
/* child */
|
||||||
|
@ -163,8 +213,32 @@ struct passwd *get_user_pwent(const char *name)
|
||||||
fatalx(EXIT_FAILURE, "user %s not found", name);
|
fatalx(EXIT_FAILURE, "user %s not found", name);
|
||||||
else
|
else
|
||||||
fatal_with_errno(EXIT_FAILURE, "getpwnam(%s)", name);
|
fatal_with_errno(EXIT_FAILURE, "getpwnam(%s)", name);
|
||||||
|
|
||||||
return NULL; /* to make the compiler happy */
|
#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
|
||||||
}
|
}
|
||||||
|
|
||||||
/* change to the user defined in the struct */
|
/* change to the user defined in the struct */
|
||||||
|
@ -208,7 +282,7 @@ void writepid(const char *name)
|
||||||
{
|
{
|
||||||
char fn[SMALLBUF];
|
char fn[SMALLBUF];
|
||||||
FILE *pidf;
|
FILE *pidf;
|
||||||
int mask;
|
mode_t mask;
|
||||||
|
|
||||||
/* use full path if present, else build filename in PIDPATH */
|
/* use full path if present, else build filename in PIDPATH */
|
||||||
if (*name == '/')
|
if (*name == '/')
|
||||||
|
@ -220,7 +294,9 @@ void writepid(const char *name)
|
||||||
pidf = fopen(fn, "w");
|
pidf = fopen(fn, "w");
|
||||||
|
|
||||||
if (pidf) {
|
if (pidf) {
|
||||||
fprintf(pidf, "%d\n", (int) getpid());
|
intmax_t pid = (intmax_t)getpid();
|
||||||
|
upsdebugx(1, "Saving PID %jd into %s", pid, fn);
|
||||||
|
fprintf(pidf, "%jd\n", pid);
|
||||||
fclose(pidf);
|
fclose(pidf);
|
||||||
} else {
|
} else {
|
||||||
upslog_with_errno(LOG_NOTICE, "writepid: fopen %s", fn);
|
upslog_with_errno(LOG_NOTICE, "writepid: fopen %s", fn);
|
||||||
|
@ -229,30 +305,17 @@ void writepid(const char *name)
|
||||||
umask(mask);
|
umask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open pidfn, get the pid, then send it sig */
|
/* send sig to pid, returns -1 for error, or
|
||||||
int sendsignalfn(const char *pidfn, int sig)
|
* zero for a successfully sent signal
|
||||||
|
*/
|
||||||
|
int sendsignalpid(pid_t pid, int sig)
|
||||||
{
|
{
|
||||||
char buf[SMALLBUF];
|
int ret;
|
||||||
FILE *pidf;
|
|
||||||
int pid, ret;
|
|
||||||
|
|
||||||
pidf = fopen(pidfn, "r");
|
if (pid < 2 || pid > get_max_pid_t()) {
|
||||||
if (!pidf) {
|
upslogx(LOG_NOTICE,
|
||||||
upslog_with_errno(LOG_NOTICE, "fopen %s", pidfn);
|
"Ignoring invalid pid number %" PRIdMAX,
|
||||||
return -1;
|
(intmax_t) pid);
|
||||||
}
|
|
||||||
|
|
||||||
if (fgets(buf, sizeof(buf), pidf) == NULL) {
|
|
||||||
upslogx(LOG_NOTICE, "Failed to read pid from %s", pidfn);
|
|
||||||
fclose(pidf);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pid = strtol(buf, (char **)NULL, 10);
|
|
||||||
|
|
||||||
if (pid < 2) {
|
|
||||||
upslogx(LOG_NOTICE, "Ignoring invalid pid number %d", pid);
|
|
||||||
fclose(pidf);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,21 +324,78 @@ int sendsignalfn(const char *pidfn, int sig)
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
perror("kill");
|
perror("kill");
|
||||||
fclose(pidf);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now actually send it */
|
if (sig != 0) {
|
||||||
ret = kill(pid, sig);
|
/* now actually send it */
|
||||||
|
ret = kill(pid, sig);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
perror("kill");
|
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);
|
fclose(pidf);
|
||||||
return -1;
|
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);
|
fclose(pidf);
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int snprintfcat(char *dst, size_t size, const char *fmt, ...)
|
int snprintfcat(char *dst, size_t size, const char *fmt, ...)
|
||||||
|
@ -285,14 +405,46 @@ int snprintfcat(char *dst, size_t size, const char *fmt, ...)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
size--;
|
size--;
|
||||||
assert(len <= size);
|
if (len > size) {
|
||||||
|
/* Do not truncate existing string */
|
||||||
|
errno = ERANGE;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
va_start(ap, fmt);
|
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);
|
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);
|
va_end(ap);
|
||||||
|
|
||||||
dst[size] = '\0';
|
dst[size] = '\0';
|
||||||
return len + ret;
|
|
||||||
|
/* 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lazy way to send a signal if the program uses the PIDPATH */
|
/* lazy way to send a signal if the program uses the PIDPATH */
|
||||||
|
@ -319,7 +471,27 @@ static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
|
||||||
int ret;
|
int ret;
|
||||||
char buf[LARGEBUF];
|
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);
|
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)))
|
if ((ret < 0) || (ret >= (int) sizeof(buf)))
|
||||||
syslog(LOG_WARNING, "vupslog: vsnprintf needed more than %d bytes",
|
syslog(LOG_WARNING, "vupslog: vsnprintf needed more than %d bytes",
|
||||||
|
@ -329,20 +501,20 @@ static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
|
||||||
snprintfcat(buf, sizeof(buf), ": %s", strerror(errno));
|
snprintfcat(buf, sizeof(buf), ": %s", strerror(errno));
|
||||||
|
|
||||||
if (nut_debug_level > 0) {
|
if (nut_debug_level > 0) {
|
||||||
static struct timeval start = { 0 };
|
static struct timeval start = { 0, 0 };
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
|
|
||||||
gettimeofday(&now, NULL);
|
gettimeofday(&now, NULL);
|
||||||
|
|
||||||
if (start.tv_sec == 0) {
|
if (start.tv_sec == 0) {
|
||||||
start = now;
|
start = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start.tv_usec > now.tv_usec) {
|
if (start.tv_usec > now.tv_usec) {
|
||||||
now.tv_usec += 1000000;
|
now.tv_usec += 1000000;
|
||||||
now.tv_sec -= 1;
|
now.tv_sec -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "%4.0f.%06ld\t", difftime(now.tv_sec, start.tv_sec), (long)(now.tv_usec - start.tv_usec));
|
fprintf(stderr, "%4.0f.%06ld\t", difftime(now.tv_sec, start.tv_sec), (long)(now.tv_usec - start.tv_usec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +525,7 @@ static void vupslog(int priority, const char *fmt, va_list va, int use_strerror)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the default path for the directory containing configuration files */
|
/* Return the default path for the directory containing configuration files */
|
||||||
const char * confpath(void)
|
const char * confpath(void)
|
||||||
{
|
{
|
||||||
const char * path;
|
const char * path;
|
||||||
|
|
||||||
|
@ -364,33 +536,82 @@ const char * confpath(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the default path for the directory containing state files */
|
/* Return the default path for the directory containing state files */
|
||||||
const char * dflt_statepath(void)
|
const char * dflt_statepath(void)
|
||||||
{
|
{
|
||||||
const char * path;
|
const char * path;
|
||||||
|
|
||||||
if ((path = getenv("NUT_STATEPATH")) == NULL)
|
path = getenv("NUT_STATEPATH");
|
||||||
|
if ( (path == NULL) || (*path == '\0') )
|
||||||
path = STATEPATH;
|
path = STATEPATH;
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the alternate path for pid files */
|
/* Return the alternate path for pid files, for processes running as non-root
|
||||||
const char * altpidpath(void)
|
* 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.
|
||||||
|
*/
|
||||||
|
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
|
#ifdef ALTPIDPATH
|
||||||
return ALTPIDPATH;
|
return ALTPIDPATH;
|
||||||
#else
|
#else
|
||||||
return dflt_statepath();
|
/* We assume, here and elsewhere, that at least STATEPATH is always defined */
|
||||||
|
return STATEPATH;
|
||||||
#endif
|
#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) */
|
/* logs the formatted string to any configured logging devices + the output of strerror(errno) */
|
||||||
void upslog_with_errno(int priority, const char *fmt, ...)
|
void upslog_with_errno(int priority, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
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);
|
vupslog(priority, fmt, va, 1);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,44 +621,115 @@ void upslogx(int priority, const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
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);
|
vupslog(priority, fmt, va, 0);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
void upsdebug_with_errno(int level, const char *fmt, ...)
|
void s_upsdebug_with_errno(int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
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)
|
if (nut_debug_level < level)
|
||||||
return;
|
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);
|
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);
|
vupslog(LOG_DEBUG, fmt, va, 1);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
void upsdebugx(int level, const char *fmt, ...)
|
void s_upsdebugx(int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
|
char fmt2[LARGEBUF];
|
||||||
|
|
||||||
if (nut_debug_level < level)
|
if (nut_debug_level < level)
|
||||||
return;
|
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);
|
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);
|
vupslog(LOG_DEBUG, fmt, va, 0);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dump message msg and len bytes from buf to upsdebugx(level) in
|
/* dump message msg and len bytes from buf to upsdebugx(level) in
|
||||||
hexadecimal. (This function replaces Philippe Marzouk's original
|
hexadecimal. (This function replaces Philippe Marzouk's original
|
||||||
dump_hex() function) */
|
dump_hex() function) */
|
||||||
void upsdebug_hex(int level, const char *msg, const void *buf, int len)
|
void s_upsdebug_hex(int level, const char *msg, const void *buf, size_t len)
|
||||||
{
|
{
|
||||||
char line[100];
|
char line[100];
|
||||||
int n; /* number of characters currently in line */
|
int n; /* number of characters currently in line */
|
||||||
int i; /* number of bytes output from buffer */
|
size_t i; /* number of bytes output from buffer */
|
||||||
|
|
||||||
n = snprintf(line, sizeof(line), "%s: (%d bytes) =>", msg, len);
|
n = snprintf(line, sizeof(line), "%s: (%zu bytes) =>", msg, len);
|
||||||
|
if (n < 0) goto failed;
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
|
|
||||||
|
@ -447,9 +739,86 @@ void upsdebug_hex(int level, const char *msg, const void *buf, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
n = snprintfcat(line, sizeof(line), n ? " %02x" : "%02x",
|
n = snprintfcat(line, sizeof(line), n ? " %02x" : "%02x",
|
||||||
((unsigned char *)buf)[i]);
|
((const unsigned char *)buf)[i]);
|
||||||
|
|
||||||
|
if (n < 0) goto failed;
|
||||||
}
|
}
|
||||||
upsdebugx(level, "%s", line);
|
|
||||||
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vfatal(const char *fmt, va_list va, int use_strerror)
|
static void vfatal(const char *fmt, va_list va, int use_strerror)
|
||||||
|
@ -459,7 +828,19 @@ static void vfatal(const char *fmt, va_list va, int use_strerror)
|
||||||
if (xbit_test(upslog_flags, UPSLOG_SYSLOG_ON_FATAL))
|
if (xbit_test(upslog_flags, UPSLOG_SYSLOG_ON_FATAL))
|
||||||
xbit_set(&upslog_flags, UPSLOG_SYSLOG);
|
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);
|
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, ...)
|
void fatal_with_errno(int status, const char *fmt, ...)
|
||||||
|
@ -467,7 +848,19 @@ void fatal_with_errno(int status, const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
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);
|
vfatal(fmt, va, (errno > 0) ? 1 : 0);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
exit(status);
|
exit(status);
|
||||||
|
@ -478,7 +871,19 @@ void fatalx(int status, const char *fmt, ...)
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|
||||||
va_start(va, fmt);
|
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);
|
vfatal(fmt, va, 0);
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
exit(status);
|
exit(status);
|
||||||
|
@ -522,40 +927,10 @@ char *xstrdup(const char *string)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* modify in - strip all trailing instances of <sep> */
|
|
||||||
char *rtrim(char *in, const char sep)
|
|
||||||
{
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
if (in) {
|
|
||||||
p = &in[strlen(in) - 1];
|
|
||||||
|
|
||||||
while ((p >= in) && (*p == sep))
|
|
||||||
*p-- = '\0';
|
|
||||||
}
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* modify in - strip all leading instances of <sep> */
|
|
||||||
char* ltrim(char *in, const char sep)
|
|
||||||
{
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
if (in) {
|
|
||||||
p = in;
|
|
||||||
|
|
||||||
while ((*p != '\0') && (*p == sep))
|
|
||||||
*p++ = *in++;
|
|
||||||
|
|
||||||
p = '\0';
|
|
||||||
}
|
|
||||||
return in;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read up to buflen bytes from fd and return the number of bytes
|
/* 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.
|
read. If no data is available within d_sec + d_usec, return 0.
|
||||||
On error, a value < 0 is returned (errno indicates error). */
|
On error, a value < 0 is returned (errno indicates error). */
|
||||||
int select_read(const int fd, void *buf, const size_t buflen, const long d_sec, const long d_usec)
|
ssize_t select_read(const int fd, void *buf, const size_t buflen, const time_t d_sec, const suseconds_t d_usec)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
|
@ -579,7 +954,7 @@ int select_read(const int fd, void *buf, const size_t buflen, const long d_sec,
|
||||||
/* Write up to buflen bytes to fd and return the number of bytes
|
/* 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.
|
written. If no data is available within d_sec + d_usec, return 0.
|
||||||
On error, a value < 0 is returned (errno indicates error). */
|
On error, a value < 0 is returned (errno indicates error). */
|
||||||
int select_write(const int fd, const void *buf, const size_t buflen, const long d_sec, const long d_usec)
|
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 ret;
|
int ret;
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
|
@ -599,3 +974,106 @@ int select_write(const int fd, const void *buf, const size_t buflen, const long
|
||||||
|
|
||||||
return write(fd, buf, buflen);
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* There is now a context buffer, and you call pconf_init to set it up.
|
* There is now a context buffer, and you call pconf_init to set it up.
|
||||||
* All subsequent calls must have it as the first argument. There are
|
* All subsequent calls must have it as the first argument. There are
|
||||||
* two entry points for parsing lines. You can have it read a file
|
* two entry points for parsing lines. You can have it read a file
|
||||||
* (pconf_file_begin and pconf_file_next), take lines directly from
|
* (pconf_file_begin and pconf_file_next), take lines directly from
|
||||||
* the caller (pconf_line), or go along a character at a time (pconf_char).
|
* the caller (pconf_line), or go along a character at a time (pconf_char).
|
||||||
* The parsing is identical no matter how you feed it.
|
* The parsing is identical no matter how you feed it.
|
||||||
*
|
*
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*
|
*
|
||||||
* Fatal errors are those that involve memory allocation. If the user
|
* Fatal errors are those that involve memory allocation. If the user
|
||||||
* defines an error handler when calling pconf_init, that function will
|
* defines an error handler when calling pconf_init, that function will
|
||||||
* be called with the error message before parseconf exits. By default
|
* be called with the error message before parseconf exits. By default
|
||||||
* it will just write the message to stderr before exiting.
|
* it will just write the message to stderr before exiting.
|
||||||
*
|
*
|
||||||
* Input vs. Output:
|
* Input vs. Output:
|
||||||
|
@ -57,12 +57,12 @@
|
||||||
* also allows you to join lines, allowing you to have logical lines
|
* also allows you to join lines, allowing you to have logical lines
|
||||||
* that span physical lines, just like you can do in some shells.
|
* that span physical lines, just like you can do in some shells.
|
||||||
*
|
*
|
||||||
* Lines normally end with a newline, but reaching EOF will also force
|
* Lines normally end with a newline, but reaching EOF will also force
|
||||||
* parsing on what's been scanned so far.
|
* parsing on what's been scanned so far.
|
||||||
*
|
*
|
||||||
* Design:
|
* Design:
|
||||||
*
|
*
|
||||||
* Characters are read one at a time to drive the state machine.
|
* Characters are read one at a time to drive the state machine.
|
||||||
* As words are completed (by hitting whitespace or ending a "" item),
|
* As words are completed (by hitting whitespace or ending a "" item),
|
||||||
* they are committed to the next buffer in the arglist. realloc is
|
* they are committed to the next buffer in the arglist. realloc is
|
||||||
* used, so the buffer can grow to handle bigger words.
|
* used, so the buffer can grow to handle bigger words.
|
||||||
|
@ -76,15 +76,20 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "parseconf.h"
|
#include "parseconf.h"
|
||||||
|
#include "attribute.h"
|
||||||
|
#include "nut_stdint.h"
|
||||||
|
|
||||||
/* possible states */
|
/* possible states */
|
||||||
|
|
||||||
|
@ -97,6 +102,9 @@
|
||||||
#define STATE_ENDOFLINE 7
|
#define STATE_ENDOFLINE 7
|
||||||
#define STATE_PARSEERR 8
|
#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)
|
static void pconf_fatal(PCONF_CTX_t *ctx, const char *errtxt)
|
||||||
{
|
{
|
||||||
if (ctx->errhandler)
|
if (ctx->errhandler)
|
||||||
|
@ -109,7 +117,7 @@ static void pconf_fatal(PCONF_CTX_t *ctx, const char *errtxt)
|
||||||
|
|
||||||
static void add_arg_word(PCONF_CTX_t *ctx)
|
static void add_arg_word(PCONF_CTX_t *ctx)
|
||||||
{
|
{
|
||||||
int argpos;
|
size_t argpos;
|
||||||
size_t wbuflen;
|
size_t wbuflen;
|
||||||
|
|
||||||
/* this is where the new value goes */
|
/* this is where the new value goes */
|
||||||
|
@ -122,13 +130,13 @@ static void add_arg_word(PCONF_CTX_t *ctx)
|
||||||
ctx->maxargs = ctx->numargs;
|
ctx->maxargs = ctx->numargs;
|
||||||
|
|
||||||
/* resize the lists */
|
/* resize the lists */
|
||||||
ctx->arglist = realloc(ctx->arglist,
|
ctx->arglist = realloc(ctx->arglist,
|
||||||
sizeof(char *) * ctx->numargs);
|
sizeof(char *) * ctx->numargs);
|
||||||
|
|
||||||
if (!ctx->arglist)
|
if (!ctx->arglist)
|
||||||
pconf_fatal(ctx, "realloc arglist failed");
|
pconf_fatal(ctx, "realloc arglist failed");
|
||||||
|
|
||||||
ctx->argsize = realloc(ctx->argsize,
|
ctx->argsize = realloc(ctx->argsize,
|
||||||
sizeof(size_t) * ctx->numargs);
|
sizeof(size_t) * ctx->numargs);
|
||||||
|
|
||||||
if (!ctx->argsize)
|
if (!ctx->argsize)
|
||||||
|
@ -171,7 +179,7 @@ static void addchar(PCONF_CTX_t *ctx)
|
||||||
|
|
||||||
wbuflen = strlen(ctx->wordbuf);
|
wbuflen = strlen(ctx->wordbuf);
|
||||||
|
|
||||||
/* CVE-2012-2944: only allow the subset Ascii charset from Space to ~ */
|
/* CVE-2012-2944: only allow the subset of ASCII charset from Space to ~ */
|
||||||
if ((ctx->ch < 0x20) || (ctx->ch > 0x7f)) {
|
if ((ctx->ch < 0x20) || (ctx->ch > 0x7f)) {
|
||||||
fprintf(stderr, "addchar: discarding invalid character (0x%02x)!\n",
|
fprintf(stderr, "addchar: discarding invalid character (0x%02x)!\n",
|
||||||
ctx->ch);
|
ctx->ch);
|
||||||
|
@ -199,7 +207,7 @@ static void addchar(PCONF_CTX_t *ctx)
|
||||||
ctx->wordptr = &ctx->wordbuf[wbuflen];
|
ctx->wordptr = &ctx->wordbuf[wbuflen];
|
||||||
}
|
}
|
||||||
|
|
||||||
*ctx->wordptr++ = ctx->ch;
|
*ctx->wordptr++ = (char)ctx->ch;
|
||||||
*ctx->wordptr = '\0';
|
*ctx->wordptr = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,8 +242,8 @@ static int findwordstart(PCONF_CTX_t *ctx)
|
||||||
return STATE_FINDEOL;
|
return STATE_FINDEOL;
|
||||||
|
|
||||||
/* space = not in a word yet, so loop back */
|
/* space = not in a word yet, so loop back */
|
||||||
if (isspace(ctx->ch))
|
if (isspace((size_t)ctx->ch))
|
||||||
return STATE_FINDWORDSTART;
|
return STATE_FINDWORDSTART;
|
||||||
|
|
||||||
/* \ = literal = accept the next char blindly */
|
/* \ = literal = accept the next char blindly */
|
||||||
if (ctx->ch == '\\')
|
if (ctx->ch == '\\')
|
||||||
|
@ -255,7 +263,7 @@ static int findwordstart(PCONF_CTX_t *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATE_COLLECT;
|
return STATE_COLLECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eat characters until the end of the line is found */
|
/* eat characters until the end of the line is found */
|
||||||
static int findeol(PCONF_CTX_t *ctx)
|
static int findeol(PCONF_CTX_t *ctx)
|
||||||
|
@ -274,7 +282,7 @@ static void pconf_seterr(PCONF_CTX_t *ctx, const char *errmsg)
|
||||||
snprintf(ctx->errmsg, PCONF_ERR_LEN, "%s", errmsg);
|
snprintf(ctx->errmsg, PCONF_ERR_LEN, "%s", errmsg);
|
||||||
|
|
||||||
ctx->error = 1;
|
ctx->error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* quote characters inside a word bounded by "quotes" */
|
/* quote characters inside a word bounded by "quotes" */
|
||||||
static int quotecollect(PCONF_CTX_t *ctx)
|
static int quotecollect(PCONF_CTX_t *ctx)
|
||||||
|
@ -291,7 +299,7 @@ static int quotecollect(PCONF_CTX_t *ctx)
|
||||||
/* another " means we're done with this word */
|
/* another " means we're done with this word */
|
||||||
if (ctx->ch == '"') {
|
if (ctx->ch == '"') {
|
||||||
endofword(ctx);
|
endofword(ctx);
|
||||||
|
|
||||||
return STATE_FINDWORDSTART;
|
return STATE_FINDWORDSTART;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +342,7 @@ static int collect(PCONF_CTX_t *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* space means the word is done */
|
/* space means the word is done */
|
||||||
if (isspace(ctx->ch)) {
|
if (isspace((size_t)ctx->ch)) {
|
||||||
endofword(ctx);
|
endofword(ctx);
|
||||||
|
|
||||||
return STATE_FINDWORDSTART;
|
return STATE_FINDWORDSTART;
|
||||||
|
@ -443,6 +451,9 @@ int pconf_file_begin(PCONF_CTX_t *ctx, const char *fn)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* prevent fd leaking to child processes */
|
||||||
|
fcntl(fileno(ctx->f), F_SETFD, FD_CLOEXEC);
|
||||||
|
|
||||||
return 1; /* OK */
|
return 1; /* OK */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +582,7 @@ int pconf_line(PCONF_CTX_t *ctx, const char *line)
|
||||||
/* deal with any lingering characters */
|
/* deal with any lingering characters */
|
||||||
|
|
||||||
/* still building a word? */
|
/* still building a word? */
|
||||||
if (ctx->wordptr != ctx->wordbuf)
|
if (ctx->wordptr != ctx->wordbuf)
|
||||||
endofword(ctx); /* tie it off */
|
endofword(ctx); /* tie it off */
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -9,13 +9,14 @@ int nut_setenv(const char *name, const char *value, int overwrite)
|
||||||
char *val;
|
char *val;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
if (overwrite == 0) {
|
if (overwrite == 0) {
|
||||||
val = getenv(name);
|
val = getenv(name);
|
||||||
if (val != NULL) {
|
if (val != NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = xmalloc(strlen(value) + strlen(name) + 2);
|
buffer = xmalloc(strlen(value) + strlen(name) + 2);
|
||||||
strcpy(buffer, name);
|
strcpy(buffer, name);
|
||||||
strcat(buffer, "=");
|
strcat(buffer, "=");
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
* original. Also, there is now a builtin-test, just compile with:
|
* original. Also, there is now a builtin-test, just compile with:
|
||||||
* gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
|
* gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm
|
||||||
* and run snprintf for results.
|
* and run snprintf for results.
|
||||||
*
|
*
|
||||||
* Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
|
* Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i
|
||||||
* The PGP code was using unsigned hexadecimal formats.
|
* The PGP code was using unsigned hexadecimal formats.
|
||||||
* Unfortunately, unsigned formats simply didn't work.
|
* Unfortunately, unsigned formats simply didn't work.
|
||||||
*
|
*
|
||||||
* Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
|
* Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
# include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||||
|
@ -102,14 +102,14 @@
|
||||||
/*int snprintf (char *str, size_t count, const char *fmt, ...);*/
|
/*int snprintf (char *str, size_t count, const char *fmt, ...);*/
|
||||||
/*int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);*/
|
/*int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);*/
|
||||||
|
|
||||||
static void dopr (char *buffer, size_t maxlen, const char *format,
|
static void dopr (char *buffer, size_t maxlen, const char *format,
|
||||||
va_list args);
|
va_list args);
|
||||||
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
char *value, int flags, int min, int max);
|
char *value, int flags, int min, int max);
|
||||||
static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
long value, int base, int min, int max, int flags);
|
long value, int base, int min, int max, int flags);
|
||||||
static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
LDOUBLE fvalue, int min, int max, int flags);
|
LDOUBLE fvalue, int min, int max, int flags);
|
||||||
static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c );
|
static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -137,10 +137,26 @@ static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c );
|
||||||
|
|
||||||
/* Conversion Flags */
|
/* Conversion Flags */
|
||||||
#define DP_C_SHORT 1
|
#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_LONG 2
|
||||||
#define DP_C_LDOUBLE 3
|
#define DP_C_LDOUBLE 3
|
||||||
#define DP_C_LLONG 4
|
#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 char_to_int(p) ((p)- '0')
|
||||||
#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
|
#define MAX(p,q) (((p) >= (q)) ? (p) : (q))
|
||||||
|
|
||||||
|
@ -156,7 +172,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||||
int flags;
|
int flags;
|
||||||
int cflags;
|
int cflags;
|
||||||
size_t currlen;
|
size_t currlen;
|
||||||
|
|
||||||
state = DP_S_DEFAULT;
|
state = DP_S_DEFAULT;
|
||||||
currlen = flags = cflags = min = 0;
|
currlen = flags = cflags = min = 0;
|
||||||
max = -1;
|
max = -1;
|
||||||
|
@ -164,237 +180,259 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||||
|
|
||||||
while (state != DP_S_DONE)
|
while (state != DP_S_DONE)
|
||||||
{
|
{
|
||||||
if ((ch == '\0') || (currlen >= maxlen))
|
if ((ch == '\0') || (currlen >= maxlen))
|
||||||
state = DP_S_DONE;
|
state = DP_S_DONE;
|
||||||
|
|
||||||
switch(state)
|
switch(state)
|
||||||
{
|
{
|
||||||
case DP_S_DEFAULT:
|
case DP_S_DEFAULT:
|
||||||
if (ch == '%')
|
if (ch == '%')
|
||||||
state = DP_S_FLAGS;
|
state = DP_S_FLAGS;
|
||||||
else
|
else
|
||||||
dopr_outch (buffer, &currlen, maxlen, ch);
|
dopr_outch (buffer, &currlen, maxlen, ch);
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
case DP_S_FLAGS:
|
case DP_S_FLAGS:
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case '-':
|
case '-':
|
||||||
flags |= DP_F_MINUS;
|
flags |= DP_F_MINUS;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
case '+':
|
case '+':
|
||||||
flags |= DP_F_PLUS;
|
flags |= DP_F_PLUS;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
flags |= DP_F_SPACE;
|
flags |= DP_F_SPACE;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
case '#':
|
case '#':
|
||||||
flags |= DP_F_NUM;
|
flags |= DP_F_NUM;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
case '0':
|
case '0':
|
||||||
flags |= DP_F_ZERO;
|
flags |= DP_F_ZERO;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
state = DP_S_MIN;
|
state = DP_S_MIN;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DP_S_MIN:
|
case DP_S_MIN:
|
||||||
if (isdigit((unsigned char)ch))
|
if (isdigit((unsigned char)ch))
|
||||||
{
|
{
|
||||||
min = 10*min + char_to_int (ch);
|
min = 10*min + char_to_int (ch);
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
}
|
}
|
||||||
else if (ch == '*')
|
else if (ch == '*')
|
||||||
{
|
{
|
||||||
min = va_arg (args, int);
|
min = va_arg (args, int);
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
state = DP_S_DOT;
|
state = DP_S_DOT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
state = DP_S_DOT;
|
state = DP_S_DOT;
|
||||||
break;
|
break;
|
||||||
case DP_S_DOT:
|
case DP_S_DOT:
|
||||||
if (ch == '.')
|
if (ch == '.')
|
||||||
{
|
{
|
||||||
state = DP_S_MAX;
|
state = DP_S_MAX;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
state = DP_S_MOD;
|
state = DP_S_MOD;
|
||||||
break;
|
break;
|
||||||
case DP_S_MAX:
|
case DP_S_MAX:
|
||||||
if (isdigit((unsigned char)ch))
|
if (isdigit((unsigned char)ch))
|
||||||
{
|
{
|
||||||
if (max < 0)
|
if (max < 0)
|
||||||
max = 0;
|
max = 0;
|
||||||
max = 10*max + char_to_int (ch);
|
max = 10*max + char_to_int (ch);
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
}
|
}
|
||||||
else if (ch == '*')
|
else if (ch == '*')
|
||||||
{
|
{
|
||||||
max = va_arg (args, int);
|
max = va_arg (args, int);
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
state = DP_S_MOD;
|
state = DP_S_MOD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
state = DP_S_MOD;
|
state = DP_S_MOD;
|
||||||
break;
|
break;
|
||||||
case DP_S_MOD:
|
case DP_S_MOD:
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case 'h':
|
case 'h':
|
||||||
cflags = DP_C_SHORT;
|
cflags = DP_C_SHORT;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
cflags = DP_C_LONG;
|
cflags = DP_C_LONG;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
if (ch == 'l') { /* It's a long long */
|
if (ch == 'l') { /* It's a long long */
|
||||||
cflags = DP_C_LLONG;
|
cflags = DP_C_LLONG;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
cflags = DP_C_LDOUBLE;
|
cflags = DP_C_LDOUBLE;
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state = DP_S_CONV;
|
state = DP_S_CONV;
|
||||||
break;
|
break;
|
||||||
case DP_S_CONV:
|
case DP_S_CONV:
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case 'd':
|
case 'd':
|
||||||
case 'i':
|
case 'i':
|
||||||
if (cflags == DP_C_SHORT)
|
if (cflags == DP_C_SHORT)
|
||||||
value = va_arg (args, short int);
|
#ifdef C89PLUS
|
||||||
else if (cflags == DP_C_LONG)
|
value = (short int)va_arg (args, int);
|
||||||
value = va_arg (args, long int);
|
#else
|
||||||
else if (cflags == DP_C_LLONG)
|
value = va_arg (args, short int);
|
||||||
value = va_arg (args, LLONG);
|
#endif
|
||||||
else
|
else if (cflags == DP_C_LONG)
|
||||||
value = va_arg (args, int);
|
value = va_arg (args, long int);
|
||||||
fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
|
else if (cflags == DP_C_LLONG)
|
||||||
break;
|
value = va_arg (args, LLONG);
|
||||||
|
else
|
||||||
|
value = va_arg (args, int);
|
||||||
|
fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
|
||||||
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
flags |= DP_F_UNSIGNED;
|
flags |= DP_F_UNSIGNED;
|
||||||
if (cflags == DP_C_SHORT)
|
if (cflags == DP_C_SHORT)
|
||||||
value = va_arg (args, unsigned short int);
|
#ifdef C89PLUS
|
||||||
else if (cflags == DP_C_LONG)
|
value = (unsigned short int)va_arg (args, unsigned int);
|
||||||
value = (long)va_arg (args, unsigned long int);
|
#else
|
||||||
else if (cflags == DP_C_LLONG)
|
value = va_arg (args, unsigned short int);
|
||||||
value = (long)va_arg (args, unsigned LLONG);
|
#endif
|
||||||
else
|
else if (cflags == DP_C_LONG)
|
||||||
value = (long)va_arg (args, unsigned int);
|
value = (long)va_arg (args, unsigned long int);
|
||||||
fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags);
|
else if (cflags == DP_C_LLONG)
|
||||||
break;
|
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':
|
case 'u':
|
||||||
flags |= DP_F_UNSIGNED;
|
flags |= DP_F_UNSIGNED;
|
||||||
if (cflags == DP_C_SHORT)
|
if (cflags == DP_C_SHORT)
|
||||||
value = va_arg (args, unsigned short int);
|
#ifdef C89PLUS
|
||||||
else if (cflags == DP_C_LONG)
|
value = (unsigned short int)va_arg (args, unsigned int);
|
||||||
value = (long)va_arg (args, unsigned long int);
|
#else
|
||||||
else if (cflags == DP_C_LLONG)
|
value = va_arg (args, unsigned short int);
|
||||||
value = (LLONG)va_arg (args, unsigned LLONG);
|
#endif
|
||||||
else
|
else if (cflags == DP_C_LONG)
|
||||||
value = (long)va_arg (args, unsigned int);
|
value = (long)va_arg (args, unsigned long int);
|
||||||
fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
|
else if (cflags == DP_C_LLONG)
|
||||||
break;
|
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':
|
case 'X':
|
||||||
flags |= DP_F_UP;
|
flags |= DP_F_UP;
|
||||||
|
goto fallthrough_case_x;
|
||||||
case 'x':
|
case 'x':
|
||||||
flags |= DP_F_UNSIGNED;
|
fallthrough_case_x:
|
||||||
if (cflags == DP_C_SHORT)
|
flags |= DP_F_UNSIGNED;
|
||||||
value = va_arg (args, unsigned short int);
|
if (cflags == DP_C_SHORT)
|
||||||
else if (cflags == DP_C_LONG)
|
#ifdef C89PLUS
|
||||||
value = (long)va_arg (args, unsigned long int);
|
value = (unsigned short int)va_arg (args, unsigned int);
|
||||||
else if (cflags == DP_C_LLONG)
|
#else
|
||||||
value = (LLONG)va_arg (args, unsigned LLONG);
|
value = va_arg (args, unsigned short int);
|
||||||
else
|
#endif
|
||||||
value = (long)va_arg (args, unsigned int);
|
else if (cflags == DP_C_LONG)
|
||||||
fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags);
|
value = (long)va_arg (args, unsigned long int);
|
||||||
break;
|
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':
|
case 'f':
|
||||||
if (cflags == DP_C_LDOUBLE)
|
if (cflags == DP_C_LDOUBLE)
|
||||||
fvalue = va_arg (args, LDOUBLE);
|
fvalue = va_arg (args, LDOUBLE);
|
||||||
else
|
else
|
||||||
fvalue = va_arg (args, double);
|
fvalue = va_arg (args, double);
|
||||||
/* um, floating point? */
|
/* um, floating point? */
|
||||||
fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
|
fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags);
|
||||||
break;
|
break;
|
||||||
case 'E':
|
case 'E':
|
||||||
flags |= DP_F_UP;
|
flags |= DP_F_UP;
|
||||||
|
goto fallthrough_case_e;
|
||||||
case 'e':
|
case 'e':
|
||||||
if (cflags == DP_C_LDOUBLE)
|
fallthrough_case_e:
|
||||||
fvalue = va_arg (args, LDOUBLE);
|
if (cflags == DP_C_LDOUBLE)
|
||||||
else
|
fvalue = va_arg (args, LDOUBLE);
|
||||||
fvalue = va_arg (args, double);
|
else
|
||||||
break;
|
fvalue = va_arg (args, double);
|
||||||
|
break;
|
||||||
case 'G':
|
case 'G':
|
||||||
flags |= DP_F_UP;
|
flags |= DP_F_UP;
|
||||||
|
goto fallthrough_case_g;
|
||||||
case 'g':
|
case 'g':
|
||||||
if (cflags == DP_C_LDOUBLE)
|
fallthrough_case_g:
|
||||||
fvalue = va_arg (args, LDOUBLE);
|
if (cflags == DP_C_LDOUBLE)
|
||||||
else
|
fvalue = va_arg (args, LDOUBLE);
|
||||||
fvalue = va_arg (args, double);
|
else
|
||||||
break;
|
fvalue = va_arg (args, double);
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
|
dopr_outch (buffer, &currlen, maxlen, va_arg (args, int));
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
strvalue = va_arg (args, char *);
|
strvalue = va_arg (args, char *);
|
||||||
if (max < 0)
|
if (max < 0)
|
||||||
max = maxlen; /* ie, no max */
|
max = maxlen; /* ie, no max */
|
||||||
fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
|
fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
strvalue = va_arg (args, void *);
|
strvalue = va_arg (args, void *);
|
||||||
fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
|
fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
if (cflags == DP_C_SHORT)
|
if (cflags == DP_C_SHORT)
|
||||||
{
|
{
|
||||||
short int *num;
|
short int *num;
|
||||||
num = va_arg (args, short int *);
|
num = va_arg (args, short int *);
|
||||||
*num = currlen;
|
*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;
|
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 '%':
|
case '%':
|
||||||
dopr_outch (buffer, &currlen, maxlen, ch);
|
dopr_outch (buffer, &currlen, maxlen, ch);
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
/* not supported yet, treat as next char */
|
/* not supported yet, treat as next char */
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* Unknown, skip */
|
/* Unknown, skip */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
state = DP_S_DEFAULT;
|
state = DP_S_DEFAULT;
|
||||||
|
@ -408,18 +446,18 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||||
break; /* some picky compilers need this */
|
break; /* some picky compilers need this */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currlen < maxlen - 1)
|
if (currlen < maxlen - 1)
|
||||||
buffer[currlen] = '\0';
|
buffer[currlen] = '\0';
|
||||||
else
|
else
|
||||||
buffer[maxlen - 1] = '\0';
|
buffer[maxlen - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
char *value, int flags, int min, int max)
|
char *value, int flags, int min, int max)
|
||||||
{
|
{
|
||||||
int padlen, strln; /* amount to pad */
|
int padlen, strln; /* amount to pad */
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
value = "<NULL>";
|
value = "<NULL>";
|
||||||
|
@ -427,23 +465,23 @@ static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
|
|
||||||
for (strln = 0; value[strln]; ++strln); /* strlen */
|
for (strln = 0; value[strln]; ++strln); /* strlen */
|
||||||
padlen = min - strln;
|
padlen = min - strln;
|
||||||
if (padlen < 0)
|
if (padlen < 0)
|
||||||
padlen = 0;
|
padlen = 0;
|
||||||
if (flags & DP_F_MINUS)
|
if (flags & DP_F_MINUS)
|
||||||
padlen = -padlen; /* Left Justify */
|
padlen = -padlen; /* Left Justify */
|
||||||
|
|
||||||
while ((padlen > 0) && (cnt < max))
|
while ((padlen > 0) && (cnt < max))
|
||||||
{
|
{
|
||||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||||
--padlen;
|
--padlen;
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
while (*value && (cnt < max))
|
while (*value && (cnt < max))
|
||||||
{
|
{
|
||||||
dopr_outch (buffer, currlen, maxlen, *value++);
|
dopr_outch (buffer, currlen, maxlen, *value++);
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
while ((padlen < 0) && (cnt < max))
|
while ((padlen < 0) && (cnt < max))
|
||||||
{
|
{
|
||||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||||
++padlen;
|
++padlen;
|
||||||
|
@ -454,7 +492,7 @@ static void fmtstr (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
|
/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
|
||||||
|
|
||||||
static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
long value, int base, int min, int max, int flags)
|
long value, int base, int min, int max, int flags)
|
||||||
{
|
{
|
||||||
int signvalue = 0;
|
int signvalue = 0;
|
||||||
unsigned long uvalue;
|
unsigned long uvalue;
|
||||||
|
@ -463,7 +501,7 @@ static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
int spadlen = 0; /* amount to space pad */
|
int spadlen = 0; /* amount to space pad */
|
||||||
int zpadlen = 0; /* amount to zero pad */
|
int zpadlen = 0; /* amount to zero pad */
|
||||||
int caps = 0;
|
int caps = 0;
|
||||||
|
|
||||||
if (max < 0)
|
if (max < 0)
|
||||||
max = 0;
|
max = 0;
|
||||||
|
|
||||||
|
@ -477,12 +515,12 @@ static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (flags & DP_F_PLUS) /* Do a sign (+/i) */
|
if (flags & DP_F_PLUS) /* Do a sign (+/i) */
|
||||||
signvalue = '+';
|
signvalue = '+';
|
||||||
else
|
else
|
||||||
if (flags & DP_F_SPACE)
|
if (flags & DP_F_SPACE)
|
||||||
signvalue = ' ';
|
signvalue = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -503,27 +541,27 @@ static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
zpadlen = MAX(zpadlen, spadlen);
|
zpadlen = MAX(zpadlen, spadlen);
|
||||||
spadlen = 0;
|
spadlen = 0;
|
||||||
}
|
}
|
||||||
if (flags & DP_F_MINUS)
|
if (flags & DP_F_MINUS)
|
||||||
spadlen = -spadlen; /* Left Justifty */
|
spadlen = -spadlen; /* Left Justifty */
|
||||||
|
|
||||||
#ifdef DEBUG_SNPRINTF
|
#ifdef DEBUG_SNPRINTF
|
||||||
printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
|
printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n",
|
||||||
zpadlen, spadlen, min, max, place);
|
zpadlen, spadlen, min, max, place);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Spaces */
|
/* Spaces */
|
||||||
while (spadlen > 0)
|
while (spadlen > 0)
|
||||||
{
|
{
|
||||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||||
--spadlen;
|
--spadlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sign */
|
/* Sign */
|
||||||
if (signvalue)
|
if (signvalue)
|
||||||
dopr_outch (buffer, currlen, maxlen, signvalue);
|
dopr_outch (buffer, currlen, maxlen, signvalue);
|
||||||
|
|
||||||
/* Zeros */
|
/* Zeros */
|
||||||
if (zpadlen > 0)
|
if (zpadlen > 0)
|
||||||
{
|
{
|
||||||
while (zpadlen > 0)
|
while (zpadlen > 0)
|
||||||
{
|
{
|
||||||
|
@ -533,9 +571,9 @@ static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Digits */
|
/* Digits */
|
||||||
while (place > 0)
|
while (place > 0)
|
||||||
dopr_outch (buffer, currlen, maxlen, convert[--place]);
|
dopr_outch (buffer, currlen, maxlen, convert[--place]);
|
||||||
|
|
||||||
/* Left Justified spaces */
|
/* Left Justified spaces */
|
||||||
while (spadlen < 0) {
|
while (spadlen < 0) {
|
||||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||||
|
@ -543,6 +581,7 @@ static void fmtint (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_ABS_VAL
|
||||||
static LDOUBLE abs_val (LDOUBLE value)
|
static LDOUBLE abs_val (LDOUBLE value)
|
||||||
{
|
{
|
||||||
LDOUBLE result = value;
|
LDOUBLE result = value;
|
||||||
|
@ -552,7 +591,13 @@ static LDOUBLE abs_val (LDOUBLE value)
|
||||||
|
|
||||||
return result;
|
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)
|
static LDOUBLE pow10 (int exp)
|
||||||
{
|
{
|
||||||
LDOUBLE result = 1;
|
LDOUBLE result = 1;
|
||||||
|
@ -562,10 +607,12 @@ static LDOUBLE pow10 (int exp)
|
||||||
result *= 10;
|
result *= 10;
|
||||||
exp--;
|
exp--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef HAVE_ROUND
|
||||||
static long round (LDOUBLE value)
|
static long round (LDOUBLE value)
|
||||||
{
|
{
|
||||||
long intpart;
|
long intpart;
|
||||||
|
@ -577,9 +624,11 @@ static long round (LDOUBLE value)
|
||||||
|
|
||||||
return intpart;
|
return intpart;
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
#endif /* HAVE_FCVT */
|
||||||
|
|
||||||
static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
LDOUBLE fvalue, int min, int max, int flags)
|
LDOUBLE fvalue, int min, int max, int flags)
|
||||||
{
|
{
|
||||||
int signvalue = 0;
|
int signvalue = 0;
|
||||||
LDOUBLE ufvalue;
|
LDOUBLE ufvalue;
|
||||||
|
@ -601,12 +650,14 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
int iplace = 0;
|
int iplace = 0;
|
||||||
int fplace = 0;
|
int fplace = 0;
|
||||||
int padlen = 0; /* amount to pad */
|
int padlen = 0; /* amount to pad */
|
||||||
int zpadlen = 0;
|
int zpadlen = 0;
|
||||||
|
#ifndef HAVE_FCVT
|
||||||
int caps = 0;
|
int caps = 0;
|
||||||
long intpart;
|
long intpart;
|
||||||
long fracpart;
|
long fracpart;
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
|
/*
|
||||||
* AIX manpage says the default is 0, but Solaris says the default
|
* AIX manpage says the default is 0, but Solaris says the default
|
||||||
* is 6, and sprintf on AIX defaults to 6
|
* is 6, and sprintf on AIX defaults to 6
|
||||||
*/
|
*/
|
||||||
|
@ -622,7 +673,7 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
signvalue = '+';
|
signvalue = '+';
|
||||||
else
|
else
|
||||||
if (flags & DP_F_SPACE)
|
if (flags & DP_F_SPACE)
|
||||||
signvalue = ' ';
|
signvalue = ' ';
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
|
||||||
|
@ -631,8 +682,8 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
#ifndef HAVE_FCVT
|
#ifndef HAVE_FCVT
|
||||||
intpart = (long)ufvalue;
|
intpart = (long)ufvalue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sorry, we only support 9 digits past the decimal because of our
|
* Sorry, we only support 9 digits past the decimal because of our
|
||||||
* conversion method
|
* conversion method
|
||||||
*/
|
*/
|
||||||
if (max > 9)
|
if (max > 9)
|
||||||
|
@ -650,8 +701,8 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_SNPRINTF
|
#ifdef DEBUG_SNPRINTF
|
||||||
printf("fmtfp: %g %d.%d min=%d max=%d\n",
|
printf("fmtfp: %g %d.%d min=%d max=%d\n",
|
||||||
(double)fvalue, intpart, fracpart, min, max);
|
(double)fvalue, intpart, fracpart, min, max);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Convert integer part */
|
/* Convert integer part */
|
||||||
|
@ -707,38 +758,38 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
fconvert[fplace++] = result[--r_length];
|
fconvert[fplace++] = result[--r_length];
|
||||||
|
|
||||||
while ((dec_pt < 0) && (fplace < max)) {
|
while ((dec_pt < 0) && (fplace < max)) {
|
||||||
fconvert[fplace++] = '0';
|
fconvert[fplace++] = '0';
|
||||||
dec_pt++;
|
dec_pt++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
iplace=0;
|
iplace=0;
|
||||||
for(c=dec_pt; c; iconvert[iplace++] = result[--c])
|
for(c=dec_pt; c; iconvert[iplace++] = result[--c])
|
||||||
;
|
;
|
||||||
iconvert[iplace] = '\0';
|
iconvert[iplace] = '\0';
|
||||||
|
|
||||||
result += dec_pt;
|
result += dec_pt;
|
||||||
fplace = 0;
|
fplace = 0;
|
||||||
|
|
||||||
for(c=(r_length-dec_pt); c; fconvert[fplace++] = result[--c])
|
for(c=(r_length-dec_pt); c; fconvert[fplace++] = result[--c])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
#endif /* fcvt */
|
#endif /* fcvt */
|
||||||
|
|
||||||
/* -1 for decimal point, another -1 if we are printing a sign */
|
/* -1 for decimal point, another -1 if we are printing a sign */
|
||||||
padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
|
padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
|
||||||
zpadlen = max - fplace;
|
zpadlen = max - fplace;
|
||||||
if (zpadlen < 0)
|
if (zpadlen < 0)
|
||||||
zpadlen = 0;
|
zpadlen = 0;
|
||||||
if (padlen < 0)
|
if (padlen < 0)
|
||||||
padlen = 0;
|
padlen = 0;
|
||||||
if (flags & DP_F_MINUS)
|
if (flags & DP_F_MINUS)
|
||||||
padlen = -padlen; /* Left Justifty */
|
padlen = -padlen; /* Left Justifty */
|
||||||
|
|
||||||
if ((flags & DP_F_ZERO) && (padlen > 0))
|
if ((flags & DP_F_ZERO) && (padlen > 0))
|
||||||
{
|
{
|
||||||
if (signvalue)
|
if (signvalue)
|
||||||
{
|
{
|
||||||
dopr_outch (buffer, currlen, maxlen, signvalue);
|
dopr_outch (buffer, currlen, maxlen, signvalue);
|
||||||
--padlen;
|
--padlen;
|
||||||
|
@ -755,10 +806,10 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||||
--padlen;
|
--padlen;
|
||||||
}
|
}
|
||||||
if (signvalue)
|
if (signvalue)
|
||||||
dopr_outch (buffer, currlen, maxlen, signvalue);
|
dopr_outch (buffer, currlen, maxlen, signvalue);
|
||||||
|
|
||||||
while (iplace > 0)
|
while (iplace > 0)
|
||||||
dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
|
dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]);
|
||||||
|
|
||||||
|
|
||||||
|
@ -771,10 +822,10 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
* char to print out.
|
* char to print out.
|
||||||
*/
|
*/
|
||||||
if (max > 0) {
|
if (max > 0) {
|
||||||
dopr_outch (buffer, currlen, maxlen, '.');
|
dopr_outch (buffer, currlen, maxlen, '.');
|
||||||
|
|
||||||
while (fplace > 0)
|
while (fplace > 0)
|
||||||
dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
|
dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (zpadlen > 0)
|
while (zpadlen > 0)
|
||||||
|
@ -783,7 +834,7 @@ static void fmtfp (char *buffer, size_t *currlen, size_t maxlen,
|
||||||
--zpadlen;
|
--zpadlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (padlen < 0)
|
while (padlen < 0)
|
||||||
{
|
{
|
||||||
dopr_outch (buffer, currlen, maxlen, ' ');
|
dopr_outch (buffer, currlen, maxlen, ' ');
|
||||||
++padlen;
|
++padlen;
|
||||||
|
@ -820,7 +871,7 @@ static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
|
||||||
char *fmt;
|
char *fmt;
|
||||||
#endif
|
#endif
|
||||||
VA_LOCAL_DECL;
|
VA_LOCAL_DECL;
|
||||||
|
|
||||||
VA_START (fmt);
|
VA_START (fmt);
|
||||||
VA_SHIFT (str, char *);
|
VA_SHIFT (str, char *);
|
||||||
VA_SHIFT (count, size_t );
|
VA_SHIFT (count, size_t );
|
||||||
|
@ -860,7 +911,7 @@ static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
|
||||||
"%.1f",
|
"%.1f",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996,
|
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};
|
0.9996, 1.996, 4.136, 6442452944.1234, 0};
|
||||||
char *int_fmt[] = {
|
char *int_fmt[] = {
|
||||||
"%-1.5d",
|
"%-1.5d",
|
||||||
|
@ -888,9 +939,9 @@ static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
|
||||||
sprintf (buf2, fp_fmt[x], fp_nums[y]);
|
sprintf (buf2, fp_fmt[x], fp_nums[y]);
|
||||||
if (strcmp (buf1, buf2))
|
if (strcmp (buf1, buf2))
|
||||||
{
|
{
|
||||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
|
printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
|
||||||
fp_fmt[x], buf1, buf2);
|
fp_fmt[x], buf1, buf2);
|
||||||
fail++;
|
fail++;
|
||||||
}
|
}
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
@ -902,9 +953,9 @@ static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
|
||||||
sprintf (buf2, int_fmt[x], int_nums[y]);
|
sprintf (buf2, int_fmt[x], int_nums[y]);
|
||||||
if (strcmp (buf1, buf2))
|
if (strcmp (buf1, buf2))
|
||||||
{
|
{
|
||||||
printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
|
printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n",
|
||||||
int_fmt[x], buf1, buf2);
|
int_fmt[x], buf1, buf2);
|
||||||
fail++;
|
fail++;
|
||||||
}
|
}
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h" /* must be first */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -124,7 +126,10 @@ static void st_tree_node_add(st_tree_t **nptr, st_tree_t *sptr)
|
||||||
*nptr = sptr;
|
*nptr = sptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove a variable from a tree */
|
/* 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)
|
int state_delinfo(st_tree_t **nptr, const char *var)
|
||||||
{
|
{
|
||||||
while (*nptr) {
|
while (*nptr) {
|
||||||
|
@ -141,6 +146,11 @@ int state_delinfo(st_tree_t **nptr, const char *var)
|
||||||
continue;
|
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 */
|
/* whatever is on the left, hang it off current right */
|
||||||
st_tree_node_add(&node->right, node->left);
|
st_tree_node_add(&node->right, node->left);
|
||||||
|
|
||||||
|
@ -153,7 +163,7 @@ int state_delinfo(st_tree_t **nptr, const char *var)
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; /* not found */
|
return 0; /* not found */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* interface */
|
/* interface */
|
||||||
|
|
||||||
|
@ -218,7 +228,7 @@ static int st_tree_enum_add(enum_t **list, const char *enc)
|
||||||
list = &(*list)->next;
|
list = &(*list)->next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; /* duplicate */
|
return 0; /* duplicate */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +313,7 @@ int state_addrange(st_tree_t *root, const char *var, const int min, const int ma
|
||||||
int state_setaux(st_tree_t *root, const char *var, const char *auxs)
|
int state_setaux(st_tree_t *root, const char *var, const char *auxs)
|
||||||
{
|
{
|
||||||
st_tree_t *sttmp;
|
st_tree_t *sttmp;
|
||||||
int aux;
|
long aux;
|
||||||
|
|
||||||
/* find the tree node for var */
|
/* find the tree node for var */
|
||||||
sttmp = state_tree_find(root, var);
|
sttmp = state_tree_find(root, var);
|
||||||
|
@ -354,7 +364,7 @@ int state_getflags(st_tree_t *root, const char *var)
|
||||||
return sttmp->flags;
|
return sttmp->flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
int state_getaux(st_tree_t *root, const char *var)
|
long state_getaux(st_tree_t *root, const char *var)
|
||||||
{
|
{
|
||||||
st_tree_t *sttmp;
|
st_tree_t *sttmp;
|
||||||
|
|
||||||
|
@ -396,9 +406,9 @@ const range_t *state_getrangelist(st_tree_t *root, const char *var)
|
||||||
return sttmp->range_list;
|
return sttmp->range_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
void state_setflags(st_tree_t *root, const char *var, int numflags, char **flag)
|
void state_setflags(st_tree_t *root, const char *var, size_t numflags, char **flag)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
st_tree_t *sttmp;
|
st_tree_t *sttmp;
|
||||||
|
|
||||||
/* find the tree node for var */
|
/* find the tree node for var */
|
||||||
|
@ -424,6 +434,11 @@ void state_setflags(st_tree_t *root, const char *var, int numflags, char **flag)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!strcasecmp(flag[i], "NUMBER")) {
|
||||||
|
sttmp->flags |= ST_FLAG_NUMBER;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
upsdebugx(2, "Unrecognized flag [%s]", flag[i]);
|
upsdebugx(2, "Unrecognized flag [%s]", flag[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
629
common/str.c
Normal file
629
common/str.c
Normal file
|
@ -0,0 +1,629 @@
|
||||||
|
/* 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));
|
||||||
|
}
|
|
@ -11,6 +11,16 @@ char *strerror(int errnum)
|
||||||
{
|
{
|
||||||
static char buf[32];
|
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) {
|
switch (errnum) {
|
||||||
#if defined (EPERM)
|
#if defined (EPERM)
|
||||||
case EPERM:
|
case EPERM:
|
||||||
|
@ -498,6 +508,11 @@ char *strerror(int errnum)
|
||||||
/* Fallback: just print the error number */
|
/* Fallback: just print the error number */
|
||||||
snprintf(buf, sizeof(buf), "Error %d", errnum);
|
snprintf(buf, sizeof(buf), "Error %d", errnum);
|
||||||
return buf;
|
return buf;
|
||||||
|
|
||||||
|
#ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_STRERROR */
|
#endif /* HAVE_STRERROR */
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h" /* must be the first header */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -29,14 +31,14 @@
|
||||||
static char *ups_section;
|
static char *ups_section;
|
||||||
|
|
||||||
/* handle arguments separated by parseconf */
|
/* handle arguments separated by parseconf */
|
||||||
static void conf_args(int numargs, char **arg)
|
static void conf_args(size_t numargs, char **arg)
|
||||||
{
|
{
|
||||||
if (numargs < 1)
|
if (numargs < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* look for section headers - [upsname] */
|
/* look for section headers - [upsname] */
|
||||||
if ((arg[0][0] == '[') && (arg[0][strlen(arg[0])-1] == ']')) {
|
if ((arg[0][0] == '[') && (arg[0][strlen(arg[0])-1] == ']')) {
|
||||||
|
|
||||||
free(ups_section);
|
free(ups_section);
|
||||||
|
|
||||||
arg[0][strlen(arg[0])-1] = '\0';
|
arg[0][strlen(arg[0])-1] = '\0';
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
INSTALL_0600 = $(INSTALL) -m 0600
|
INSTALL_0600 = $(INSTALL) -m 0600
|
||||||
|
|
||||||
SECFILES = upsmon.conf.sample upsd.conf.sample upsd.users.sample
|
SECFILES = upsd.conf.sample upsd.users.sample
|
||||||
PUBFILES = nut.conf.sample ups.conf.sample
|
PUBFILES = nut.conf.sample ups.conf.sample
|
||||||
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
||||||
upsstats-single.html.sample
|
upsstats-single.html.sample
|
||||||
|
@ -14,4 +14,28 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
|
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
|
||||||
nodist_sysconf_DATA = upssched.conf.sample
|
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
|
||||||
|
|
274
conf/Makefile.in
274
conf/Makefile.in
|
@ -1,9 +1,8 @@
|
||||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
@ -18,6 +17,61 @@
|
||||||
# Network UPS Tools: conf
|
# Network UPS Tools: conf
|
||||||
|
|
||||||
VPATH = @srcdir@
|
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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
@ -38,42 +92,70 @@ build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
target_triplet = @target@
|
target_triplet = @target@
|
||||||
subdir = conf
|
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
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.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 \
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_asciidoc.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_libavahi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libnetsnmp.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_libpowerman.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||||
$(top_srcdir)/m4/nut_config_libhal.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_report_feature.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||||
$(top_srcdir)/configure.in
|
$(top_srcdir)/configure.ac
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
|
DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_sysconf_DATA_DIST) \
|
||||||
|
$(am__DIST_COMMON)
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||||
CONFIG_CLEAN_FILES = upssched.conf.sample
|
CONFIG_CLEAN_FILES = upsmon.conf.sample upssched.conf.sample
|
||||||
CONFIG_CLEAN_VPATH_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 =
|
SOURCES =
|
||||||
DIST_SOURCES =
|
DIST_SOURCES =
|
||||||
am__dist_sysconf_DATA_DIST = upsmon.conf.sample upsd.conf.sample \
|
am__can_run_installinfo = \
|
||||||
upsd.users.sample nut.conf.sample ups.conf.sample \
|
case $$AM_UPDATE_INFO_DIR in \
|
||||||
hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
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 \
|
||||||
upsstats-single.html.sample
|
upsstats-single.html.sample
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
am__vpath_adj = case $$p in \
|
am__vpath_adj = case $$p in \
|
||||||
|
@ -96,14 +178,27 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
||||||
am__base_list = \
|
am__base_list = \
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||||
sed '$$!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)"
|
am__installdirs = "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(sysconfdir)"
|
||||||
DATA = $(dist_sysconf_DATA) $(nodist_sysconf_DATA)
|
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)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
A2X = @A2X@
|
A2X = @A2X@
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
|
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
ASCIIDOC = @ASCIIDOC@
|
ASCIIDOC = @ASCIIDOC@
|
||||||
|
ASPELL = @ASPELL@
|
||||||
|
AUGPARSE = @AUGPARSE@
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
@ -114,16 +209,25 @@ CCDEPMODE = @CCDEPMODE@
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
CONFPATH = @CONFPATH@
|
CONFPATH = @CONFPATH@
|
||||||
CPP = @CPP@
|
CPP = @CPP@
|
||||||
|
CPPCHECK = @CPPCHECK@
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||||
|
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
CYGPATH_W = @CYGPATH_W@
|
CYGPATH_W = @CYGPATH_W@
|
||||||
DBLATEX = @DBLATEX@
|
DBLATEX = @DBLATEX@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
DEPDIR = @DEPDIR@
|
DEPDIR = @DEPDIR@
|
||||||
DLLTOOL = @DLLTOOL@
|
DLLTOOL = @DLLTOOL@
|
||||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||||
|
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||||
|
DRVPATH = @DRVPATH@
|
||||||
DSYMUTIL = @DSYMUTIL@
|
DSYMUTIL = @DSYMUTIL@
|
||||||
DUMPBIN = @DUMPBIN@
|
DUMPBIN = @DUMPBIN@
|
||||||
ECHO_C = @ECHO_C@
|
ECHO_C = @ECHO_C@
|
||||||
|
@ -132,11 +236,8 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
FGREP = @FGREP@
|
FGREP = @FGREP@
|
||||||
|
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||||
GREP = @GREP@
|
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@
|
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
@ -146,14 +247,15 @@ LD = @LD@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||||
|
LIBDIR = @LIBDIR@
|
||||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
|
||||||
LIBHAL_LIBS = @LIBHAL_LIBS@
|
|
||||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||||
|
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||||
|
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||||
|
@ -164,21 +266,29 @@ LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||||
|
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||||
LIBTOOL = @LIBTOOL@
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||||
|
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||||
LIPO = @LIPO@
|
LIPO = @LIPO@
|
||||||
LN_S = @LN_S@
|
LN_S = @LN_S@
|
||||||
|
LN_S_R = @LN_S_R@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||||
MAINT = @MAINT@
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
NETLIBS = @NETLIBS@
|
NETLIBS = @NETLIBS@
|
||||||
|
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||||
NM = @NM@
|
NM = @NM@
|
||||||
NMEDIT = @NMEDIT@
|
NMEDIT = @NMEDIT@
|
||||||
|
NUT_DATADIR = @NUT_DATADIR@
|
||||||
|
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||||
NUT_NETVERSION = @NUT_NETVERSION@
|
NUT_NETVERSION = @NUT_NETVERSION@
|
||||||
OBJDUMP = @OBJDUMP@
|
OBJDUMP = @OBJDUMP@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
@ -198,6 +308,9 @@ PKG_CONFIG = @PKG_CONFIG@
|
||||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||||
PORT = @PORT@
|
PORT = @PORT@
|
||||||
|
PYTHON = @PYTHON@
|
||||||
|
PYTHON2 = @PYTHON2@
|
||||||
|
PYTHON3 = @PYTHON3@
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||||
RUN_AS_USER = @RUN_AS_USER@
|
RUN_AS_USER = @RUN_AS_USER@
|
||||||
|
@ -206,24 +319,30 @@ SED = @SED@
|
||||||
SERLIBS = @SERLIBS@
|
SERLIBS = @SERLIBS@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
|
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||||
STATEPATH = @STATEPATH@
|
STATEPATH = @STATEPATH@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
SUN_LIBUSB = @SUN_LIBUSB@
|
SUN_LIBUSB = @SUN_LIBUSB@
|
||||||
TREE_VERSION = @TREE_VERSION@
|
TREE_VERSION = @TREE_VERSION@
|
||||||
|
VALGRIND = @VALGRIND@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||||
|
XMLLINT = @XMLLINT@
|
||||||
|
XSLTPROC = @XSLTPROC@
|
||||||
abs_builddir = @abs_builddir@
|
abs_builddir = @abs_builddir@
|
||||||
abs_srcdir = @abs_srcdir@
|
abs_srcdir = @abs_srcdir@
|
||||||
abs_top_builddir = @abs_top_builddir@
|
abs_top_builddir = @abs_top_builddir@
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
ac_ct_AR = @ac_ct_AR@
|
ac_ct_AR = @ac_ct_AR@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||||
am__include = @am__include@
|
am__include = @am__include@
|
||||||
am__leading_dot = @am__leading_dot@
|
am__leading_dot = @am__leading_dot@
|
||||||
am__quote = @am__quote@
|
am__quote = @am__quote@
|
||||||
am__tar = @am__tar@
|
am__tar = @am__tar@
|
||||||
am__untar = @am__untar@
|
am__untar = @am__untar@
|
||||||
|
auglensdir = @auglensdir@
|
||||||
bindir = @bindir@
|
bindir = @bindir@
|
||||||
build = @build@
|
build = @build@
|
||||||
build_alias = @build_alias@
|
build_alias = @build_alias@
|
||||||
|
@ -234,8 +353,12 @@ builddir = @builddir@
|
||||||
cgiexecdir = @cgiexecdir@
|
cgiexecdir = @cgiexecdir@
|
||||||
datadir = @datadir@
|
datadir = @datadir@
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
|
devddir = @devddir@
|
||||||
docdir = @docdir@
|
docdir = @docdir@
|
||||||
driverexecdir = @driverexecdir@
|
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@
|
dvidir = @dvidir@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
host = @host@
|
host = @host@
|
||||||
|
@ -254,18 +377,21 @@ localedir = @localedir@
|
||||||
localstatedir = @localstatedir@
|
localstatedir = @localstatedir@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
mkdir_p = @mkdir_p@
|
mkdir_p = @mkdir_p@
|
||||||
|
now = @now@
|
||||||
oldincludedir = @oldincludedir@
|
oldincludedir = @oldincludedir@
|
||||||
pdfdir = @pdfdir@
|
pdfdir = @pdfdir@
|
||||||
pkgconfigdir = @pkgconfigdir@
|
pkgconfigdir = @pkgconfigdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemdsystemshutdowndir = @systemdsystemshutdowndir@
|
systemdshutdowndir = @systemdshutdowndir@
|
||||||
systemdsystemunitdir = @systemdsystemunitdir@
|
systemdsystemunitdir = @systemdsystemunitdir@
|
||||||
|
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||||
target = @target@
|
target = @target@
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
target_cpu = @target_cpu@
|
target_cpu = @target_cpu@
|
||||||
|
@ -276,7 +402,7 @@ top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
udevdir = @udevdir@
|
udevdir = @udevdir@
|
||||||
INSTALL_0600 = $(INSTALL) -m 0600
|
INSTALL_0600 = $(INSTALL) -m 0600
|
||||||
SECFILES = upsmon.conf.sample upsd.conf.sample upsd.users.sample
|
SECFILES = upsd.conf.sample upsd.users.sample
|
||||||
PUBFILES = nut.conf.sample ups.conf.sample
|
PUBFILES = nut.conf.sample ups.conf.sample
|
||||||
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
||||||
upsstats-single.html.sample
|
upsstats-single.html.sample
|
||||||
|
@ -284,10 +410,16 @@ CGIPUB = hosts.conf.sample upsset.conf.sample upsstats.html.sample \
|
||||||
@WITH_CGI_FALSE@CGI_INSTALL =
|
@WITH_CGI_FALSE@CGI_INSTALL =
|
||||||
@WITH_CGI_TRUE@CGI_INSTALL = $(CGIPUB)
|
@WITH_CGI_TRUE@CGI_INSTALL = $(CGIPUB)
|
||||||
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
|
dist_sysconf_DATA = $(SECFILES) $(PUBFILES) $(CGI_INSTALL)
|
||||||
nodist_sysconf_DATA = upssched.conf.sample
|
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
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .in .in-spellchecked .sample .sample-spellchecked
|
||||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||||
@for dep in $?; do \
|
@for dep in $?; do \
|
||||||
case '$(am__configure_deps)' in \
|
case '$(am__configure_deps)' in \
|
||||||
|
@ -300,14 +432,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu conf/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu conf/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu conf/Makefile
|
$(AUTOMAKE) --gnu conf/Makefile
|
||||||
.PRECIOUS: Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
@ -318,6 +449,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||||
$(am__aclocal_m4_deps):
|
$(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
|
upssched.conf.sample: $(top_builddir)/config.status $(srcdir)/upssched.conf.sample.in
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||||
|
|
||||||
|
@ -328,8 +461,11 @@ clean-libtool:
|
||||||
-rm -rf .libs _libs
|
-rm -rf .libs _libs
|
||||||
install-dist_sysconfDATA: $(dist_sysconf_DATA)
|
install-dist_sysconfDATA: $(dist_sysconf_DATA)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)"
|
|
||||||
@list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
@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 \
|
for p in $$list; do \
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
echo "$$d$$p"; \
|
echo "$$d$$p"; \
|
||||||
|
@ -343,13 +479,14 @@ uninstall-dist_sysconfDATA:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
@list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
@list='$(dist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||||
test -n "$$files" || exit 0; \
|
dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir)
|
||||||
echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \
|
|
||||||
cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files
|
|
||||||
install-nodist_sysconfDATA: $(nodist_sysconf_DATA)
|
install-nodist_sysconfDATA: $(nodist_sysconf_DATA)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)"
|
|
||||||
@list='$(nodist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
@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 \
|
for p in $$list; do \
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
echo "$$d$$p"; \
|
echo "$$d$$p"; \
|
||||||
|
@ -363,17 +500,18 @@ uninstall-nodist_sysconfDATA:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
@list='$(nodist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
@list='$(nodist_sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||||
test -n "$$files" || exit 0; \
|
dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir)
|
||||||
echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \
|
tags TAGS:
|
||||||
cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files
|
|
||||||
tags: TAGS
|
|
||||||
TAGS:
|
|
||||||
|
|
||||||
ctags: CTAGS
|
ctags CTAGS:
|
||||||
CTAGS:
|
|
||||||
|
cscope cscopelist:
|
||||||
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
distdir: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||||
|
|
||||||
|
distdir-am: $(DISTFILES)
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
@ -420,13 +558,19 @@ install-am: all-am
|
||||||
|
|
||||||
installcheck: installcheck-am
|
installcheck: installcheck-am
|
||||||
install-strip:
|
install-strip:
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
if test -z '$(STRIP)'; then \
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
`test -z '$(STRIP)' || \
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
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
|
||||||
mostlyclean-generic:
|
mostlyclean-generic:
|
||||||
|
|
||||||
clean-generic:
|
clean-generic:
|
||||||
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
distclean-generic:
|
distclean-generic:
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
@ -435,6 +579,7 @@ distclean-generic:
|
||||||
maintainer-clean-generic:
|
maintainer-clean-generic:
|
||||||
@echo "This command is intended for maintainers to use"
|
@echo "This command is intended for maintainers to use"
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||||
clean: clean-am
|
clean: clean-am
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
@ -504,18 +649,39 @@ uninstall-am: uninstall-dist_sysconfDATA uninstall-nodist_sysconfDATA
|
||||||
.MAKE: install-am install-strip
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||||
distclean distclean-generic distclean-libtool distdir dvi \
|
cscopelist-am ctags-am distclean distclean-generic \
|
||||||
dvi-am html html-am info info-am install install-am \
|
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||||
install-data install-data-am install-dist_sysconfDATA \
|
install install-am install-data install-data-am \
|
||||||
install-dvi install-dvi-am install-exec install-exec-am \
|
install-dist_sysconfDATA install-dvi install-dvi-am \
|
||||||
install-html install-html-am install-info install-info-am \
|
install-exec install-exec-am install-html install-html-am \
|
||||||
install-man install-nodist_sysconfDATA install-pdf \
|
install-info install-info-am install-man \
|
||||||
install-pdf-am install-ps install-ps-am install-strip \
|
install-nodist_sysconfDATA install-pdf install-pdf-am \
|
||||||
installcheck installcheck-am installdirs maintainer-clean \
|
install-ps install-ps-am install-strip installcheck \
|
||||||
|
installcheck-am installdirs maintainer-clean \
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||||
uninstall-dist_sysconfDATA uninstall-nodist_sysconfDATA
|
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.
|
# 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.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#
|
#
|
||||||
# MONITOR <system> "<host description>"
|
# MONITOR <system> "<host description>"
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
#
|
#
|
||||||
# MONITOR myups@localhost "Local UPS"
|
# MONITOR myups@localhost "Local UPS"
|
||||||
# MONITOR su2200@10.64.1.1 "Finance department"
|
# MONITOR su2200@10.64.1.1 "Finance department"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# The values of MODE can be:
|
# The values of MODE can be:
|
||||||
# - none: NUT is not configured, or use the Integrated Power Management, or use
|
# - none: NUT is not configured, or use the Integrated Power Management, or use
|
||||||
# some external system to startup NUT components. So nothing is to be started.
|
# some external system to startup NUT components. So nothing is to be started.
|
||||||
# - standalone: This mode address a local only configuration, with 1 UPS
|
# - standalone: This mode address a local only configuration, with 1 UPS
|
||||||
# protecting the local system. This implies to start the 3 NUT layers (driver,
|
# protecting the local system. This implies to start the 3 NUT layers (driver,
|
||||||
# upsd and upsmon) and the matching configuration files. This mode can also
|
# upsd and upsmon) and the matching configuration files. This mode can also
|
||||||
# address UPS redundancy.
|
# address UPS redundancy.
|
||||||
|
@ -26,7 +26,14 @@
|
||||||
# - netclient: this mode only requires upsmon.
|
# - netclient: this mode only requires upsmon.
|
||||||
#
|
#
|
||||||
# IMPORTANT NOTE:
|
# IMPORTANT NOTE:
|
||||||
# This file is intended to be sourced by shell scripts.
|
# 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!
|
# You MUST NOT use spaces around the equal sign!
|
||||||
|
|
||||||
MODE=none
|
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
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# --- SECURITY NOTE ---
|
# --- SECURITY NOTE ---
|
||||||
#
|
#
|
||||||
# If you use snmp-ups and set a community string in here, you
|
# If you use snmp-ups and set a community string in here, you
|
||||||
# will have to secure this file to keep other users from obtaining
|
# will have to secure this file to keep other users from obtaining
|
||||||
# that string. It needs to be readable by upsdrvctl and any drivers,
|
# that string. It needs to be readable by upsdrvctl and any drivers,
|
||||||
# and by upsd.
|
# and by upsd.
|
||||||
|
@ -14,71 +14,169 @@
|
||||||
# USB devices and SNMP devices are also supported.
|
# USB devices and SNMP devices are also supported.
|
||||||
#
|
#
|
||||||
# This file is used by upsdrvctl to start and stop your driver(s), and
|
# This file is used by upsdrvctl to start and stop your driver(s), and
|
||||||
# is also used by upsd to determine which drivers to monitor. The
|
# is also used by upsd to determine which drivers to monitor. The
|
||||||
# drivers themselves also read this file for configuration directives.
|
# drivers themselves also read this file for configuration directives.
|
||||||
#
|
#
|
||||||
# The general form is:
|
# The general form is:
|
||||||
#
|
#
|
||||||
# [upsname]
|
# [upsname]
|
||||||
# driver = <drivername>
|
# driver = <drivername>
|
||||||
# port = <portname>
|
# port = <portname>
|
||||||
# < any other directives here >
|
# < any other directives here >
|
||||||
#
|
#
|
||||||
# The section header ([upsname]) can be just about anything as long as
|
# The section header ([upsname]) can be just about anything as long as
|
||||||
# it is a single word inside brackets. upsd uses this to uniquely
|
# it is a single word inside brackets. upsd uses this to uniquely
|
||||||
# identify a UPS on this system.
|
# identify a UPS on this system.
|
||||||
#
|
#
|
||||||
# If you have a UPS called snoopy, your section header would be "[snoopy]".
|
# 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
|
# On a system called "doghouse", the line in your upsmon.conf to monitor
|
||||||
# it would look something like this:
|
# and manage it would look something like this:
|
||||||
#
|
#
|
||||||
# MONITOR snoopy@doghouse 1 upsmonuser mypassword master
|
# MONITOR snoopy@doghouse 1 upsmonuser mypassword primary
|
||||||
#
|
#
|
||||||
# It might look like this if monitoring in slave mode:
|
# It might look like this if monitoring in "secondary" mode (without any
|
||||||
|
# ability to directly manage the UPS) from a different system:
|
||||||
#
|
#
|
||||||
# MONITOR snoopy@doghouse 1 upsmonuser mypassword slave
|
# MONITOR snoopy@doghouse 1 upsmonuser mypassword secondary
|
||||||
#
|
#
|
||||||
# Configuration directives
|
# 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:
|
# These directives are common to all drivers that support ups.conf:
|
||||||
#
|
#
|
||||||
# driver: REQUIRED. Specify the program to run to talk to this UPS.
|
# driver: REQUIRED. Specify the program to run to talk to this UPS.
|
||||||
# apcsmart, bestups, and sec are some examples.
|
# apcsmart, bestups, and sec are some examples.
|
||||||
#
|
#
|
||||||
# port: REQUIRED. The serial port where your UPS is connected.
|
# port: REQUIRED. The serial port where your UPS is connected.
|
||||||
# /dev/ttyS0 is usually the first port on Linux boxes, for example.
|
# /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
|
# 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
|
# shuts down all the 0s, then the 1s, 2s, and so on. To exclude
|
||||||
# a UPS from the shutdown sequence, set this to -1.
|
# a UPS from the shutdown sequence, set this to -1.
|
||||||
#
|
#
|
||||||
# The default value for this parameter is 0.
|
# 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.
|
# nolock: optional, and not recommended for use in this file.
|
||||||
#
|
#
|
||||||
# If you put nolock in here, the driver will not lock the
|
# If you put nolock in here, the driver will not lock the
|
||||||
# serial port every time it starts. This may allow other
|
# serial port every time it starts. This may allow other
|
||||||
# processes to seize the port if you start more than one by
|
# processes to seize the port if you start more than one by
|
||||||
# mistake.
|
# mistake.
|
||||||
#
|
#
|
||||||
# This is only intended to be used on systems where locking
|
# This is only intended to be used on systems where locking
|
||||||
# absolutely must be disabled for the software to work.
|
# absolutely must be disabled for the software to work.
|
||||||
#
|
#
|
||||||
# maxstartdelay: optional. This can be set as a global variable
|
# ignorelb: OPTIONAL. Ignore low battery condition reported by device,
|
||||||
# above your first UPS definition and it can also be
|
# and evaluate remaining battery charge or runtime instead.
|
||||||
# set in a UPS section. This value controls how long
|
# See man page for details.
|
||||||
# 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.
|
# 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.
|
||||||
#
|
#
|
||||||
|
# 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
|
# Anything else is passed through to the hardware-specific part of
|
||||||
# the driver.
|
# the driver.
|
||||||
#
|
#
|
||||||
# Examples
|
# Examples
|
||||||
# --------
|
# --------
|
||||||
#
|
#
|
||||||
|
@ -86,19 +184,19 @@
|
||||||
# driver on /dev/ttyS0 is:
|
# driver on /dev/ttyS0 is:
|
||||||
#
|
#
|
||||||
# [powerpal]
|
# [powerpal]
|
||||||
# driver = blazer_ser
|
# driver = blazer_ser
|
||||||
# port = /dev/ttyS0
|
# port = /dev/ttyS0
|
||||||
# desc = "Web server"
|
# desc = "Web server"
|
||||||
#
|
#
|
||||||
# If your UPS driver requires additional settings, you can specify them
|
# If your UPS driver requires additional settings, you can specify them
|
||||||
# here. For example, if it supports a setting of "1234" for the
|
# here. For example, if it supports a setting of "1234" for the
|
||||||
# variable "cable", it would look like this:
|
# variable "cable", it would look like this:
|
||||||
#
|
#
|
||||||
# [myups]
|
# [myups]
|
||||||
# driver = mydriver
|
# driver = mydriver
|
||||||
# port = /dev/ttyS1
|
# port = /dev/ttyS1
|
||||||
# cable = 1234
|
# cable = 1234
|
||||||
# desc = "Something descriptive"
|
# desc = "Something descriptive"
|
||||||
#
|
#
|
||||||
# To find out if your driver supports any extra settings, start it with
|
# To find out if your driver supports any extra settings, start it with
|
||||||
# the -h option and/or read the driver's documentation.
|
# the -h option and/or read the driver's documentation.
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
# It should only be readable by the user that upsd becomes. See the FAQ.
|
# It should only be readable by the user that upsd becomes. See the FAQ.
|
||||||
#
|
#
|
||||||
# Each entry below provides usage and default value.
|
# Each entry below provides usage and default value.
|
||||||
|
#
|
||||||
|
# For more information, refer to upsd.conf manual page.
|
||||||
|
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
# MAXAGE <seconds>
|
# MAXAGE <seconds>
|
||||||
|
@ -19,6 +21,29 @@
|
||||||
# the data fresh within the normal 15 second interval. Watch the syslog
|
# the data fresh within the normal 15 second interval. Watch the syslog
|
||||||
# for notifications from upsd about staleness.
|
# 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 <path>
|
||||||
# STATEPATH /var/run/nut
|
# STATEPATH /var/run/nut
|
||||||
|
@ -27,15 +52,17 @@
|
||||||
# than the default that was compiled into the program.
|
# than the default that was compiled into the program.
|
||||||
|
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
# LISTEN <address> [<port>]
|
# LISTEN <IP address or name> [<port>]
|
||||||
# LISTEN 127.0.0.1 3493
|
# LISTEN 127.0.0.1 3493
|
||||||
# LISTEN ::1 3493
|
# LISTEN ::1 3493
|
||||||
|
# LISTEN myhostname 83493
|
||||||
|
# LISTEN myhostname.mydomain
|
||||||
#
|
#
|
||||||
# This defaults to the localhost listening addresses and port 3493.
|
# 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.
|
# In case of IP v4 or v6 disabled kernel, only the available one will be used.
|
||||||
#
|
#
|
||||||
# You may specify each interface you want upsd to listen on for connections,
|
# You may specify each interface IP address or name that you want upsd to
|
||||||
# optionally with a port number.
|
# listen on for connections, optionally with a port number.
|
||||||
#
|
#
|
||||||
# You may need this if you have multiple interfaces on your machine and
|
# 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
|
# you don't want upsd to listen to all interfaces (for instance on a
|
||||||
|
@ -55,10 +82,87 @@
|
||||||
|
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
# CERTFILE <certificate file>
|
# CERTFILE <certificate file>
|
||||||
|
# CERTFILE /usr/local/ups/etc/upsd.pem
|
||||||
#
|
#
|
||||||
# When compiled with SSL support, you can enter the certificate file here.
|
# 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 certificates must be in PEM format and must be sorted starting with
|
||||||
# the subject's certificate (server certificate), followed by intermediate
|
# the subject's certificate (server certificate), followed by intermediate
|
||||||
# CA certificates (if applicable_ and the highest level (root) CA. It should
|
# 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
|
# 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.
|
# 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.
|
||||||
|
|
|
@ -18,25 +18,25 @@
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# actions: Let the user do certain things with upsd.
|
# actions: Let the user do certain things with upsd.
|
||||||
#
|
#
|
||||||
# Valid actions are:
|
# Valid actions are:
|
||||||
#
|
#
|
||||||
# SET - change the value of certain variables in the UPS
|
# SET - change the value of certain variables in the UPS
|
||||||
# FSD - set the "forced shutdown" flag in the UPS
|
# FSD - set the "forced shutdown" flag in the UPS
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# instcmds: Let the user initiate specific instant commands. Use "ALL"
|
# instcmds: Let the user initiate specific instant commands. Use "ALL"
|
||||||
# to grant all commands automatically. There are many possible
|
# to grant all commands automatically. There are many possible
|
||||||
# commands, so use 'upscmd -l' to see what your hardware supports. Here
|
# commands, so use 'upscmd -l' to see what your hardware supports. Here
|
||||||
# are a few examples:
|
# are a few examples:
|
||||||
#
|
#
|
||||||
# test.panel.start - Start a front panel test
|
# test.panel.start - Start a front panel test
|
||||||
# test.battery.start - Start battery test
|
# test.battery.start - Start battery test
|
||||||
# test.battery.stop - Stop battery test
|
# test.battery.stop - Stop battery test
|
||||||
# calibrate.start - Start calibration
|
# calibrate.start - Start calibration
|
||||||
# calibrate.stop - Stop calibration
|
# calibrate.stop - Stop calibration
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -61,12 +61,15 @@
|
||||||
#
|
#
|
||||||
# To add a user for your upsmon, use this example:
|
# To add a user for your upsmon, use this example:
|
||||||
#
|
#
|
||||||
# [upsmon]
|
# [upsmon]
|
||||||
# password = pass
|
# password = pass
|
||||||
# upsmon master
|
# upsmon primary
|
||||||
# or
|
# or
|
||||||
# upsmon slave
|
# upsmon secondary
|
||||||
#
|
#
|
||||||
# The matching MONITOR line in your upsmon.conf would look like this:
|
# The matching MONITOR line in your upsmon.conf would look like this:
|
||||||
#
|
#
|
||||||
# MONITOR myups@localhost 1 upsmon pass master (or slave)
|
# 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.
|
||||||
|
|
|
@ -1,299 +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 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
|
|
453
conf/upsmon.conf.sample.in
Normal file
453
conf/upsmon.conf.sample.in
Normal file
|
@ -0,0 +1,453 @@
|
||||||
|
# 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.
|
|
@ -25,7 +25,7 @@ CMDSCRIPT @BINDIR@/upssched-cmd
|
||||||
# normal users can't create the file, due to the possibility of symlinking
|
# normal users can't create the file, due to the possibility of symlinking
|
||||||
# and other evil.
|
# and other evil.
|
||||||
#
|
#
|
||||||
# Note: if you are running Solaris or similar, the permissions that
|
# Note: if you are running Solaris or similar, the permissions that
|
||||||
# upssched sets on this file *are not enough* to keep you safe. If
|
# upssched sets on this file *are not enough* to keep you safe. If
|
||||||
# your OS ignores the permissions on a FIFO, then you MUST put this in
|
# your OS ignores the permissions on a FIFO, then you MUST put this in
|
||||||
# a protected directory!
|
# a protected directory!
|
||||||
|
@ -67,9 +67,9 @@ CMDSCRIPT @BINDIR@/upssched-cmd
|
||||||
# <upsname> can be the special value * to apply this handler to every
|
# <upsname> can be the special value * to apply this handler to every
|
||||||
# possible value of <upsname>.
|
# possible value of <upsname>.
|
||||||
#
|
#
|
||||||
# Run the command <command> via your CMDSCRIPT when it happens.
|
# Run the command <command> via your CMDSCRIPT when it happens.
|
||||||
#
|
#
|
||||||
# Note that any AT that matches both the <notifytype> and the <upsname>
|
# Note that any AT that matches both the <notifytype> and the <upsname>
|
||||||
# for the current event will be used.
|
# for the current event will be used.
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
@ -83,9 +83,15 @@ CMDSCRIPT @BINDIR@/upssched-cmd
|
||||||
# argument.
|
# argument.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# Start a timer that'll execute when any UPS (*) has been gone 10 seconds
|
# 1) Start a timer that will execute when communication with any UPS (*) has
|
||||||
|
# been gone for 10 seconds
|
||||||
#
|
#
|
||||||
# AT COMMBAD * START-TIMER upsgone 10
|
# 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
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -95,10 +101,15 @@ CMDSCRIPT @BINDIR@/upssched-cmd
|
||||||
# has passed then pass the optional argument <cmd> to CMDSCRIPT.
|
# has passed then pass the optional argument <cmd> to CMDSCRIPT.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# If a specific UPS (myups@localhost) comes back online, then stop the
|
# 1) If a specific UPS (myups@localhost) communication is restored, then stop
|
||||||
# timer before it triggers
|
# the timer before it triggers
|
||||||
#
|
#
|
||||||
# AT COMMOK myups@localhost CANCEL-TIMER upsgone
|
# 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
|
||||||
|
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
#
|
#
|
||||||
# This file is provided to ensure that you do not expose your upsd server
|
# This file is provided to ensure that you do not expose your upsd server
|
||||||
# to the world upon installing the CGI programs. Specifically, it keeps
|
# to the world upon installing the CGI programs. Specifically, it keeps
|
||||||
# the upsset.cgi program from running until you have assured it that you
|
# the upsset.cgi program from running until you have assured it that you
|
||||||
# have secured your web server's CGI directory.
|
# have secured your web server's CGI directory.
|
||||||
#
|
#
|
||||||
# By default, your web server will probably let anyone access upsset.cgi
|
# By default, your web server will probably let anyone access upsset.cgi
|
||||||
# once it is installed. This means that anyone could attempt to crack
|
# once it is installed. This means that anyone could attempt to crack
|
||||||
# upsd logins since they would appear to be coming from your web server,
|
# upsd logins since they would appear to be coming from your web server,
|
||||||
# rather than the outside world, slipping through any ACL/ACCESS definitions.
|
# rather than the outside world, slipping through any ACL/ACCESS definitions.
|
||||||
#
|
#
|
||||||
# For this reason, you *MUST* first secure your CGI programs before
|
# For this reason, you *MUST* first secure your CGI programs before
|
||||||
|
@ -17,17 +17,17 @@
|
||||||
# For Apache, the .htaccess file can be used in the directory with the
|
# For Apache, the .htaccess file can be used in the directory with the
|
||||||
# programs. You'll need something like this:
|
# programs. You'll need something like this:
|
||||||
#
|
#
|
||||||
# <Files upsset.cgi>
|
# <Files upsset.cgi>
|
||||||
# deny from all
|
# deny from all
|
||||||
# allow from your.network.addresses
|
# allow from your.network.addresses
|
||||||
# </Files>
|
# </Files>
|
||||||
#
|
#
|
||||||
# You will probably have to set "AllowOverride Limit" for this directory in
|
# You will probably have to set "AllowOverride Limit" for this directory in
|
||||||
# your server-level configuration file as well.
|
# your server-level configuration file as well.
|
||||||
#
|
#
|
||||||
# If this doesn't make sense, then stop reading and leave this program alone.
|
# If this doesn't make sense, then stop reading and leave this program alone.
|
||||||
#
|
#
|
||||||
# Assuming you have all this done (and it works), then you may uncomment
|
# Assuming you have all this done (and it works), then you may uncomment
|
||||||
# the line below and start using upsset.cgi through your web browser.
|
# the line below and start using upsset.cgi through your web browser.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
@UPSSTATSPATH upsstats.cgi@
|
@UPSSTATSPATH upsstats.cgi@
|
||||||
@UPSIMAGEPATH upsimage.cgi@
|
@UPSIMAGEPATH upsimage.cgi@
|
||||||
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
@ -26,10 +26,16 @@
|
||||||
@REFRESH@
|
@REFRESH@
|
||||||
<title>@HOSTDESC@ : @VAR ups.model@ on @HOST@</title>
|
<title>@HOSTDESC@ : @VAR ups.model@ on @HOST@</title>
|
||||||
<!-- LINK REL="stylesheet" TYPE="text/css" HREF="http://localhost/nut/nut.css" / -->
|
<!-- 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>
|
</head>
|
||||||
<body BGCOLOR="#808080" TEXT="#00FC00" LINK="#0000EE" VLINK="#551A8B">
|
<body>
|
||||||
|
|
||||||
<table BORDER="1" ALIGN="CENTER" CELLSPACING="0" CELLPADDING="10" BGCOLOR="#000000">
|
<table style="margin:auto" BORDER="1" CELLSPACING="0" CELLPADDING="10">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th COLSPAN="20">Network UPS Tools upsstats @VERSION@ - @HOSTDESC@ - @VAR ups.model@ on @HOST@</th>
|
<th COLSPAN="20">Network UPS Tools upsstats @VERSION@ - @HOSTDESC@ - @VAR ups.model@ on @HOST@</th>
|
||||||
|
@ -51,7 +57,7 @@
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td BGCOLOR="#000000" VALIGN="TOP">
|
<td VALIGN="TOP">
|
||||||
|
|
||||||
<table BORDER="0"> <!-- table 2 -->
|
<table BORDER="0"> <!-- table 2 -->
|
||||||
|
|
||||||
|
@ -195,7 +201,7 @@
|
||||||
|
|
||||||
@IFSUPP ambient.temperature@
|
@IFSUPP ambient.temperature@
|
||||||
@IFSUPP ambient.humidity@
|
@IFSUPP ambient.humidity@
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
<td ALIGN="CENTER">Temperature<br>@IMG ambient.temperature tempmin=0 tempmax=50 width=90@</td>
|
<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>
|
<td ALIGN="CENTER">Humidity<br>@IMG ambient.humidity width=90@</td>
|
||||||
|
@ -203,21 +209,21 @@
|
||||||
</td>
|
</td>
|
||||||
@ELSE@
|
@ELSE@
|
||||||
@IFSUPP ambient.temperature@
|
@IFSUPP ambient.temperature@
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
<td ALIGN="CENTER">Temperature<br>@IMG ambient.temperature tempmin=0 tempmax=50@</td>
|
<td ALIGN="CENTER">Temperature<br>@IMG ambient.temperature tempmin=0 tempmax=50@</td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
@ELSE@
|
@ELSE@
|
||||||
@IFSUPP ambient.humidity@
|
@IFSUPP ambient.humidity@
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
<td ALIGN="CENTER">Humidity<br>@IMG ambient.humidity@</td>
|
<td ALIGN="CENTER">Humidity<br>@IMG ambient.humidity@</td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
|
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
@IFSUPP battery.charge@
|
@IFSUPP battery.charge@
|
||||||
@IFSUPP battery.voltage@
|
@IFSUPP battery.voltage@
|
||||||
|
@ -232,7 +238,7 @@
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
@IFSUPP input.L2-L3.voltage@
|
@IFSUPP input.L2-L3.voltage@
|
||||||
<td ALIGN="CENTER">L1-L2<br>@IMG input.L1-L2.voltage width=68@</td>
|
<td ALIGN="CENTER">L1-L2<br>@IMG input.L1-L2.voltage width=68@</td>
|
||||||
|
@ -249,7 +255,7 @@
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
@IFSUPP output.L2-L3.voltage@
|
@IFSUPP output.L2-L3.voltage@
|
||||||
<td ALIGN="CENTER">L1-L2<br>@IMG output.L1-L2.voltage width=68@</td>
|
<td ALIGN="CENTER">L1-L2<br>@IMG output.L1-L2.voltage width=68@</td>
|
||||||
|
@ -266,7 +272,7 @@
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#000000">
|
<td ALIGN="CENTER" VALIGN="TOP">
|
||||||
<table BORDER="0"><tr>
|
<table BORDER="0"><tr>
|
||||||
@IFSUPP output.L2.power.percent@
|
@IFSUPP output.L2.power.percent@
|
||||||
<td ALIGN="CENTER">L1<br>@IMG output.L1.power.percent width=68@</td>
|
<td ALIGN="CENTER">L1<br>@IMG output.L1.power.percent width=68@</td>
|
||||||
|
@ -286,9 +292,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<a href="http://validator.w3.org/check?uri=referer"><img style="float:right"
|
<div><a href="https://jigsaw.w3.org/css-validator/check/referer"><img
|
||||||
src="http://www.w3.org/Icons/valid-html40"
|
style="float:right" src="https://jigsaw.w3.org/css-validator/images/vcss"
|
||||||
alt="Valid HTML 4.0 Transitional" height="31" width="88"></a>
|
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>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- upsstats template file -->
|
<!-- upsstats template file -->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
This (upsstats.html) is the default template file which is used
|
This (upsstats.html) is the default template file which is used
|
||||||
when upsstats.cgi is loaded with no arguments.
|
when upsstats.cgi is loaded with no arguments.
|
||||||
|
|
||||||
|
@ -16,33 +16,41 @@
|
||||||
@UPSSTATSPATH upsstats.cgi@
|
@UPSSTATSPATH upsstats.cgi@
|
||||||
@UPSIMAGEPATH upsimage.cgi@
|
@UPSIMAGEPATH upsimage.cgi@
|
||||||
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||||
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
"http://www.w3.org/TR/html4/strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
@REFRESH@
|
@REFRESH@
|
||||||
<title>
|
<title>
|
||||||
Network UPS Tools upsstats
|
Network UPS Tools upsstats
|
||||||
@VERSION@
|
@VERSION@
|
||||||
: UPS Status
|
: UPS Status
|
||||||
</title>
|
</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" / -->
|
<!-- link rel="stylesheet" type="text/css" href="nut.css" / -->
|
||||||
@REFRESH@
|
@REFRESH@
|
||||||
</head>
|
</head>
|
||||||
<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B">
|
<body>
|
||||||
|
|
||||||
<table BGCOLOR="#50A0A0" ALIGN="CENTER">
|
<table style="margin:auto; background:#50A0A0; text-align:center;">
|
||||||
<tr><td>
|
<tr><td>
|
||||||
|
|
||||||
<table CELLPADDING="5">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th COLSPAN="10" BGCOLOR="#60B0B0">
|
<th COLSPAN="10" style="background:#60B0B0;">
|
||||||
|
|
||||||
<font SIZE="+2">Network UPS Tools upsstats
|
<span style="font-size:1.5em">Network UPS Tools upsstats
|
||||||
@VERSION@
|
@VERSION@
|
||||||
</font>
|
</span>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@DATE %a %b %d %X %Z %Y@
|
@DATE %a %b %d %X %Z %Y@
|
||||||
|
@ -50,7 +58,7 @@ Network UPS Tools upsstats
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr BGCOLOR="#60B0B0">
|
<tr style="background:#60B0B0;">
|
||||||
<th COLSPAN="1">System</th>
|
<th COLSPAN="1">System</th>
|
||||||
<th COLSPAN="1">Model</th>
|
<th COLSPAN="1">Model</th>
|
||||||
<th COLSPAN="1">Status</th>
|
<th COLSPAN="1">Status</th>
|
||||||
|
@ -65,20 +73,20 @@ Network UPS Tools upsstats
|
||||||
|
|
||||||
@FOREACHUPS@
|
@FOREACHUPS@
|
||||||
|
|
||||||
<tr ALIGN=CENTER>
|
<tr>
|
||||||
<td BGCOLOR="#00FFFF">
|
<td class="t1">
|
||||||
@HOSTLINK@
|
@HOSTLINK@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FFFF">
|
<td class="t1">
|
||||||
@VAR ups.model@
|
@VAR ups.model@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="@STATUSCOLOR@">
|
<td style="background:@STATUSCOLOR@">
|
||||||
@STATUS@
|
@STATUS@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@IFSUPP battery.charge@
|
@IFSUPP battery.charge@
|
||||||
@VAR battery.charge@
|
@VAR battery.charge@
|
||||||
%
|
%
|
||||||
|
@ -89,18 +97,18 @@ Network UPS Tools upsstats
|
||||||
@IFBETWEEN input.transfer.low input.transfer.high input.L1-L2.voltage@
|
@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.L2-L3.voltage@
|
||||||
@IFBETWEEN input.transfer.low input.transfer.high input.L3-L1.voltage@
|
@IFBETWEEN input.transfer.low input.transfer.high input.L3-L1.voltage@
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@ELSE@
|
@ELSE@
|
||||||
@IFSUPP input.L2-N.voltage@
|
@IFSUPP input.L2-N.voltage@
|
||||||
@IFBETWEEN input.transfer.low input.transfer.high input.L1-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.L2-N.voltage@
|
||||||
@IFBETWEEN input.transfer.low input.transfer.high input.L3-N.voltage@
|
@IFBETWEEN input.transfer.low input.transfer.high input.L3-N.voltage@
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@ELSE@
|
@ELSE@
|
||||||
@IFBETWEEN input.transfer.low input.transfer.high input.voltage@
|
@IFBETWEEN input.transfer.low input.transfer.high input.voltage@
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@ELSE@
|
@ELSE@
|
||||||
<td BGCOLOR="#FF0000">
|
<td style="background:red;">
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
|
|
||||||
@IFSUPP input.L2-L3.voltage@
|
@IFSUPP input.L2-L3.voltage@
|
||||||
|
@ -118,7 +126,7 @@ Network UPS Tools upsstats
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@IFSUPP output.L2-L3.voltage@
|
@IFSUPP output.L2-L3.voltage@
|
||||||
@VAR output.L1-L2.voltage@
|
@VAR output.L1-L2.voltage@
|
||||||
@VAR output.L2-L3.voltage@
|
@VAR output.L2-L3.voltage@
|
||||||
|
@ -134,7 +142,7 @@ Network UPS Tools upsstats
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@IFSUPP output.L2.power.percent@
|
@IFSUPP output.L2.power.percent@
|
||||||
@VAR output.L1.power.percent@
|
@VAR output.L1.power.percent@
|
||||||
@VAR output.L2.power.percent@
|
@VAR output.L2.power.percent@
|
||||||
|
@ -151,7 +159,7 @@ Network UPS Tools upsstats
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@IFSUPP ups.temperature@
|
@IFSUPP ups.temperature@
|
||||||
@UPSTEMP@
|
@UPSTEMP@
|
||||||
@DEGREES@
|
@DEGREES@
|
||||||
|
@ -162,13 +170,13 @@ Network UPS Tools upsstats
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@IFSUPP battery.runtime@
|
@IFSUPP battery.runtime@
|
||||||
@RUNTIME@
|
@RUNTIME@
|
||||||
@ENDIF@
|
@ENDIF@
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td BGCOLOR="#00FF00">
|
<td class="t2">
|
||||||
@TREELINK@
|
@TREELINK@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -180,11 +188,9 @@ Network UPS Tools upsstats
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<hr /><div><small>
|
<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="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="http://validator.w3.org/check?uri=referer"><img style="float:right"
|
<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>
|
||||||
src="http://www.w3.org/Icons/valid-html40"
|
|
||||||
alt="Valid HTML 4.0 Transitional" height="31" width="88"></a>
|
|
||||||
</small></div>
|
</small></div>
|
||||||
|
|
||||||
</body></html>
|
</body></html>
|
||||||
|
|
929
config.guess
vendored
929
config.guess
vendored
File diff suppressed because it is too large
Load diff
463
config.sub
vendored
463
config.sub
vendored
File diff suppressed because it is too large
Load diff
2969
configure.ac
Normal file
2969
configure.ac
Normal file
File diff suppressed because it is too large
Load diff
1149
configure.in
1149
configure.in
File diff suppressed because it is too large
Load diff
|
@ -5,3 +5,16 @@ SUBDIRS = html
|
||||||
dist_data_DATA = cmdvartab
|
dist_data_DATA = cmdvartab
|
||||||
nodist_data_DATA = driver.list
|
nodist_data_DATA = driver.list
|
||||||
EXTRA_DIST = evolution500.seq epdu-managed.dev
|
EXTRA_DIST = evolution500.seq epdu-managed.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
|
||||||
|
|
422
data/Makefile.in
422
data/Makefile.in
|
@ -1,9 +1,8 @@
|
||||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
@ -18,6 +17,61 @@
|
||||||
# Network UPS Tools: data
|
# Network UPS Tools: data
|
||||||
|
|
||||||
VPATH = @srcdir@
|
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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
@ -38,46 +92,75 @@ build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
target_triplet = @target@
|
target_triplet = @target@
|
||||||
subdir = data
|
subdir = data
|
||||||
DIST_COMMON = $(dist_data_DATA) $(srcdir)/Makefile.am \
|
|
||||||
$(srcdir)/Makefile.in $(srcdir)/driver.list.in
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.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 \
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_asciidoc.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_libavahi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libnetsnmp.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_libpowerman.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||||
$(top_srcdir)/m4/nut_config_libhal.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_report_feature.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||||
$(top_srcdir)/configure.in
|
$(top_srcdir)/configure.ac
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
|
DIST_COMMON = $(srcdir)/Makefile.am $(dist_data_DATA) \
|
||||||
|
$(am__DIST_COMMON)
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||||
CONFIG_CLEAN_FILES = driver.list
|
CONFIG_CLEAN_FILES = driver.list
|
||||||
CONFIG_CLEAN_VPATH_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 =
|
SOURCES =
|
||||||
DIST_SOURCES =
|
DIST_SOURCES =
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||||
html-recursive info-recursive install-data-recursive \
|
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||||
install-dvi-recursive install-exec-recursive \
|
install-data-recursive install-dvi-recursive \
|
||||||
install-html-recursive install-info-recursive \
|
install-exec-recursive install-html-recursive \
|
||||||
install-pdf-recursive install-ps-recursive install-recursive \
|
install-info-recursive install-pdf-recursive \
|
||||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
install-ps-recursive install-recursive installcheck-recursive \
|
||||||
ps-recursive uninstall-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
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
am__vpath_adj = case $$p in \
|
am__vpath_adj = case $$p in \
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||||
|
@ -99,16 +182,43 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
||||||
am__base_list = \
|
am__base_list = \
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||||
sed '$$!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)"
|
am__installdirs = "$(DESTDIR)$(datadir)" "$(DESTDIR)$(datadir)"
|
||||||
DATA = $(dist_data_DATA) $(nodist_data_DATA)
|
DATA = $(dist_data_DATA) $(nodist_data_DATA)
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||||
distclean-recursive maintainer-clean-recursive
|
distclean-recursive maintainer-clean-recursive
|
||||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
am__recursive_targets = \
|
||||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
$(RECURSIVE_TARGETS) \
|
||||||
distdir
|
$(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)`
|
||||||
ETAGS = etags
|
ETAGS = etags
|
||||||
CTAGS = ctags
|
CTAGS = ctags
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
DIST_SUBDIRS = $(SUBDIRS)
|
||||||
|
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/driver.list.in
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
am__relativize = \
|
am__relativize = \
|
||||||
dir0=`pwd`; \
|
dir0=`pwd`; \
|
||||||
|
@ -138,8 +248,11 @@ am__relativize = \
|
||||||
A2X = @A2X@
|
A2X = @A2X@
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
|
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
ASCIIDOC = @ASCIIDOC@
|
ASCIIDOC = @ASCIIDOC@
|
||||||
|
ASPELL = @ASPELL@
|
||||||
|
AUGPARSE = @AUGPARSE@
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
@ -150,16 +263,25 @@ CCDEPMODE = @CCDEPMODE@
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
CONFPATH = @CONFPATH@
|
CONFPATH = @CONFPATH@
|
||||||
CPP = @CPP@
|
CPP = @CPP@
|
||||||
|
CPPCHECK = @CPPCHECK@
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||||
|
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
CYGPATH_W = @CYGPATH_W@
|
CYGPATH_W = @CYGPATH_W@
|
||||||
DBLATEX = @DBLATEX@
|
DBLATEX = @DBLATEX@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
DEPDIR = @DEPDIR@
|
DEPDIR = @DEPDIR@
|
||||||
DLLTOOL = @DLLTOOL@
|
DLLTOOL = @DLLTOOL@
|
||||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||||
|
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||||
|
DRVPATH = @DRVPATH@
|
||||||
DSYMUTIL = @DSYMUTIL@
|
DSYMUTIL = @DSYMUTIL@
|
||||||
DUMPBIN = @DUMPBIN@
|
DUMPBIN = @DUMPBIN@
|
||||||
ECHO_C = @ECHO_C@
|
ECHO_C = @ECHO_C@
|
||||||
|
@ -168,11 +290,8 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
FGREP = @FGREP@
|
FGREP = @FGREP@
|
||||||
|
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||||
GREP = @GREP@
|
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@
|
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
@ -182,14 +301,15 @@ LD = @LD@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||||
|
LIBDIR = @LIBDIR@
|
||||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
|
||||||
LIBHAL_LIBS = @LIBHAL_LIBS@
|
|
||||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||||
|
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||||
|
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||||
|
@ -200,21 +320,29 @@ LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||||
|
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||||
LIBTOOL = @LIBTOOL@
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||||
|
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||||
LIPO = @LIPO@
|
LIPO = @LIPO@
|
||||||
LN_S = @LN_S@
|
LN_S = @LN_S@
|
||||||
|
LN_S_R = @LN_S_R@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||||
MAINT = @MAINT@
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
NETLIBS = @NETLIBS@
|
NETLIBS = @NETLIBS@
|
||||||
|
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||||
NM = @NM@
|
NM = @NM@
|
||||||
NMEDIT = @NMEDIT@
|
NMEDIT = @NMEDIT@
|
||||||
|
NUT_DATADIR = @NUT_DATADIR@
|
||||||
|
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||||
NUT_NETVERSION = @NUT_NETVERSION@
|
NUT_NETVERSION = @NUT_NETVERSION@
|
||||||
OBJDUMP = @OBJDUMP@
|
OBJDUMP = @OBJDUMP@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
@ -234,6 +362,9 @@ PKG_CONFIG = @PKG_CONFIG@
|
||||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||||
PORT = @PORT@
|
PORT = @PORT@
|
||||||
|
PYTHON = @PYTHON@
|
||||||
|
PYTHON2 = @PYTHON2@
|
||||||
|
PYTHON3 = @PYTHON3@
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||||
RUN_AS_USER = @RUN_AS_USER@
|
RUN_AS_USER = @RUN_AS_USER@
|
||||||
|
@ -242,24 +373,30 @@ SED = @SED@
|
||||||
SERLIBS = @SERLIBS@
|
SERLIBS = @SERLIBS@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
|
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||||
STATEPATH = @STATEPATH@
|
STATEPATH = @STATEPATH@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
SUN_LIBUSB = @SUN_LIBUSB@
|
SUN_LIBUSB = @SUN_LIBUSB@
|
||||||
TREE_VERSION = @TREE_VERSION@
|
TREE_VERSION = @TREE_VERSION@
|
||||||
|
VALGRIND = @VALGRIND@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||||
|
XMLLINT = @XMLLINT@
|
||||||
|
XSLTPROC = @XSLTPROC@
|
||||||
abs_builddir = @abs_builddir@
|
abs_builddir = @abs_builddir@
|
||||||
abs_srcdir = @abs_srcdir@
|
abs_srcdir = @abs_srcdir@
|
||||||
abs_top_builddir = @abs_top_builddir@
|
abs_top_builddir = @abs_top_builddir@
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
ac_ct_AR = @ac_ct_AR@
|
ac_ct_AR = @ac_ct_AR@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||||
am__include = @am__include@
|
am__include = @am__include@
|
||||||
am__leading_dot = @am__leading_dot@
|
am__leading_dot = @am__leading_dot@
|
||||||
am__quote = @am__quote@
|
am__quote = @am__quote@
|
||||||
am__tar = @am__tar@
|
am__tar = @am__tar@
|
||||||
am__untar = @am__untar@
|
am__untar = @am__untar@
|
||||||
|
auglensdir = @auglensdir@
|
||||||
bindir = @bindir@
|
bindir = @bindir@
|
||||||
build = @build@
|
build = @build@
|
||||||
build_alias = @build_alias@
|
build_alias = @build_alias@
|
||||||
|
@ -270,8 +407,12 @@ builddir = @builddir@
|
||||||
cgiexecdir = @cgiexecdir@
|
cgiexecdir = @cgiexecdir@
|
||||||
datadir = @datadir@
|
datadir = @datadir@
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
|
devddir = @devddir@
|
||||||
docdir = @docdir@
|
docdir = @docdir@
|
||||||
driverexecdir = @driverexecdir@
|
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@
|
dvidir = @dvidir@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
host = @host@
|
host = @host@
|
||||||
|
@ -290,18 +431,21 @@ localedir = @localedir@
|
||||||
localstatedir = @localstatedir@
|
localstatedir = @localstatedir@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
mkdir_p = @mkdir_p@
|
mkdir_p = @mkdir_p@
|
||||||
|
now = @now@
|
||||||
oldincludedir = @oldincludedir@
|
oldincludedir = @oldincludedir@
|
||||||
pdfdir = @pdfdir@
|
pdfdir = @pdfdir@
|
||||||
pkgconfigdir = @pkgconfigdir@
|
pkgconfigdir = @pkgconfigdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemdsystemshutdowndir = @systemdsystemshutdowndir@
|
systemdshutdowndir = @systemdshutdowndir@
|
||||||
systemdsystemunitdir = @systemdsystemunitdir@
|
systemdsystemunitdir = @systemdsystemunitdir@
|
||||||
|
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||||
target = @target@
|
target = @target@
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
target_cpu = @target_cpu@
|
target_cpu = @target_cpu@
|
||||||
|
@ -315,6 +459,8 @@ SUBDIRS = html
|
||||||
dist_data_DATA = cmdvartab
|
dist_data_DATA = cmdvartab
|
||||||
nodist_data_DATA = driver.list
|
nodist_data_DATA = driver.list
|
||||||
EXTRA_DIST = evolution500.seq epdu-managed.dev
|
EXTRA_DIST = evolution500.seq epdu-managed.dev
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||||
|
CLEANFILES = *.pdf *.html *-spellchecked
|
||||||
all: all-recursive
|
all: all-recursive
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
@ -330,14 +476,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu data/Makefile
|
$(AUTOMAKE) --gnu data/Makefile
|
||||||
.PRECIOUS: Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
@ -358,8 +503,11 @@ clean-libtool:
|
||||||
-rm -rf .libs _libs
|
-rm -rf .libs _libs
|
||||||
install-dist_dataDATA: $(dist_data_DATA)
|
install-dist_dataDATA: $(dist_data_DATA)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
test -z "$(datadir)" || $(MKDIR_P) "$(DESTDIR)$(datadir)"
|
|
||||||
@list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \
|
@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 \
|
for p in $$list; do \
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
echo "$$d$$p"; \
|
echo "$$d$$p"; \
|
||||||
|
@ -373,13 +521,14 @@ uninstall-dist_dataDATA:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
@list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \
|
@list='$(dist_data_DATA)'; test -n "$(datadir)" || list=; \
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||||
test -n "$$files" || exit 0; \
|
dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir)
|
||||||
echo " ( cd '$(DESTDIR)$(datadir)' && rm -f" $$files ")"; \
|
|
||||||
cd "$(DESTDIR)$(datadir)" && rm -f $$files
|
|
||||||
install-nodist_dataDATA: $(nodist_data_DATA)
|
install-nodist_dataDATA: $(nodist_data_DATA)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
test -z "$(datadir)" || $(MKDIR_P) "$(DESTDIR)$(datadir)"
|
|
||||||
@list='$(nodist_data_DATA)'; test -n "$(datadir)" || list=; \
|
@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 \
|
for p in $$list; do \
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
echo "$$d$$p"; \
|
echo "$$d$$p"; \
|
||||||
|
@ -393,27 +542,28 @@ uninstall-nodist_dataDATA:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
@list='$(nodist_data_DATA)'; test -n "$(datadir)" || list=; \
|
@list='$(nodist_data_DATA)'; test -n "$(datadir)" || list=; \
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||||
test -n "$$files" || exit 0; \
|
dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir)
|
||||||
echo " ( cd '$(DESTDIR)$(datadir)' && rm -f" $$files ")"; \
|
|
||||||
cd "$(DESTDIR)$(datadir)" && rm -f $$files
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
# This directory's subdirectories are mostly independent; you can cd
|
||||||
# into them and run `make' without going through this Makefile.
|
# into them and run 'make' without going through this Makefile.
|
||||||
# To change the values of `make' variables: instead of editing Makefiles,
|
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||||
# (1) if the variable is set in `config.status', edit `config.status'
|
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||||
# (2) otherwise, pass the desired values on the `make' command line.
|
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||||
$(RECURSIVE_TARGETS):
|
$(am__recursive_targets):
|
||||||
@fail= failcom='exit 1'; \
|
@fail=; \
|
||||||
for f in x $$MAKEFLAGS; do \
|
if $(am__make_keepgoing); then \
|
||||||
case $$f in \
|
failcom='fail=yes'; \
|
||||||
*=* | --[!k]*);; \
|
else \
|
||||||
*k*) failcom='fail=yes';; \
|
failcom='exit 1'; \
|
||||||
esac; \
|
fi; \
|
||||||
done; \
|
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
case "$@" in \
|
||||||
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
|
*) list='$(SUBDIRS)' ;; \
|
||||||
|
esac; \
|
||||||
|
for subdir in $$list; do \
|
||||||
echo "Making $$target in $$subdir"; \
|
echo "Making $$target in $$subdir"; \
|
||||||
if test "$$subdir" = "."; then \
|
if test "$$subdir" = "."; then \
|
||||||
dot_seen=yes; \
|
dot_seen=yes; \
|
||||||
|
@ -428,57 +578,12 @@ $(RECURSIVE_TARGETS):
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
fi; test -z "$$fail"
|
fi; test -z "$$fail"
|
||||||
|
|
||||||
$(RECURSIVE_CLEAN_TARGETS):
|
ID: $(am__tagged_files)
|
||||||
@fail= failcom='exit 1'; \
|
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||||
for f in x $$MAKEFLAGS; do \
|
tags: tags-recursive
|
||||||
case $$f in \
|
TAGS: tags
|
||||||
*=* | --[!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
|
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
tags-am: $(TAGS_DEPENDENCIES) $(am__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; }; }'`; \
|
|
||||||
mkid -fID $$unique
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|
||||||
$(TAGS_FILES) $(LISP)
|
|
||||||
set x; \
|
set x; \
|
||||||
here=`pwd`; \
|
here=`pwd`; \
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||||
|
@ -494,12 +599,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||||
fi; \
|
fi; \
|
||||||
done; \
|
done; \
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
$(am__define_uniq_tagged_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; \
|
shift; \
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
test -n "$$unique" || unique=$$empty_fix; \
|
||||||
|
@ -511,15 +611,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||||
$$unique; \
|
$$unique; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
ctags: CTAGS
|
ctags: ctags-recursive
|
||||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
|
||||||
$(TAGS_FILES) $(LISP)
|
CTAGS: ctags
|
||||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||||
unique=`for i in $$list; do \
|
$(am__define_uniq_tagged_files); \
|
||||||
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" \
|
test -z "$(CTAGS_ARGS)$$unique" \
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||||
$$unique
|
$$unique
|
||||||
|
@ -528,11 +624,29 @@ GTAGS:
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||||
&& $(am__cd) $(top_srcdir) \
|
&& $(am__cd) $(top_srcdir) \
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
&& 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:
|
distclean-tags:
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
distdir: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||||
|
|
||||||
|
distdir-am: $(DISTFILES)
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
@ -564,13 +678,10 @@ distdir: $(DISTFILES)
|
||||||
done
|
done
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||||
if test "$$subdir" = .; then :; else \
|
if test "$$subdir" = .; then :; else \
|
||||||
test -d "$(distdir)/$$subdir" \
|
$(am__make_dryrun) \
|
||||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|| test -d "$(distdir)/$$subdir" \
|
||||||
|| exit 1; \
|
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||||
fi; \
|
|| exit 1; \
|
||||||
done
|
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||||
$(am__relativize); \
|
$(am__relativize); \
|
||||||
new_distdir=$$reldir; \
|
new_distdir=$$reldir; \
|
||||||
|
@ -608,13 +719,19 @@ install-am: all-am
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
installcheck: installcheck-recursive
|
||||||
install-strip:
|
install-strip:
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
if test -z '$(STRIP)'; then \
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
`test -z '$(STRIP)' || \
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
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
|
||||||
mostlyclean-generic:
|
mostlyclean-generic:
|
||||||
|
|
||||||
clean-generic:
|
clean-generic:
|
||||||
|
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
distclean-generic:
|
distclean-generic:
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
@ -623,6 +740,7 @@ distclean-generic:
|
||||||
maintainer-clean-generic:
|
maintainer-clean-generic:
|
||||||
@echo "This command is intended for maintainers to use"
|
@echo "This command is intended for maintainers to use"
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||||
clean: clean-recursive
|
clean: clean-recursive
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
@ -689,25 +807,35 @@ ps-am:
|
||||||
|
|
||||||
uninstall-am: uninstall-dist_dataDATA uninstall-nodist_dataDATA
|
uninstall-am: uninstall-dist_dataDATA uninstall-nodist_dataDATA
|
||||||
|
|
||||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
|
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||||
install-am install-strip tags-recursive
|
|
||||||
|
|
||||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
|
||||||
all all-am check check-am clean clean-generic clean-libtool \
|
check-am clean clean-generic clean-libtool cscopelist-am ctags \
|
||||||
ctags ctags-recursive distclean distclean-generic \
|
ctags-am distclean distclean-generic distclean-libtool \
|
||||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||||
html-am info info-am install install-am install-data \
|
install install-am install-data install-data-am \
|
||||||
install-data-am install-dist_dataDATA install-dvi \
|
install-dist_dataDATA install-dvi install-dvi-am install-exec \
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
install-exec-am install-html install-html-am install-info \
|
||||||
install-html-am install-info install-info-am install-man \
|
install-info-am install-man install-nodist_dataDATA \
|
||||||
install-nodist_dataDATA install-pdf install-pdf-am install-ps \
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
install-ps-am install-strip installcheck installcheck-am \
|
install-strip installcheck installcheck-am installdirs \
|
||||||
installdirs installdirs-am maintainer-clean \
|
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
ps ps-am tags tags-am uninstall uninstall-am \
|
||||||
uninstall uninstall-am uninstall-dist_dataDATA \
|
uninstall-dist_dataDATA uninstall-nodist_dataDATA
|
||||||
uninstall-nodist_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.
|
# 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.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
|
@ -20,6 +20,7 @@ VARDESC ups.firmware "UPS firmware"
|
||||||
VARDESC ups.firmware.aux "Auxiliary device firmware"
|
VARDESC ups.firmware.aux "Auxiliary device firmware"
|
||||||
VARDESC ups.temperature "UPS temperature (degrees C)"
|
VARDESC ups.temperature "UPS temperature (degrees C)"
|
||||||
VARDESC ups.load "Load on UPS (percent of full)"
|
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.load.high "Load when UPS switches to overload condition (percent)"
|
||||||
VARDESC ups.id "UPS system identifier"
|
VARDESC ups.id "UPS system identifier"
|
||||||
VARDESC ups.delay.start "Interval to wait before (re)starting the load (seconds)"
|
VARDESC ups.delay.start "Interval to wait before (re)starting the load (seconds)"
|
||||||
|
@ -46,6 +47,11 @@ VARDESC input.voltage "Input voltage (V)"
|
||||||
VARDESC input.voltage.extended "Extended input voltage range"
|
VARDESC input.voltage.extended "Extended input voltage range"
|
||||||
VARDESC input.voltage.maximum "Maximum incoming voltage seen (V)"
|
VARDESC input.voltage.maximum "Maximum incoming voltage seen (V)"
|
||||||
VARDESC input.voltage.minimum "Minimum 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.voltage.nominal "Nominal input voltage (V)"
|
||||||
VARDESC input.transfer.reason "Reason for last transfer to battery"
|
VARDESC input.transfer.reason "Reason for last transfer to battery"
|
||||||
VARDESC input.transfer.low "Low voltage transfer point (V)"
|
VARDESC input.transfer.low "Low voltage transfer point (V)"
|
||||||
|
@ -58,8 +64,14 @@ VARDESC input.sensitivity "Input power sensitivity"
|
||||||
VARDESC input.quality "Input power quality"
|
VARDESC input.quality "Input power quality"
|
||||||
VARDESC input.current "Input current (A)"
|
VARDESC input.current "Input current (A)"
|
||||||
VARDESC input.current.nominal "Nominal 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 "Input line frequency (Hz)"
|
||||||
VARDESC input.frequency.extended "Extended input frequency range"
|
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.nominal "Nominal input line frequency (Hz)"
|
||||||
VARDESC input.frequency.low "Minimum input line frequency (Hz)"
|
VARDESC input.frequency.low "Minimum input line frequency (Hz)"
|
||||||
VARDESC input.frequency.high "Maximum input line frequency (Hz)"
|
VARDESC input.frequency.high "Maximum input line frequency (Hz)"
|
||||||
|
@ -67,6 +79,12 @@ 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.boost.high "High voltage boosting transfer point (V)"
|
||||||
VARDESC input.transfer.trim.low "Low voltage trimming 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.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 "Output voltage (V)"
|
||||||
VARDESC output.voltage.nominal "Nominal output voltage (V)"
|
VARDESC output.voltage.nominal "Nominal output voltage (V)"
|
||||||
|
@ -76,6 +94,7 @@ VARDESC output.current "Output current (A)"
|
||||||
VARDESC output.current.nominal "Nominal output current (A)"
|
VARDESC output.current.nominal "Nominal output current (A)"
|
||||||
|
|
||||||
VARDESC battery.charge "Battery charge (percent of full)"
|
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.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.restart "Minimum battery level for restart after power off (percent)"
|
||||||
VARDESC battery.charge.warning "Battery level when UPS switches to Warning state (percent)"
|
VARDESC battery.charge.warning "Battery level when UPS switches to Warning state (percent)"
|
||||||
|
@ -94,19 +113,40 @@ VARDESC battery.packs.bad "Number of bad battery packs"
|
||||||
VARDESC battery.type "Battery chemistry"
|
VARDESC battery.type "Battery chemistry"
|
||||||
VARDESC battery.protection "Prevent deep discharge of battery"
|
VARDESC battery.protection "Prevent deep discharge of battery"
|
||||||
VARDESC battery.energysave "Switch off when running on battery and no/low load"
|
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 "Ambient temperature (degrees C)"
|
||||||
VARDESC ambient.temperature.alarm "Ambient temperature alarm is active"
|
VARDESC ambient.temperature.alarm "Ambient temperature alarm is active"
|
||||||
VARDESC ambient.temperature.alarm.maximum "Maximum allowed ambient temperature"
|
VARDESC ambient.temperature.status "Ambient temperature status relative to the configured thresholds"
|
||||||
VARDESC ambient.temperature.alarm.minimum "Minimum allowed ambient temperature"
|
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.enable "Enable ambient temperature alarm"
|
VARDESC ambient.temperature.alarm.enable "Enable ambient temperature alarm"
|
||||||
VARDESC ambient.humidity "Ambient humidity"
|
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.alarm "Ambient humidity alarm is active"
|
VARDESC ambient.humidity.alarm "Ambient humidity alarm is active"
|
||||||
VARDESC ambient.humidity.alarm.maximum "Maximum allowed ambient humidity"
|
VARDESC ambient.humidity.status "Ambient humidity status relative to the configured thresholds"
|
||||||
VARDESC ambient.humidity.alarm.minimum "Minimum allowed ambient humidity"
|
VARDESC ambient.humidity.alarm.maximum "Maximum allowed ambient humidity (percent)"
|
||||||
|
VARDESC ambient.humidity.alarm.minimum "Minimum allowed ambient humidity (percent)"
|
||||||
VARDESC ambient.humidity.alarm.enable "Enable ambient humidity alarm"
|
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 regexs?
|
# FIXME: the outlet collection is indexed - solve with regexps?
|
||||||
#
|
#
|
||||||
# VARDESC outlet.[[:digit:]]+.id "Outlet system identifier (<index>)"
|
# VARDESC outlet.[[:digit:]]+.id "Outlet system identifier (<index>)"
|
||||||
|
|
||||||
|
@ -138,6 +178,9 @@ VARDESC outlet.2.delay.start "Interval to wait before restarting this outlet (se
|
||||||
VARDESC driver.name "Driver name"
|
VARDESC driver.name "Driver name"
|
||||||
VARDESC driver.version "Driver version - NUT release"
|
VARDESC driver.version "Driver version - NUT release"
|
||||||
VARDESC driver.version.internal "Internal driver version"
|
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
|
# FIXME: driver.parameter and driver.flag can have many possible members
|
||||||
#
|
#
|
||||||
|
@ -162,6 +205,7 @@ CMDDESC test.battery.start "Start a battery test"
|
||||||
CMDDESC test.battery.start.quick "Start a quick 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.start.deep "Start a deep battery test"
|
||||||
CMDDESC test.battery.stop "Stop the 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.start "Start run time calibration"
|
||||||
CMDDESC calibrate.stop "Stop run time calibration"
|
CMDDESC calibrate.stop "Stop run time calibration"
|
||||||
CMDDESC bypass.start "Put the UPS in bypass mode"
|
CMDDESC bypass.start "Put the UPS in bypass mode"
|
||||||
|
@ -176,8 +220,10 @@ CMDDESC beeper.mute "Temporarily mute the UPS beeper"
|
||||||
CMDDESC beeper.toggle "Toggle 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.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.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.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.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
|
# The following two commands should *only* be defined when you need
|
||||||
# to compose a 'shutdown.return' command by sending both a switch-off
|
# to compose a 'shutdown.return' command by sending both a switch-off
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,11 @@
|
||||||
# Network UPS Tools: data/html
|
# Network UPS Tools: data/html
|
||||||
# install these only if configured --with-cgi
|
# install these only if configured --with-cgi
|
||||||
if WITH_CGI
|
if WITH_CGI
|
||||||
dist_html_DATA = index.html bottom.html nut-banner.png
|
dist_html_DATA = index.html bottom.html nut-banner.png
|
||||||
nodist_html_DATA = header.html
|
nodist_html_DATA = header.html
|
||||||
endif
|
endif
|
||||||
EXTRA_DIST = README
|
EXTRA_DIST = README
|
||||||
|
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||||
|
# Generated by configure script:
|
||||||
|
DISTCLEANFILES = header.html
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
# Makefile.in generated by automake 1.16.3 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
|
||||||
# Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
@ -16,6 +15,61 @@
|
||||||
@SET_MAKE@
|
@SET_MAKE@
|
||||||
|
|
||||||
VPATH = @srcdir@
|
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@
|
pkgdatadir = $(datadir)/@PACKAGE@
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
pkgincludedir = $(includedir)/@PACKAGE@
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
pkglibdir = $(libdir)/@PACKAGE@
|
||||||
|
@ -36,39 +90,67 @@ build_triplet = @build@
|
||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
target_triplet = @target@
|
target_triplet = @target@
|
||||||
subdir = data/html
|
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
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.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 \
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 \
|
$(top_srcdir)/m4/lt~obsolete.m4 \
|
||||||
$(top_srcdir)/m4/nut_arg_with.m4 \
|
$(top_srcdir)/m4/nut_arg_with.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_asciidoc.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_libavahi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
$(top_srcdir)/m4/nut_check_libltdl.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_check_libmodbus.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libnetsnmp.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_libpowerman.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libssl.m4 \
|
|
||||||
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
$(top_srcdir)/m4/nut_check_libusb.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
$(top_srcdir)/m4/nut_check_libwrap.m4 \
|
||||||
$(top_srcdir)/m4/nut_check_os.m4 \
|
$(top_srcdir)/m4/nut_check_os.m4 \
|
||||||
$(top_srcdir)/m4/nut_config_libhal.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_report_feature.m4 \
|
||||||
|
$(top_srcdir)/m4/nut_stash_warnings.m4 \
|
||||||
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
|
||||||
$(top_srcdir)/configure.in
|
$(top_srcdir)/configure.ac
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
$(ACLOCAL_M4)
|
$(ACLOCAL_M4)
|
||||||
|
DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_html_DATA_DIST) \
|
||||||
|
$(am__DIST_COMMON)
|
||||||
mkinstalldirs = $(install_sh) -d
|
mkinstalldirs = $(install_sh) -d
|
||||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||||
CONFIG_CLEAN_FILES = header.html
|
CONFIG_CLEAN_FILES = header.html
|
||||||
CONFIG_CLEAN_VPATH_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 =
|
SOURCES =
|
||||||
DIST_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__dist_html_DATA_DIST = index.html bottom.html nut-banner.png
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||||
am__vpath_adj = case $$p in \
|
am__vpath_adj = case $$p in \
|
||||||
|
@ -91,14 +173,26 @@ am__nobase_list = $(am__nobase_strip_setup); \
|
||||||
am__base_list = \
|
am__base_list = \
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||||
sed '$$!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)"
|
am__installdirs = "$(DESTDIR)$(htmldir)" "$(DESTDIR)$(htmldir)"
|
||||||
DATA = $(dist_html_DATA) $(nodist_html_DATA)
|
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)
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
A2X = @A2X@
|
A2X = @A2X@
|
||||||
ACLOCAL = @ACLOCAL@
|
ACLOCAL = @ACLOCAL@
|
||||||
AMTAR = @AMTAR@
|
AMTAR = @AMTAR@
|
||||||
|
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||||
AR = @AR@
|
AR = @AR@
|
||||||
ASCIIDOC = @ASCIIDOC@
|
ASCIIDOC = @ASCIIDOC@
|
||||||
|
ASPELL = @ASPELL@
|
||||||
|
AUGPARSE = @AUGPARSE@
|
||||||
AUTOCONF = @AUTOCONF@
|
AUTOCONF = @AUTOCONF@
|
||||||
AUTOHEADER = @AUTOHEADER@
|
AUTOHEADER = @AUTOHEADER@
|
||||||
AUTOMAKE = @AUTOMAKE@
|
AUTOMAKE = @AUTOMAKE@
|
||||||
|
@ -109,16 +203,25 @@ CCDEPMODE = @CCDEPMODE@
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
CONFPATH = @CONFPATH@
|
CONFPATH = @CONFPATH@
|
||||||
CPP = @CPP@
|
CPP = @CPP@
|
||||||
|
CPPCHECK = @CPPCHECK@
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
|
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||||
|
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||||
|
CXX = @CXX@
|
||||||
|
CXXCPP = @CXXCPP@
|
||||||
|
CXXDEPMODE = @CXXDEPMODE@
|
||||||
|
CXXFLAGS = @CXXFLAGS@
|
||||||
CYGPATH_W = @CYGPATH_W@
|
CYGPATH_W = @CYGPATH_W@
|
||||||
DBLATEX = @DBLATEX@
|
DBLATEX = @DBLATEX@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
DEPDIR = @DEPDIR@
|
DEPDIR = @DEPDIR@
|
||||||
DLLTOOL = @DLLTOOL@
|
DLLTOOL = @DLLTOOL@
|
||||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||||
|
DOC_CHECK_LIST = @DOC_CHECK_LIST@
|
||||||
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
|
||||||
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
|
||||||
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
|
||||||
|
DRVPATH = @DRVPATH@
|
||||||
DSYMUTIL = @DSYMUTIL@
|
DSYMUTIL = @DSYMUTIL@
|
||||||
DUMPBIN = @DUMPBIN@
|
DUMPBIN = @DUMPBIN@
|
||||||
ECHO_C = @ECHO_C@
|
ECHO_C = @ECHO_C@
|
||||||
|
@ -127,11 +230,8 @@ ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
FGREP = @FGREP@
|
FGREP = @FGREP@
|
||||||
|
GDLIB_CONFIG = @GDLIB_CONFIG@
|
||||||
GREP = @GREP@
|
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@
|
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
|
@ -141,14 +241,15 @@ LD = @LD@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||||
|
LIBDIR = @LIBDIR@
|
||||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
|
||||||
LIBHAL_LIBS = @LIBHAL_LIBS@
|
|
||||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||||
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
LIBLTDL_CFLAGS = @LIBLTDL_CFLAGS@
|
||||||
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
LIBLTDL_LIBS = @LIBLTDL_LIBS@
|
||||||
|
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
||||||
|
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
||||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||||
|
@ -159,21 +260,29 @@ LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||||
|
LIBSSL_REQUIRES = @LIBSSL_REQUIRES@
|
||||||
LIBTOOL = @LIBTOOL@
|
LIBTOOL = @LIBTOOL@
|
||||||
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||||
|
LIBUSB_CONFIG = @LIBUSB_CONFIG@
|
||||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||||
LIPO = @LIPO@
|
LIPO = @LIPO@
|
||||||
LN_S = @LN_S@
|
LN_S = @LN_S@
|
||||||
|
LN_S_R = @LN_S_R@
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
LTLIBOBJS = @LTLIBOBJS@
|
||||||
|
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||||
MAINT = @MAINT@
|
MAINT = @MAINT@
|
||||||
MAKEINFO = @MAKEINFO@
|
MAKEINFO = @MAKEINFO@
|
||||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||||
MKDIR_P = @MKDIR_P@
|
MKDIR_P = @MKDIR_P@
|
||||||
NETLIBS = @NETLIBS@
|
NETLIBS = @NETLIBS@
|
||||||
|
NET_SNMP_CONFIG = @NET_SNMP_CONFIG@
|
||||||
NM = @NM@
|
NM = @NM@
|
||||||
NMEDIT = @NMEDIT@
|
NMEDIT = @NMEDIT@
|
||||||
|
NUT_DATADIR = @NUT_DATADIR@
|
||||||
|
NUT_LIBEXECDIR = @NUT_LIBEXECDIR@
|
||||||
NUT_NETVERSION = @NUT_NETVERSION@
|
NUT_NETVERSION = @NUT_NETVERSION@
|
||||||
OBJDUMP = @OBJDUMP@
|
OBJDUMP = @OBJDUMP@
|
||||||
OBJEXT = @OBJEXT@
|
OBJEXT = @OBJEXT@
|
||||||
|
@ -193,6 +302,9 @@ PKG_CONFIG = @PKG_CONFIG@
|
||||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||||
PORT = @PORT@
|
PORT = @PORT@
|
||||||
|
PYTHON = @PYTHON@
|
||||||
|
PYTHON2 = @PYTHON2@
|
||||||
|
PYTHON3 = @PYTHON3@
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||||
RUN_AS_USER = @RUN_AS_USER@
|
RUN_AS_USER = @RUN_AS_USER@
|
||||||
|
@ -201,24 +313,30 @@ SED = @SED@
|
||||||
SERLIBS = @SERLIBS@
|
SERLIBS = @SERLIBS@
|
||||||
SET_MAKE = @SET_MAKE@
|
SET_MAKE = @SET_MAKE@
|
||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
|
SOURCE_HIGHLIGHT = @SOURCE_HIGHLIGHT@
|
||||||
STATEPATH = @STATEPATH@
|
STATEPATH = @STATEPATH@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
SUN_LIBUSB = @SUN_LIBUSB@
|
SUN_LIBUSB = @SUN_LIBUSB@
|
||||||
TREE_VERSION = @TREE_VERSION@
|
TREE_VERSION = @TREE_VERSION@
|
||||||
|
VALGRIND = @VALGRIND@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
|
||||||
|
XMLLINT = @XMLLINT@
|
||||||
|
XSLTPROC = @XSLTPROC@
|
||||||
abs_builddir = @abs_builddir@
|
abs_builddir = @abs_builddir@
|
||||||
abs_srcdir = @abs_srcdir@
|
abs_srcdir = @abs_srcdir@
|
||||||
abs_top_builddir = @abs_top_builddir@
|
abs_top_builddir = @abs_top_builddir@
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
abs_top_srcdir = @abs_top_srcdir@
|
||||||
ac_ct_AR = @ac_ct_AR@
|
ac_ct_AR = @ac_ct_AR@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||||
am__include = @am__include@
|
am__include = @am__include@
|
||||||
am__leading_dot = @am__leading_dot@
|
am__leading_dot = @am__leading_dot@
|
||||||
am__quote = @am__quote@
|
am__quote = @am__quote@
|
||||||
am__tar = @am__tar@
|
am__tar = @am__tar@
|
||||||
am__untar = @am__untar@
|
am__untar = @am__untar@
|
||||||
|
auglensdir = @auglensdir@
|
||||||
bindir = @bindir@
|
bindir = @bindir@
|
||||||
build = @build@
|
build = @build@
|
||||||
build_alias = @build_alias@
|
build_alias = @build_alias@
|
||||||
|
@ -229,8 +347,12 @@ builddir = @builddir@
|
||||||
cgiexecdir = @cgiexecdir@
|
cgiexecdir = @cgiexecdir@
|
||||||
datadir = @datadir@
|
datadir = @datadir@
|
||||||
datarootdir = @datarootdir@
|
datarootdir = @datarootdir@
|
||||||
|
devddir = @devddir@
|
||||||
docdir = @docdir@
|
docdir = @docdir@
|
||||||
driverexecdir = @driverexecdir@
|
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@
|
dvidir = @dvidir@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
host = @host@
|
host = @host@
|
||||||
|
@ -249,18 +371,21 @@ localedir = @localedir@
|
||||||
localstatedir = @localstatedir@
|
localstatedir = @localstatedir@
|
||||||
mandir = @mandir@
|
mandir = @mandir@
|
||||||
mkdir_p = @mkdir_p@
|
mkdir_p = @mkdir_p@
|
||||||
|
now = @now@
|
||||||
oldincludedir = @oldincludedir@
|
oldincludedir = @oldincludedir@
|
||||||
pdfdir = @pdfdir@
|
pdfdir = @pdfdir@
|
||||||
pkgconfigdir = @pkgconfigdir@
|
pkgconfigdir = @pkgconfigdir@
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
sysconfdir = @sysconfdir@
|
sysconfdir = @sysconfdir@
|
||||||
systemdsystemshutdowndir = @systemdsystemshutdowndir@
|
systemdshutdowndir = @systemdshutdowndir@
|
||||||
systemdsystemunitdir = @systemdsystemunitdir@
|
systemdsystemunitdir = @systemdsystemunitdir@
|
||||||
|
systemdtmpfilesdir = @systemdtmpfilesdir@
|
||||||
target = @target@
|
target = @target@
|
||||||
target_alias = @target_alias@
|
target_alias = @target_alias@
|
||||||
target_cpu = @target_cpu@
|
target_cpu = @target_cpu@
|
||||||
|
@ -271,11 +396,14 @@ top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
udevdir = @udevdir@
|
udevdir = @udevdir@
|
||||||
|
|
||||||
# Network UPS Tools: data/html
|
# Network UPS Tools: data/html
|
||||||
# install these only if configured --with-cgi
|
# install these only if configured --with-cgi
|
||||||
@WITH_CGI_TRUE@dist_html_DATA = index.html bottom.html nut-banner.png
|
@WITH_CGI_TRUE@dist_html_DATA = index.html bottom.html nut-banner.png
|
||||||
@WITH_CGI_TRUE@nodist_html_DATA = header.html
|
@WITH_CGI_TRUE@nodist_html_DATA = header.html
|
||||||
EXTRA_DIST = README
|
EXTRA_DIST = README
|
||||||
|
MAINTAINERCLEANFILES = Makefile.in .dirstamp
|
||||||
|
# Generated by configure script:
|
||||||
|
DISTCLEANFILES = header.html
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
@ -291,14 +419,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/html/Makefile'; \
|
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/html/Makefile'; \
|
||||||
$(am__cd) $(top_srcdir) && \
|
$(am__cd) $(top_srcdir) && \
|
||||||
$(AUTOMAKE) --gnu data/html/Makefile
|
$(AUTOMAKE) --gnu data/html/Makefile
|
||||||
.PRECIOUS: Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||||
@case '$?' in \
|
@case '$?' in \
|
||||||
*config.status*) \
|
*config.status*) \
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||||
*) \
|
*) \
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||||
esac;
|
esac;
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||||
|
@ -319,8 +446,11 @@ clean-libtool:
|
||||||
-rm -rf .libs _libs
|
-rm -rf .libs _libs
|
||||||
install-dist_htmlDATA: $(dist_html_DATA)
|
install-dist_htmlDATA: $(dist_html_DATA)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
|
|
||||||
@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
@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 \
|
for p in $$list; do \
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
echo "$$d$$p"; \
|
echo "$$d$$p"; \
|
||||||
|
@ -334,13 +464,14 @@ uninstall-dist_htmlDATA:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||||
test -n "$$files" || exit 0; \
|
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
|
||||||
echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
|
|
||||||
cd "$(DESTDIR)$(htmldir)" && rm -f $$files
|
|
||||||
install-nodist_htmlDATA: $(nodist_html_DATA)
|
install-nodist_htmlDATA: $(nodist_html_DATA)
|
||||||
@$(NORMAL_INSTALL)
|
@$(NORMAL_INSTALL)
|
||||||
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
|
|
||||||
@list='$(nodist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
@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 \
|
for p in $$list; do \
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||||
echo "$$d$$p"; \
|
echo "$$d$$p"; \
|
||||||
|
@ -354,17 +485,18 @@ uninstall-nodist_htmlDATA:
|
||||||
@$(NORMAL_UNINSTALL)
|
@$(NORMAL_UNINSTALL)
|
||||||
@list='$(nodist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
@list='$(nodist_html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||||
test -n "$$files" || exit 0; \
|
dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
|
||||||
echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
|
tags TAGS:
|
||||||
cd "$(DESTDIR)$(htmldir)" && rm -f $$files
|
|
||||||
tags: TAGS
|
|
||||||
TAGS:
|
|
||||||
|
|
||||||
ctags: CTAGS
|
ctags CTAGS:
|
||||||
CTAGS:
|
|
||||||
|
cscope cscopelist:
|
||||||
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
distdir: $(BUILT_SOURCES)
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||||
|
|
||||||
|
distdir-am: $(DISTFILES)
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||||
list='$(DISTFILES)'; \
|
list='$(DISTFILES)'; \
|
||||||
|
@ -411,10 +543,15 @@ install-am: all-am
|
||||||
|
|
||||||
installcheck: installcheck-am
|
installcheck: installcheck-am
|
||||||
install-strip:
|
install-strip:
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
if test -z '$(STRIP)'; then \
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||||
`test -z '$(STRIP)' || \
|
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
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
|
||||||
mostlyclean-generic:
|
mostlyclean-generic:
|
||||||
|
|
||||||
clean-generic:
|
clean-generic:
|
||||||
|
@ -422,10 +559,12 @@ clean-generic:
|
||||||
distclean-generic:
|
distclean-generic:
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
-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 . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||||
|
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||||
|
|
||||||
maintainer-clean-generic:
|
maintainer-clean-generic:
|
||||||
@echo "This command is intended for maintainers to use"
|
@echo "This command is intended for maintainers to use"
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||||
clean: clean-am
|
clean: clean-am
|
||||||
|
|
||||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||||
|
@ -495,18 +634,21 @@ uninstall-am: uninstall-dist_htmlDATA uninstall-nodist_htmlDATA
|
||||||
.MAKE: install-am install-strip
|
.MAKE: install-am install-strip
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||||
distclean distclean-generic distclean-libtool distdir dvi \
|
cscopelist-am ctags-am distclean distclean-generic \
|
||||||
dvi-am html html-am info info-am install install-am \
|
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||||
install-data install-data-am install-dist_htmlDATA install-dvi \
|
install install-am install-data install-data-am \
|
||||||
install-dvi-am install-exec install-exec-am install-html \
|
install-dist_htmlDATA install-dvi install-dvi-am install-exec \
|
||||||
install-html-am install-info install-info-am install-man \
|
install-exec-am install-html install-html-am install-info \
|
||||||
install-nodist_htmlDATA install-pdf install-pdf-am install-ps \
|
install-info-am install-man install-nodist_htmlDATA \
|
||||||
install-ps-am install-strip installcheck installcheck-am \
|
install-pdf install-pdf-am install-ps install-ps-am \
|
||||||
installdirs maintainer-clean maintainer-clean-generic \
|
install-strip installcheck installcheck-am installdirs \
|
||||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||||
ps ps-am uninstall uninstall-am uninstall-dist_htmlDATA \
|
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||||
|
tags-am uninstall uninstall-am uninstall-dist_htmlDATA \
|
||||||
uninstall-nodist_htmlDATA
|
uninstall-nodist_htmlDATA
|
||||||
|
|
||||||
|
.PRECIOUS: Makefile
|
||||||
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# 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.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>
|
<title>
|
||||||
Network UPS Tools
|
Network UPS Tools
|
||||||
</title>
|
</title>
|
||||||
</head>
|
</head>
|
||||||
<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B">
|
<body BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B">
|
||||||
|
|
19
debian/NEWS
vendored
Normal file
19
debian/NEWS
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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
|
1934
debian/changelog
vendored
Normal file
1934
debian/changelog
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
12
|
305
debian/control
vendored
Normal file
305
debian/control
vendored
Normal file
|
@ -0,0 +1,305 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
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}
|
||||||
|
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
|
||||||
|
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 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.
|
||||||
|
|
||||||
|
Package: nut-cgi
|
||||||
|
Architecture: any
|
||||||
|
Depends: adduser, ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
Recommends: apache2 | httpd-cgi
|
||||||
|
Suggests: nut
|
||||||
|
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
|
||||||
|
power distribution unit (PDU) hardware. Clients access the hardware
|
||||||
|
through the server, and are notified whenever the power status
|
||||||
|
changes.
|
||||||
|
.
|
||||||
|
This package provides an HTTP interface for Network UPS Tools which makes
|
||||||
|
it possible to monitor the core NUT system with a web browser.
|
||||||
|
|
||||||
|
Package: nut-snmp
|
||||||
|
Architecture: any
|
||||||
|
Depends: nut (>= 1.4.1-pre1), ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
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
|
||||||
|
power distribution unit (PDU) hardware. Clients access the hardware
|
||||||
|
through the server, and are notified whenever the power status
|
||||||
|
changes.
|
||||||
|
.
|
||||||
|
This package provides snmp-ups, the SNMP multi-MIB driver for UPS, which
|
||||||
|
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
|
||||||
|
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.
|
||||||
|
|
||||||
|
Package: nut-xml
|
||||||
|
Architecture: any
|
||||||
|
Depends: nut (>= 2.2.2), ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
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
|
||||||
|
power distribution unit (PDU) hardware. Clients access the hardware
|
||||||
|
through the server, and are notified whenever the power status
|
||||||
|
changes.
|
||||||
|
.
|
||||||
|
This package provides netxml-ups, which supports UPS models from
|
||||||
|
Eaton or MGE that use an XML/HTTP-based Network Management Card or
|
||||||
|
Proxy.
|
||||||
|
|
||||||
|
Package: nut-powerman-pdu
|
||||||
|
Architecture: any
|
||||||
|
Depends: nut (>= 2.4.0),
|
||||||
|
powerman (>= 2.3.3),
|
||||||
|
${misc:Depends},
|
||||||
|
${shlibs:Depends}
|
||||||
|
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
|
||||||
|
power distribution unit (PDU) hardware. Clients access the hardware
|
||||||
|
through the server, and are notified whenever the power status
|
||||||
|
changes.
|
||||||
|
.
|
||||||
|
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
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||||
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
|
Multi-Arch: same
|
||||||
|
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
|
||||||
|
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 client library.
|
||||||
|
|
||||||
|
Package: libupsclient-dev
|
||||||
|
Section: libdevel
|
||||||
|
Architecture: any
|
||||||
|
Depends: libnss3-dev,
|
||||||
|
libupsclient4 (= ${binary:Version}),
|
||||||
|
${misc:Depends},
|
||||||
|
${shlibs:Depends}
|
||||||
|
Multi-Arch: same
|
||||||
|
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
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
69
debian/copyright
vendored
Normal file
69
debian/copyright
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
This package was debianized by Luca Filipozzi <lfilipoz@debian.org> on
|
||||||
|
Wed Jun 28 19:48:05 PDT 2000
|
||||||
|
|
||||||
|
It was downloaded from http://www.networkupstools.org/
|
||||||
|
|
||||||
|
Upstream Authors:
|
||||||
|
|
||||||
|
Russell Kroll <rkroll@exploits.org>
|
||||||
|
Arnaud Quette <http://arnaud.quette.free.fr/contact.html>
|
||||||
|
Arjen de Korte <arjen@de-korte.org>
|
||||||
|
Charles Lepple <clepple@gmail.com>
|
||||||
|
Kjell Claesson <kjell.claesson@epost.tidanet.se>
|
||||||
|
David Goncalves <david@lestat.st>
|
||||||
|
and the NUT Team
|
||||||
|
|
||||||
|
Copyright:
|
||||||
|
|
||||||
|
Copyright (C) 2000-2008 Russell Kroll, Arnaud Quette and the NUT Team
|
||||||
|
|
||||||
|
Licenses:
|
||||||
|
|
||||||
|
Most files are licensed under the GNU General Public License (GPL) version 2,
|
||||||
|
or (at your option) any later version.
|
||||||
|
|
||||||
|
The files in the scripts/python/ directory are released under GNU General
|
||||||
|
Public License (GPL) version 3, or (at your option) any later version.
|
||||||
|
|
||||||
|
GPL-2
|
||||||
|
-----
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
On Debian systems, the full text of the GNU General Public License v2
|
||||||
|
may be found in /usr/share/common-licenses/GPL-2.
|
||||||
|
|
||||||
|
GPL-3
|
||||||
|
-----
|
||||||
|
|
||||||
|
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/>.
|
||||||
|
|
||||||
|
On Debian systems, the full text of the GNU General Public License v3
|
||||||
|
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'.
|
8
debian/gbp.conf
vendored
Normal file
8
debian/gbp.conf
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[DEFAULT]
|
||||||
|
debian-branch = debian
|
||||||
|
upstream-branch = upstream
|
||||||
|
pristine-tar = True
|
||||||
|
|
||||||
|
[git-buildpackage]
|
||||||
|
tarball-dir = ../tarballs/
|
||||||
|
export-dir = ../build-area/
|
4
debian/libnutclient-dev.install
vendored
Normal file
4
debian/libnutclient-dev.install
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
usr/include/nutclient.h
|
||||||
|
usr/lib/*/libnutclient.a
|
||||||
|
usr/lib/*/libnutclient.so
|
||||||
|
usr/lib/*/pkgconfig/libnutclient.pc
|
1
debian/libnutclient0.install
vendored
Normal file
1
debian/libnutclient0.install
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
lib/*/libnutclient.so.*
|
199
debian/libnutclient0.symbols
vendored
Normal file
199
debian/libnutclient0.symbols
vendored
Normal file
|
@ -0,0 +1,199 @@
|
||||||
|
# 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
Normal file
6
debian/libnutscan-dev.install
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
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
Normal file
1
debian/libnutscan1.install
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
lib/*/libnutscan.so.*
|
157
debian/libnutscan1.symbols
vendored
Normal file
157
debian/libnutscan1.symbols
vendored
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
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
Normal file
1
debian/libups-nut-perl.install
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
scripts/perl/Nut.pm /usr/share/perl5/UPS/
|
5
debian/libupsclient-dev.install
vendored
Normal file
5
debian/libupsclient-dev.install
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
usr/include/parseconf.h
|
||||||
|
usr/include/upsclient.h
|
||||||
|
usr/lib/*/libupsclient.a
|
||||||
|
usr/lib/*/libupsclient.so
|
||||||
|
usr/lib/*/pkgconfig/libupsclient.pc
|
1
debian/libupsclient4.install
vendored
Normal file
1
debian/libupsclient4.install
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
lib/*/libupsclient.so.*
|
114
debian/libupsclient4.symbols
vendored
Normal file
114
debian/libupsclient4.symbols
vendored
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
libupsclient.so.4 libupsclient4 #MINVER#
|
||||||
|
* Build-Depends-Package: libupsclient-dev
|
||||||
|
UPS_VERSION@Base 2.7.2
|
||||||
|
altpidpath@Base 2.7.2
|
||||||
|
background@Base 2.7.2
|
||||||
|
become_user@Base 2.7.2
|
||||||
|
chroot_start@Base 2.7.2
|
||||||
|
confpath@Base 2.7.2
|
||||||
|
dflt_statepath@Base 2.7.2
|
||||||
|
fatal_with_errno@Base 2.7.2
|
||||||
|
fatalx@Base 2.7.2
|
||||||
|
get_user_pwent@Base 2.7.2
|
||||||
|
nut_debug_level@Base 2.7.2
|
||||||
|
nut_log_level@Base 2.7.2
|
||||||
|
open_syslog@Base 2.7.2
|
||||||
|
pconf_char@Base 2.7.2
|
||||||
|
pconf_encode@Base 2.7.2
|
||||||
|
pconf_file_begin@Base 2.7.2
|
||||||
|
pconf_file_next@Base 2.7.2
|
||||||
|
pconf_finish@Base 2.7.2
|
||||||
|
pconf_init@Base 2.7.2
|
||||||
|
pconf_line@Base 2.7.2
|
||||||
|
pconf_parse_error@Base 2.7.2
|
||||||
|
select_read@Base 2.7.2
|
||||||
|
select_write@Base 2.7.2
|
||||||
|
sendsignal@Base 2.7.2
|
||||||
|
sendsignalfn@Base 2.7.2
|
||||||
|
snprintfcat@Base 2.7.2
|
||||||
|
state_addcmd@Base 2.7.2
|
||||||
|
state_addenum@Base 2.7.2
|
||||||
|
state_addrange@Base 2.7.2
|
||||||
|
state_cmdfree@Base 2.7.2
|
||||||
|
state_delcmd@Base 2.7.2
|
||||||
|
state_delenum@Base 2.7.2
|
||||||
|
state_delinfo@Base 2.7.2
|
||||||
|
state_delrange@Base 2.7.2
|
||||||
|
state_getaux@Base 2.7.2
|
||||||
|
state_getenumlist@Base 2.7.2
|
||||||
|
state_getflags@Base 2.7.2
|
||||||
|
state_getinfo@Base 2.7.2
|
||||||
|
state_getrangelist@Base 2.7.2
|
||||||
|
state_infofree@Base 2.7.2
|
||||||
|
state_setaux@Base 2.7.2
|
||||||
|
state_setflags@Base 2.7.2
|
||||||
|
state_setinfo@Base 2.7.2
|
||||||
|
state_tree_find@Base 2.7.2
|
||||||
|
str_is_double@Base 2.7.4
|
||||||
|
str_is_double_strict@Base 2.7.4
|
||||||
|
str_is_int@Base 2.7.4
|
||||||
|
str_is_int_strict@Base 2.7.4
|
||||||
|
str_is_long@Base 2.7.4
|
||||||
|
str_is_long_strict@Base 2.7.4
|
||||||
|
str_is_short@Base 2.7.4
|
||||||
|
str_is_short_strict@Base 2.7.4
|
||||||
|
str_is_uint@Base 2.7.4
|
||||||
|
str_is_uint_strict@Base 2.7.4
|
||||||
|
str_is_ulong@Base 2.7.4
|
||||||
|
str_is_ulong_strict@Base 2.7.4
|
||||||
|
str_is_ushort@Base 2.7.4
|
||||||
|
str_is_ushort_strict@Base 2.7.4
|
||||||
|
str_ltrim@Base 2.7.4
|
||||||
|
str_ltrim_m@Base 2.7.4
|
||||||
|
str_ltrim_space@Base 2.7.4
|
||||||
|
str_rtrim@Base 2.7.4
|
||||||
|
str_rtrim_m@Base 2.7.4
|
||||||
|
str_rtrim_space@Base 2.7.4
|
||||||
|
str_to_double@Base 2.7.4
|
||||||
|
str_to_double_strict@Base 2.7.4
|
||||||
|
str_to_int@Base 2.7.4
|
||||||
|
str_to_int_strict@Base 2.7.4
|
||||||
|
str_to_long@Base 2.7.4
|
||||||
|
str_to_long_strict@Base 2.7.4
|
||||||
|
str_to_short@Base 2.7.4
|
||||||
|
str_to_short_strict@Base 2.7.4
|
||||||
|
str_to_uint@Base 2.7.4
|
||||||
|
str_to_uint_strict@Base 2.7.4
|
||||||
|
str_to_ulong@Base 2.7.4
|
||||||
|
str_to_ulong_strict@Base 2.7.4
|
||||||
|
str_to_ushort@Base 2.7.4
|
||||||
|
str_to_ushort_strict@Base 2.7.4
|
||||||
|
str_trim@Base 2.7.4
|
||||||
|
str_trim_m@Base 2.7.4
|
||||||
|
str_trim_space@Base 2.7.4
|
||||||
|
syslogbit_set@Base 2.7.2
|
||||||
|
upscli_add_host_cert@Base 2.7.2
|
||||||
|
upscli_cleanup@Base 2.7.2
|
||||||
|
upscli_connect@Base 2.7.2
|
||||||
|
upscli_disconnect@Base 2.7.2
|
||||||
|
upscli_errlist@Base 2.7.2
|
||||||
|
upscli_fd@Base 2.7.2
|
||||||
|
upscli_get@Base 2.7.2
|
||||||
|
upscli_init@Base 2.7.2
|
||||||
|
upscli_list_next@Base 2.7.2
|
||||||
|
upscli_list_start@Base 2.7.2
|
||||||
|
upscli_readline@Base 2.7.2
|
||||||
|
upscli_sendline@Base 2.7.2
|
||||||
|
upscli_splitaddr@Base 2.7.2
|
||||||
|
upscli_splitname@Base 2.7.2
|
||||||
|
upscli_ssl@Base 2.7.2
|
||||||
|
upscli_strerror@Base 2.7.2
|
||||||
|
upscli_tryconnect@Base 2.7.2
|
||||||
|
upscli_upserror@Base 2.7.2
|
||||||
|
upsdebug_ascii@Base 2.7.2
|
||||||
|
upsdebug_hex@Base 2.7.2
|
||||||
|
upsdebug_with_errno@Base 2.7.2
|
||||||
|
upsdebugx@Base 2.7.2
|
||||||
|
upslog_with_errno@Base 2.7.2
|
||||||
|
upslogx@Base 2.7.2
|
||||||
|
writepid@Base 2.7.2
|
||||||
|
xbasename@Base 2.7.2
|
||||||
|
xcalloc@Base 2.7.2
|
||||||
|
xmalloc@Base 2.7.2
|
||||||
|
xrealloc@Base 2.7.2
|
||||||
|
xstrdup@Base 2.7.2
|
BIN
debian/local/nut-monitor.png
vendored
Normal file
BIN
debian/local/nut-monitor.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
490
debian/local/nut-monitor.svg
vendored
Normal file
490
debian/local/nut-monitor.svg
vendored
Normal file
|
@ -0,0 +1,490 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://web.resource.org/cc/"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="48"
|
||||||
|
height="48"
|
||||||
|
id="svg2"
|
||||||
|
sodipodi:version="0.32"
|
||||||
|
inkscape:version="0.45"
|
||||||
|
version="1.0"
|
||||||
|
sodipodi:docbase="/home/dobey/Projects/gnome-icon-theme/scalable/devices"
|
||||||
|
sodipodi:docname="battery.svg"
|
||||||
|
inkscape:export-filename="/home/lapo/Desktop/per jimmac/scalable/devices/battery.png"
|
||||||
|
inkscape:export-xdpi="90"
|
||||||
|
inkscape:export-ydpi="90"
|
||||||
|
inkscape:output_extension="org.inkscape.output.svg.inkscape">
|
||||||
|
<defs
|
||||||
|
id="defs4">
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient3367">
|
||||||
|
<stop
|
||||||
|
id="stop3369"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#555753" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#8a8d85;stop-opacity:1;"
|
||||||
|
offset="0.32156199"
|
||||||
|
id="stop3371" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#babdb6;stop-opacity:1;"
|
||||||
|
offset="0.53021115"
|
||||||
|
id="stop3373" />
|
||||||
|
<stop
|
||||||
|
id="stop3375"
|
||||||
|
offset="0.85266888"
|
||||||
|
style="stop-color:#dcdeda;stop-opacity:1;" />
|
||||||
|
<stop
|
||||||
|
id="stop3377"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#babdb6" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3351">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#888a85"
|
||||||
|
offset="0"
|
||||||
|
id="stop3353" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#555753"
|
||||||
|
offset="1"
|
||||||
|
id="stop3355" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3290">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3292" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3294" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3280">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#000000;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3282" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#000000;stop-opacity:0;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3284" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3265">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#c4a000;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3267" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#c4a000;stop-opacity:0;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3269" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3254">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3256" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3258" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient3236">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3238" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#fce94f"
|
||||||
|
offset="1"
|
||||||
|
id="stop3240" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3227">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3229" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3231" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3217">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#c4a000;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3219" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#edd400"
|
||||||
|
offset="1"
|
||||||
|
id="stop3221" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
id="linearGradient3174">
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:1;"
|
||||||
|
offset="0"
|
||||||
|
id="stop3176" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#ffffff;stop-opacity:0;"
|
||||||
|
offset="1"
|
||||||
|
id="stop3178" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient
|
||||||
|
id="linearGradient3146">
|
||||||
|
<stop
|
||||||
|
id="stop3148"
|
||||||
|
offset="0"
|
||||||
|
style="stop-color:#c4a000" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#d8ba00;stop-opacity:1;"
|
||||||
|
offset="0.35133624"
|
||||||
|
id="stop3160" />
|
||||||
|
<stop
|
||||||
|
style="stop-color:#edd400;stop-opacity:1;"
|
||||||
|
offset="0.50020754"
|
||||||
|
id="stop3152" />
|
||||||
|
<stop
|
||||||
|
id="stop3162"
|
||||||
|
offset="0.85000002"
|
||||||
|
style="stop-color:#fdf4a7;stop-opacity:1;" />
|
||||||
|
<stop
|
||||||
|
id="stop3158"
|
||||||
|
offset="1"
|
||||||
|
style="stop-color:#fce94f" />
|
||||||
|
</linearGradient>
|
||||||
|
<radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3280"
|
||||||
|
id="radialGradient3286"
|
||||||
|
cx="21.34375"
|
||||||
|
cy="14.125"
|
||||||
|
fx="21.34375"
|
||||||
|
fy="14.125"
|
||||||
|
r="11.96875"
|
||||||
|
gradientTransform="matrix(1,0,0,0.302872,8.341852e-16,9.846932)"
|
||||||
|
gradientUnits="userSpaceOnUse" />
|
||||||
|
<radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3236"
|
||||||
|
id="radialGradient3337"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(0.690032,-4.583908e-18,1.406348e-18,0.228281,6.615871,10.90053)"
|
||||||
|
cx="19.717636"
|
||||||
|
cy="16.677069"
|
||||||
|
fx="19.717636"
|
||||||
|
fy="16.677069"
|
||||||
|
r="12.46875" />
|
||||||
|
<radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3174"
|
||||||
|
id="radialGradient3339"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(1.253821,-0.396912,0.124986,0.425706,-7.949749,14.71501)"
|
||||||
|
cx="19.161945"
|
||||||
|
cy="24.691038"
|
||||||
|
fx="19.161945"
|
||||||
|
fy="24.691038"
|
||||||
|
r="12.46875" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3265"
|
||||||
|
id="linearGradient3341"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="31.18708"
|
||||||
|
y1="9.9904861"
|
||||||
|
x2="25.531752"
|
||||||
|
y2="18.613125" />
|
||||||
|
<radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3174"
|
||||||
|
id="radialGradient3343"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(1.253821,-0.396912,0.124986,0.425706,-7.949749,14.71501)"
|
||||||
|
cx="19.161945"
|
||||||
|
cy="24.691038"
|
||||||
|
fx="19.161945"
|
||||||
|
fy="24.691038"
|
||||||
|
r="12.46875" />
|
||||||
|
<radialGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3227"
|
||||||
|
id="radialGradient3347"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="matrix(1.499279,-0.163895,3.603099e-2,0.557877,-10.01886,8.004429)"
|
||||||
|
cx="19.863604"
|
||||||
|
cy="11.205179"
|
||||||
|
fx="19.863604"
|
||||||
|
fy="11.205179"
|
||||||
|
r="4" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3217"
|
||||||
|
id="linearGradient3380"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="translate(2,-4.760636e-13)"
|
||||||
|
x1="18.5625"
|
||||||
|
y1="11.1875"
|
||||||
|
x2="17.71875"
|
||||||
|
y2="12.534899" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3146"
|
||||||
|
id="linearGradient3384"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="translate(2,-4.760636e-13)"
|
||||||
|
x1="25.500298"
|
||||||
|
y1="10.985043"
|
||||||
|
x2="17.499449"
|
||||||
|
y2="10.985043" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3351"
|
||||||
|
id="linearGradient3393"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="13.375"
|
||||||
|
y1="23.221346"
|
||||||
|
x2="13.375"
|
||||||
|
y2="32.383766"
|
||||||
|
gradientTransform="translate(-2,-4.760636e-13)" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3290"
|
||||||
|
id="linearGradient3398"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
x1="13.96536"
|
||||||
|
y1="10.495919"
|
||||||
|
x2="20.682875"
|
||||||
|
y2="31.382992"
|
||||||
|
gradientTransform="translate(2,0)" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3254"
|
||||||
|
id="linearGradient3401"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="translate(2,-4.760636e-13)"
|
||||||
|
x1="12.25"
|
||||||
|
y1="20.230709"
|
||||||
|
x2="17.125"
|
||||||
|
y2="34.173542" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3146"
|
||||||
|
id="linearGradient3404"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="translate(2,-4.760636e-13)"
|
||||||
|
x1="33.5625"
|
||||||
|
y1="19.125"
|
||||||
|
x2="9.4987011"
|
||||||
|
y2="19.125" />
|
||||||
|
<linearGradient
|
||||||
|
inkscape:collect="always"
|
||||||
|
xlink:href="#linearGradient3367"
|
||||||
|
id="linearGradient3407"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="translate(2,-4.760636e-13)"
|
||||||
|
x1="33.50008"
|
||||||
|
y1="28.375"
|
||||||
|
x2="9.4992361"
|
||||||
|
y2="28.375" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1"
|
||||||
|
inkscape:cx="34.743513"
|
||||||
|
inkscape:cy="19.440609"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer5"
|
||||||
|
showgrid="false"
|
||||||
|
gridempspacing="2"
|
||||||
|
gridspacingx="0.5px"
|
||||||
|
gridspacingy="0.5px"
|
||||||
|
inkscape:window-width="872"
|
||||||
|
inkscape:window-height="771"
|
||||||
|
inkscape:window-x="392"
|
||||||
|
inkscape:window-y="55"
|
||||||
|
stroke="#c4a000"
|
||||||
|
inkscape:grid-points="false"
|
||||||
|
inkscape:grid-bbox="true"
|
||||||
|
fill="#555753"
|
||||||
|
showborder="false"
|
||||||
|
inkscape:showpageshadow="false" />
|
||||||
|
<metadata
|
||||||
|
id="metadata7">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title>Lapo Calamandrei</dc:title>
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<dc:title>Battery</dc:title>
|
||||||
|
<dc:subject>
|
||||||
|
<rdf:Bag>
|
||||||
|
<rdf:li>battery</rdf:li>
|
||||||
|
<rdf:li>recharge</rdf:li>
|
||||||
|
<rdf:li>power</rdf:li>
|
||||||
|
<rdf:li>acpi</rdf:li>
|
||||||
|
<rdf:li>apm</rdf:li>
|
||||||
|
</rdf:Bag>
|
||||||
|
</dc:subject>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:License
|
||||||
|
rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||||
|
<cc:permits
|
||||||
|
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||||
|
<cc:requires
|
||||||
|
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||||
|
</cc:License>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer6"
|
||||||
|
inkscape:label="Shadow"
|
||||||
|
style="display:inline">
|
||||||
|
<path
|
||||||
|
sodipodi:type="arc"
|
||||||
|
style="opacity:0.7254902;color:#000000;fill:url(#radialGradient3286);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
id="path3278"
|
||||||
|
sodipodi:cx="21.34375"
|
||||||
|
sodipodi:cy="14.125"
|
||||||
|
sodipodi:rx="11.96875"
|
||||||
|
sodipodi:ry="3.625"
|
||||||
|
d="M 33.3125 14.125 A 11.96875 3.625 0 1 1 9.375,14.125 A 11.96875 3.625 0 1 1 33.3125 14.125 z"
|
||||||
|
transform="matrix(1.389034,0,0,1.337644,-6.147196,18.98077)" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer2"
|
||||||
|
inkscape:label="Battery"
|
||||||
|
style="display:inline" />
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer4"
|
||||||
|
inkscape:label="inner stroke"
|
||||||
|
style="display:inline" />
|
||||||
|
<g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer5"
|
||||||
|
inkscape:label="tip"
|
||||||
|
style="display:inline">
|
||||||
|
<path
|
||||||
|
style="color:#000000;fill:url(#linearGradient3407);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 22,10.5 C 16.084021,10.716519 11.5,12.21646 11.5,14 L 11.5,37 C 11.5,38.932002 16.876,40.500001 23.5,40.5 C 30.124,40.5 35.5,38.932003 35.5,37 L 35.5,14 C 35.5,12.067998 30.124001,10.5 23.5,10.5 C 23.13775,10.5 22.79161,10.490818 22.4375,10.5 C 22.294038,10.50372 22.141983,10.494804 22,10.5 z "
|
||||||
|
id="path2230"
|
||||||
|
sodipodi:nodetypes="csssssssc" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;fill:url(#linearGradient3404);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 22.4375,10.5 C 16.316456,10.658717 11.5,12.173655 11.5,14 L 11.5,20.5 C 11.5,22.432002 16.875999,24.000001 23.5,24 C 30.124,24 35.5,22.432001 35.5,20.5 L 35.5,14 C 35.5,12.067998 30.124,10.5 23.5,10.5 C 23.13775,10.5 22.79161,10.490818 22.4375,10.5 z "
|
||||||
|
id="path2232"
|
||||||
|
sodipodi:nodetypes="cssssssc" />
|
||||||
|
<path
|
||||||
|
style="opacity:0.36862745;color:#000000;fill:url(#linearGradient3401);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 15,16 L 20,16 L 20,40.3125 L 15,39.5 L 15,16 z "
|
||||||
|
id="rect3244"
|
||||||
|
sodipodi:nodetypes="ccccc" />
|
||||||
|
<path
|
||||||
|
style="opacity:0.34509804;color:#000000;fill:url(#linearGradient3398);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 22,10.5 C 16.084021,10.716519 11.5,12.21646 11.5,14 L 11.5,37 C 11.5,38.932002 16.876,40.500001 23.5,40.5 C 30.124,40.5 35.5,38.932003 35.5,37 L 35.5,14 C 35.5,12.067998 30.124001,10.5 23.5,10.5 C 23.13775,10.5 22.79161,10.490818 22.4375,10.5 C 22.294038,10.50372 22.141983,10.494804 22,10.5 z "
|
||||||
|
id="path3288"
|
||||||
|
sodipodi:nodetypes="csssssssc" />
|
||||||
|
<path
|
||||||
|
sodipodi:type="arc"
|
||||||
|
style="color:#000000;fill:url(#radialGradient3337);fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient3339);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
id="path3164"
|
||||||
|
sodipodi:cx="21.34375"
|
||||||
|
sodipodi:cy="14.125"
|
||||||
|
sodipodi:rx="11.96875"
|
||||||
|
sodipodi:ry="3.625"
|
||||||
|
d="M 33.3125 14.125 A 11.96875 3.625 0 1 1 9.375,14.125 A 11.96875 3.625 0 1 1 33.3125 14.125 z"
|
||||||
|
transform="matrix(1.002611,0,0,0.965518,2.100522,0.362061)" />
|
||||||
|
<path
|
||||||
|
sodipodi:type="arc"
|
||||||
|
style="opacity:0.63921569;color:#000000;fill:url(#linearGradient3341);fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient3343);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
id="path3263"
|
||||||
|
sodipodi:cx="21.34375"
|
||||||
|
sodipodi:cy="14.125"
|
||||||
|
sodipodi:rx="11.96875"
|
||||||
|
sodipodi:ry="3.625"
|
||||||
|
d="M 33.3125 14.125 A 11.96875 3.625 0 1 1 9.375,14.125 A 11.96875 3.625 0 1 1 33.3125 14.125 z"
|
||||||
|
transform="matrix(1.002611,0,0,0.965518,2.100522,0.362061)" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3393);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 11.5,21.5 L 11.5,37 C 11.5,38.932002 16.876,40.500001 23.5,40.5 C 30.124,40.5 35.5,38.932003 35.5,37 L 35.5,21.5"
|
||||||
|
id="path2217"
|
||||||
|
sodipodi:nodetypes="ccscc" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#c4a000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 35.5,21.5 L 35.5,14 C 35.5,12.067998 30.124001,10.5 23.5,10.5 C 23.13775,10.5 22.79161,10.490818 22.4375,10.5 C 22.294038,10.50372 22.141983,10.494804 22,10.5 C 16.084021,10.716519 11.5,12.21646 11.5,14 L 11.5,21.5"
|
||||||
|
id="path2219"
|
||||||
|
sodipodi:nodetypes="cssscsc" />
|
||||||
|
<path
|
||||||
|
style="opacity:0.49019608;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 21.84375,11.5 C 16.548895,11.680925 12.5,12.74668 12.5,14 C 12.5,15.142813 12.5,35.855219 12.5,37 C 12.5,38.38 17.427994,39.5 23.5,39.5 C 29.572006,39.5 34.5,38.38 34.5,37 C 34.5,35.940784 34.499999,15.059216 34.5,14 C 34.5,12.62 29.572007,11.5 23.5,11.5 C 23.1205,11.5 22.744639,11.49146 22.375,11.5 C 22.201732,11.504003 22.014552,11.494164 21.84375,11.5 z "
|
||||||
|
id="path2206"
|
||||||
|
sodipodi:nodetypes="csssssssc" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;fill:url(#linearGradient3384);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 23,9.5 C 21.315666,9.5803665 19.950192,10.074035 19.59375,10.6875 C 19.587086,10.699702 19.568368,10.737692 19.5625,10.75 C 19.559767,10.75618 19.533781,10.775045 19.53125,10.78125 C 19.528923,10.78748 19.533372,10.806246 19.53125,10.8125 C 19.521672,10.843887 19.504323,10.905557 19.5,10.9375 C 19.49935,10.943909 19.500435,10.96232 19.5,10.96875 C 19.499782,10.975199 19.5,12.993531 19.5,13 C 19.5,13.006469 19.499782,13.024801 19.5,13.03125 C 19.500435,13.03768 19.49935,13.056091 19.5,13.0625 C 19.504323,13.094443 19.521672,13.156113 19.53125,13.1875 C 19.533372,13.193754 19.528923,13.21252 19.53125,13.21875 C 19.533781,13.224955 19.559767,13.24382 19.5625,13.25 C 19.568368,13.262308 19.587086,13.300298 19.59375,13.3125 C 19.985483,13.986704 21.58525,14.5 23.5,14.5 C 25.41475,14.5 27.014517,13.986704 27.40625,13.3125 C 27.412914,13.300298 27.431632,13.262308 27.4375,13.25 C 27.440233,13.24382 27.466219,13.224955 27.46875,13.21875 C 27.471077,13.21252 27.466628,13.193754 27.46875,13.1875 C 27.478328,13.156113 27.495677,13.094443 27.5,13.0625 C 27.50065,13.056091 27.499565,13.03768 27.5,13.03125 C 27.500218,13.024801 27.5,13.006469 27.5,13 C 27.5,12.993531 27.500218,10.975199 27.5,10.96875 C 27.499565,10.96232 27.50065,10.943909 27.5,10.9375 C 27.495677,10.905557 27.478328,10.843887 27.46875,10.8125 C 27.466628,10.806246 27.471077,10.78748 27.46875,10.78125 C 27.466219,10.775045 27.440233,10.75618 27.4375,10.75 C 27.431632,10.737692 27.412914,10.699702 27.40625,10.6875 C 27.014517,10.013296 25.41475,9.5 23.5,9.5 C 23.3275,9.5 23.166766,9.4920429 23,9.5 z "
|
||||||
|
id="path3198"
|
||||||
|
sodipodi:nodetypes="cssssssssssssssssssssssssssssc" />
|
||||||
|
<path
|
||||||
|
sodipodi:type="arc"
|
||||||
|
style="color:#000000;fill:url(#radialGradient3347);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
id="path3225"
|
||||||
|
sodipodi:cx="21.5"
|
||||||
|
sodipodi:cy="11"
|
||||||
|
sodipodi:rx="4"
|
||||||
|
sodipodi:ry="1.5"
|
||||||
|
d="M 25.5 11 A 4 1.5 0 1 1 17.5,11 A 4 1.5 0 1 1 25.5 11 z"
|
||||||
|
transform="matrix(0.867417,0,0,0.666667,4.820203,3.666665)" />
|
||||||
|
<path
|
||||||
|
style="color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3380);stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||||
|
d="M 23,9.5 C 21.315666,9.5803665 19.950192,10.074035 19.59375,10.6875 C 19.587086,10.699702 19.568368,10.737692 19.5625,10.75 C 19.559767,10.75618 19.533781,10.775045 19.53125,10.78125 C 19.528923,10.78748 19.533372,10.806246 19.53125,10.8125 C 19.521672,10.843887 19.504323,10.905557 19.5,10.9375 C 19.49935,10.943909 19.500435,10.96232 19.5,10.96875 C 19.499782,10.975199 19.5,12.993531 19.5,13 C 19.5,13.006469 19.499782,13.024801 19.5,13.03125 C 19.500435,13.03768 19.49935,13.056091 19.5,13.0625 C 19.504323,13.094443 19.521672,13.156113 19.53125,13.1875 C 19.533372,13.193754 19.528923,13.21252 19.53125,13.21875 C 19.533781,13.224955 19.559767,13.24382 19.5625,13.25 C 19.568368,13.262308 19.587086,13.300298 19.59375,13.3125 C 19.985483,13.986704 21.58525,14.5 23.5,14.5 C 25.41475,14.5 27.014517,13.986704 27.40625,13.3125 C 27.412914,13.300298 27.431632,13.262308 27.4375,13.25 C 27.440233,13.24382 27.466219,13.224955 27.46875,13.21875 C 27.471077,13.21252 27.466628,13.193754 27.46875,13.1875 C 27.478328,13.156113 27.495677,13.094443 27.5,13.0625 C 27.50065,13.056091 27.499565,13.03768 27.5,13.03125 C 27.500218,13.024801 27.5,13.006469 27.5,13 C 27.5,12.993531 27.500218,10.975199 27.5,10.96875 C 27.499565,10.96232 27.50065,10.943909 27.5,10.9375 C 27.495677,10.905557 27.478328,10.843887 27.46875,10.8125 C 27.466628,10.806246 27.471077,10.78748 27.46875,10.78125 C 27.466219,10.775045 27.440233,10.75618 27.4375,10.75 C 27.431632,10.737692 27.412914,10.699702 27.40625,10.6875 C 27.014517,10.013296 25.41475,9.5 23.5,9.5 C 23.3275,9.5 23.166766,9.4920429 23,9.5 z "
|
||||||
|
id="path3205"
|
||||||
|
sodipodi:nodetypes="cssssssssssssssssssssssssssssc" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 23 KiB |
19
debian/local/upsd
vendored
Executable file
19
debian/local/upsd
vendored
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Include NUT nut.conf
|
||||||
|
[ -r /etc/nut/nut.conf ] && . /etc/nut/nut.conf
|
||||||
|
|
||||||
|
case "$MODE" in
|
||||||
|
standalone|netserver)
|
||||||
|
exec /lib/nut/upsd "$@"
|
||||||
|
;;
|
||||||
|
none|netclient)
|
||||||
|
echo "upsd disabled, please adjust the configuration to your needs"
|
||||||
|
echo "Then set MODE to a suitable value in /etc/nut/nut.conf to enable it"
|
||||||
|
# exit success to avoid breaking the install process!
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
19
debian/local/upsmon
vendored
Executable file
19
debian/local/upsmon
vendored
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Include NUT nut.conf
|
||||||
|
[ -r /etc/nut/nut.conf ] && . /etc/nut/nut.conf
|
||||||
|
|
||||||
|
case "$MODE" in
|
||||||
|
standalone|netserver|netclient)
|
||||||
|
exec /lib/nut/upsmon "$@"
|
||||||
|
;;
|
||||||
|
none)
|
||||||
|
echo "upsmon disabled, please adjust the configuration to your needs"
|
||||||
|
echo "Then set MODE to a suitable value in /etc/nut/nut.conf to enable it"
|
||||||
|
# exit success to avoid breaking the install process!
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
39
debian/nut-cgi.README.Debian
vendored
Normal file
39
debian/nut-cgi.README.Debian
vendored
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
Network UPS Tools - CGI Interface - Quick Start for Debian
|
||||||
|
----------------------------------------------------------
|
||||||
|
|
||||||
|
(I) Installation
|
||||||
|
=================
|
||||||
|
|
||||||
|
1) Sample configuration files are provided in /etc/nut/
|
||||||
|
Rename without the ".sample" suffix the files hosts.conf, upsstats.html,
|
||||||
|
upsstats-single.html and optionally upsset.conf.
|
||||||
|
Then edit these to match your configuration.
|
||||||
|
|
||||||
|
2) Ensure these configuration files are readable by others
|
||||||
|
|
||||||
|
chmod 755 /etc/nut
|
||||||
|
chmod 644 /etc/nut/upsset.conf
|
||||||
|
chmod 644 /etc/nut/hosts.conf
|
||||||
|
chmod 644 /etc/nut/upsstats.html
|
||||||
|
chmod 644 /etc/nut/upsstats-single.html
|
||||||
|
|
||||||
|
3) You will then be able to access NUT CGI through a Web browser.
|
||||||
|
The URL, which depends on your httpd configuration, is:
|
||||||
|
|
||||||
|
http://localhost/cgi-bin/nut/upsstats.cgi
|
||||||
|
|
||||||
|
4) NUT also provides a set of HTML files to wrap the CGIs.
|
||||||
|
To use it, create a new virtual host with your preferred webserver, and point the
|
||||||
|
Document Root to: /usr/share/nut/www/
|
||||||
|
|
||||||
|
You can also add an alias to an existing site, if it is supported:
|
||||||
|
Alias /nut/ "/usr/share/nut/www/"
|
||||||
|
|
||||||
|
Also ensure that the files in this directory have the suitable permissions.
|
||||||
|
|
||||||
|
For more information on nut-cgi configuration, have a look at the following
|
||||||
|
manual pages:
|
||||||
|
- upsstats.html (5)
|
||||||
|
- hosts.conf (5)
|
||||||
|
- upsset.conf (5)
|
||||||
|
|
1
debian/nut-cgi.docs
vendored
Normal file
1
debian/nut-cgi.docs
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
data/html/README
|
6
debian/nut-cgi.install
vendored
Normal file
6
debian/nut-cgi.install
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
debian/tmp/etc/nut/hosts.conf
|
||||||
|
debian/tmp/etc/nut/upsset.conf
|
||||||
|
debian/tmp/etc/nut/upsstats-single.html
|
||||||
|
debian/tmp/etc/nut/upsstats.html
|
||||||
|
debian/tmp/usr/lib/cgi-bin/
|
||||||
|
debian/tmp/usr/share/nut/www
|
47
debian/nut-cgi.postinst
vendored
Normal file
47
debian/nut-cgi.postinst
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
configure)
|
||||||
|
|
||||||
|
# make sure the nut user exists and has correct memberships
|
||||||
|
if ! getent group nut >/dev/null; then
|
||||||
|
addgroup --quiet --system nut
|
||||||
|
fi
|
||||||
|
if ! getent passwd nut >/dev/null; then
|
||||||
|
adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut
|
||||||
|
elif ! groups nut | grep -qw nut; then
|
||||||
|
adduser nut nut
|
||||||
|
fi
|
||||||
|
# for Ubuntu, while waiting for a proper debconf
|
||||||
|
# if ! groups nut | grep -qw dialout; then
|
||||||
|
# adduser nut dialout
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# Ensure /etc/nut is readable/crossable for others
|
||||||
|
if [ -d /etc/nut/ ] ; then
|
||||||
|
chmod 755 /etc/nut
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure nut-cgi configuration files are readable by others
|
||||||
|
for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do
|
||||||
|
if [ -f /etc/nut/$file ] ; then
|
||||||
|
chmod 644 /etc/nut/$file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
# do nothing
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "$0: incorrect arguments: $*" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
180
debian/nut-client.init
vendored
Executable file
180
debian/nut-client.init
vendored
Executable file
|
@ -0,0 +1,180 @@
|
||||||
|
#! /bin/sh
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: nut-client upsmon ups-monitor
|
||||||
|
# Required-Start: $local_fs $syslog $network $remote_fs
|
||||||
|
# Required-Stop: $local_fs $syslog $network $remote_fs
|
||||||
|
# Should-Start: nut-server
|
||||||
|
# Should-Stop:
|
||||||
|
# Default-Start: 2 3 4 5
|
||||||
|
# Default-Stop: 0 1 6
|
||||||
|
# Short-Description: Network UPS Tools monitor initscript
|
||||||
|
# Description: This script take care of starting and stopping the
|
||||||
|
# Network UPS Tools monitoring component (upsmon).
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
# Author: Arnaud Quette <aquette@debian.org>
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
|
||||||
|
|
||||||
|
NAME=nut-client
|
||||||
|
DESC="NUT - power device monitor and shutdown controller"
|
||||||
|
CONFIG=/etc/nut/nut.conf
|
||||||
|
pid_dir=/run/nut
|
||||||
|
upsmon_pid=${pid_dir}/upsmon.pid
|
||||||
|
upsmon=/sbin/upsmon
|
||||||
|
log=">/dev/null 2>/dev/null"
|
||||||
|
|
||||||
|
# Define LSB log_* functions.
|
||||||
|
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||||
|
. /lib/lsb/init-functions
|
||||||
|
|
||||||
|
# set upsmon specific options. use "man upsmon" for more info
|
||||||
|
# this parameter is now located in nut.conf, and not in /etc/default/nut anymore
|
||||||
|
# FIXME: retrieved from 'nut' script during update
|
||||||
|
UPSMON_OPTIONS=""
|
||||||
|
|
||||||
|
# Exit if the package is not installed
|
||||||
|
[ -x "$upsmon" ] || exit 0
|
||||||
|
|
||||||
|
# Include NUT nut.conf
|
||||||
|
[ -r $CONFIG ] && . $CONFIG
|
||||||
|
|
||||||
|
# FIXME: put all common bits, between nut-client and nut-server,
|
||||||
|
# into a common nut-function
|
||||||
|
|
||||||
|
# Explicitly require the configuration to be done in /etc/nut/nut.conf
|
||||||
|
if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then
|
||||||
|
log_action_msg "$NAME disabled, please adjust the configuration to your needs"
|
||||||
|
log_action_msg "Then set MODE to a suitable value in $CONFIG to enable it"
|
||||||
|
# exit success to avoid breaking the install process!
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if /run/nut exists and has the correct perms
|
||||||
|
check_var_directory() {
|
||||||
|
[ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \
|
||||||
|
&& chown root:nut ${pid_dir} \
|
||||||
|
&& chmod 770 ${pid_dir} \
|
||||||
|
&& [ -x /sbin/restorecon ] && /sbin/restorecon ${pid_dir}
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the right components are running
|
||||||
|
check_status() {
|
||||||
|
case "$MODE" in
|
||||||
|
standalone|netserver|netclient)
|
||||||
|
status_of_proc -p $upsmon_pid $upsmon upsmon
|
||||||
|
;;
|
||||||
|
none|*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
start_stop_client () {
|
||||||
|
case "$MODE" in
|
||||||
|
standalone|netserver|netclient)
|
||||||
|
# FIXME: for standalone|netserver, ensure 'nut-server status' returns ?
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start-stop-daemon -S -q -p $upsmon_pid -x $upsmon \
|
||||||
|
-- $UPSMON_OPTIONS >/dev/null 2>&1 && return 0 || return 1
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 \
|
||||||
|
&& return 0 || return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
none|*)
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
|
||||||
|
start)
|
||||||
|
log_daemon_msg "Starting $DESC" "$NAME"
|
||||||
|
check_var_directory
|
||||||
|
start_stop_client start
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||||
|
start_stop_client stop
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
reload)
|
||||||
|
log_daemon_msg "Reloading $DESC" "$NAME"
|
||||||
|
$upsmon -c reload >/dev/null 2>&1
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
restart|force-reload)
|
||||||
|
# FIXME: lack consistency, due to initscript split.
|
||||||
|
# This only addresses partial reload.
|
||||||
|
# Full reload requires to:
|
||||||
|
# - stop nut-client
|
||||||
|
# - restart (Ie stop+start) nut-server
|
||||||
|
# - start nut-client
|
||||||
|
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||||
|
start_stop_client stop || true
|
||||||
|
# should then 'start_stop_server stop', Ie /etc/init.d/nut-server stop
|
||||||
|
#sleep 5
|
||||||
|
check_var_directory
|
||||||
|
# should first 'start_stop_server start', Ie /etc/init.d/nut-server start
|
||||||
|
start_stop_client start
|
||||||
|
log_end_msg $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
#log_daemon_msg "Checking status of $DESC"
|
||||||
|
echo "Checking status of $DESC"
|
||||||
|
check_status
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
|
||||||
|
poweroff)
|
||||||
|
case "$MODE" in
|
||||||
|
standalone|netserver)
|
||||||
|
# Sanity check
|
||||||
|
flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf`
|
||||||
|
if [ -z "$flag" ] ; then
|
||||||
|
log_action_msg "##########################################################"
|
||||||
|
log_action_msg "## POWERDOWNFLAG is not defined in /etc/nut/upsmon.conf ##"
|
||||||
|
log_action_msg "## ##"
|
||||||
|
log_action_msg "## Please read the Manual page upsmon.conf(5) ##"
|
||||||
|
log_action_msg "##########################################################"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Defer to nut-server to actually poweroff the UPS, if needed
|
||||||
|
# (the need is tested here though!)
|
||||||
|
if $upsmon -K >/dev/null 2>&1 ; then
|
||||||
|
log_daemon_msg "UPS poweroff required..."
|
||||||
|
log_end_msg 0
|
||||||
|
if [ -x /etc/init.d/nut-server ] ; then
|
||||||
|
exec /etc/init.d/nut-server poweroff
|
||||||
|
else
|
||||||
|
log_action_msg "Failure: /etc/init.d/nut-server script missing"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log_action_msg "Power down flag is not set (UPS poweroff not needed)"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
none|netclient|*)
|
||||||
|
# nothing to do
|
||||||
|
log_action_msg "'$MODE' configuration does not require UPS poweroff"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
N=/etc/init.d/$NAME
|
||||||
|
echo "Usage: $N {start|stop|reload|restart|force-reload|status|poweroff}" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
25
debian/nut-client.install
vendored
Normal file
25
debian/nut-client.install
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
debian/tmp/bin/upsc
|
||||||
|
debian/tmp/bin/upscmd
|
||||||
|
debian/tmp/bin/upslog
|
||||||
|
debian/tmp/bin/upsrw
|
||||||
|
debian/tmp/bin/upssched-cmd
|
||||||
|
debian/tmp/etc/nut/nut.conf
|
||||||
|
debian/tmp/etc/nut/upsmon.conf
|
||||||
|
debian/tmp/etc/nut/upssched.conf
|
||||||
|
debian/tmp/lib/nut/upsmon
|
||||||
|
debian/tmp/lib/systemd/system/nut-client.service
|
||||||
|
debian/tmp/lib/systemd/system/nut-monitor.service
|
||||||
|
debian/tmp/lib/systemd/system/ups-monitor.service
|
||||||
|
debian/tmp/sbin/upsmon
|
||||||
|
debian/tmp/sbin/upssched
|
||||||
|
debian/tmp/usr/share/apport/package-hooks/source_nut-client.py
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nuthostsconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutnutconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutupsconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutupsdconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutupsdusers.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutupsmonconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutupsschedconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/nutupssetconf.aug
|
||||||
|
debian/tmp/usr/share/augeas/lenses/tests/test_nut.aug
|
||||||
|
debian/tmp/usr/share/bash-completion/completions/nut
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue