-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Driver.List after discrimination #4
base: issue-441+legrand
Are you sure you want to change the base?
Conversation
Solution: detect presence and usability of pkg-config program and autotools macros (they end up as unexpanded tokens if pkg-config is not installed), and use this knowledge to proceed with search for libcppunit - or not. When the test is optional, we should not kill the build if we can not make it due to missing tools.
…tions (networkupstools#541) * Revert "Problem: nutscan_init() called before debug is enabled" This reverts commit f613d45. When parsing the command line (or showing help), many options rely on a nutscan_avail_* var already initialized by nutscan_init() -- moving that call after the parsing of opts renders those options unavailable. * nutscanner: parse debug level opts separately before anything else In order to have early the value of the desired debug level (needed to correctly debug nutscan_init()), split the parsing of command line options into two loops: - the first one, before the call to nutscan_init(), will only care about debug level, - the second one, after the call to nutscan_init(), will consider the remaining (and possibly depending on a nutscan_avail_* var already initialized by nutscan_init()) arguments (and moan in case of errors). Closes networkupstools#500
Problem: configure fails on system without pkg-config
* gen-snmp-subdriver.sh : replace multiline "echo" with questional tabbing by a single-string "printf" * docs/man/Makefile.am : fix merge error that broke manpage packaging
…or drivers in new Solaris-like systems (and bring AIX initscript into better shape) (networkupstools#330) * Use target for drivers in systemd This allows much better granularity and better monitoring in case of multiple UPSes. * nut-driver.target improvements suggested by @peterhoeg in PR#229 * systemd units dependencies revised and commented * nut-driver-enumerator.sh initial commit * [email protected] : integrate comments from @peterhoeg about extending unit requirements * WIP : initial integration of nut-driver-enumerator.sh/service into makefiles etc. * nut-driver-enumerator.sh renamed into nut-driver-enumerator.sh.in as it has processable templates in code * nut-driver-enumerator.sh.in : add its own config-file support to set the variables used inside (if not via command-line env) * nut-driver-enumerator.sh.in : fix up the copyright header * Subject: Fix systemd service file for Debian From: Laurent Bigonville <[email protected]> Forwarded: not-needed * nut-driver-enumerator.sh.in : complete the Solaris SMF support in the helper script * EXTRA_DIST the scripts/systemd/nut-driver.target (non-templated) file * nut-driver-enumerator.sh.in : updated comments (esp. about usage and exit-codes) and runtime messages * nut-driver-enumerator.service.in : define an actual service payload * nut-driver-enumerator.sh.in : refactor the logic of MAIN PROGRAM into smaller routines for readability * nut-driver-enumerator.sh.in : introduce routines to help define custom dependencies of particular drivers on other services * nut-driver-enumerator.sh.in : allow custom NUT_CONF_DIR from envvar, to facilitate testing * nut-server.service.in : typo fix in comments * nut-driver-enumerator.sh.in : support the concept of localhost networking dependencies, and define vars with lists of services to depend on * nut-driver-enumerator.sh.in : use proper FMRI:instance separator for SMF * nut-driver-enumerator.sh.in : added variables for dependency type on third-party service units * nut-driver-enumerator.sh.in : change upsconf_getDriverMedia() output from tab-separated to multiline; add upsconf_getMedia() and upsconf_debug() and upslist_debug() * nut-driver-enumerator.sh.in : refactor with upsconf_getValue() and cached pre-cooked ups.conf data; infrastructure to configure service dependencies when adding the service instance * Remove hardcoded dependencies on udev and network from provided systemd units; add comments about extending via drop-in files and that nut-driver-enumerator will do this for nut-drivers * nutshutdown.in : mark executable * nut-driver-enumerator.sh.in : complete the systemd drop-in support for custom dependencies for a driver * nut-driver-enumerator.sh.in : complete the SMF drop-in support for custom dependencies for a driver * nut-driver-enumerator.sh.in : comment-away upslist_debug() in default runs * WIP Adding Solaris SMF manifests for NUT * Sanitize Solaris SVR4 packaging rules * Sanitize Solaris packaging scripts some more * Add configure options for Solaris packaging variants * Sanitize Solaris packaging scripts some more - consider DESTDIR for installation root * Turn solaris preproto.pl into a template so it uses proper (configured) user/group strings * Makefile.am : ensure there is a DESTDIR set before packaging * Makefile.am : use $(MAKE) $(AM_MAKEFLAGS) instead of explicit "make" (mostly in packaging recipe) * makelocal.sh : commented and revised * Solaris/Makefile.am : put generated SVR4 package into builddir (not srcdir that may be readonly) to match other OS recipes * Makefile.am : ensure the DESTDIR is used for packaging purposes (when calling sub-makes) * Solaris/pkginfo.in : ARCH is CPU_TYPE, not OS_NAME * GitIgnore built Solaris/NUT*.local.gz product * GitIgnore built systemd files * GitIgnore _install_pkgprotodir * Makefile.am : ensure only the custom DESTDIR is used for packaging purposes * Makefile.am : convert the big packaging "if" into "case"; link steps with "&&"; retain DESTDIR if Solaris packaging fails; ensure the correct custom DESTDIR is absent before packaging (and after Solaris packaging) * Solaris/Makefile.am : Revise recipe-names and comments for Solaris packaging variants * Solaris/Makefile.am and *.xml.in : relocate SMF methods and manifests under NUT DATADIR to package compactly * Solaris-SMF : svc-nut.in svc-nut-client.in : use @RUN_AS_*@ and @PIDPATH@ vars instead of hardcoding * Solaris/Makefile.am : list helper scripts and installation scripts and data in variables and depend on them in packaging; chmod +x the scripts after copying over to proto area * GitIgnore config.cache * Remove Solaris/prepackage.py (unreferenced duplicate of precheck.py) * Solaris/nut.in : sanitize the default init-script * Solaris/Makefile.am : put init-scripts under NUT share (DATADIR) to package it compactly; copy to OS dirs in postinstall * Makefile.am .gitignore etc. relocate successfully built package files to abs_top_builddir * Change Aix/nut.init to a .in template * svc-nut.in svc-nut-client.in : consider nut.conf if available * Solaris/Makefile.am and SVR4 scripts : install augeas lenses as part of NUT package (in DATADIR at least) * configure.ac : comment about sysconfdir for NUT * Sanitize Aix/nut.init.in * More standardization of Solaris initscripts and SMF methods; use LD_LIBRARY_PATH to prefer NUT provided libs in case of conflicts (facilitate bundling with third-party packages) * Solaris/Makefile.am : add ability to "make check" something here, e.g. validate manifest XMLs * Solaris SMF XML manifests : fix "dependent" definitions, and add dependencies on required config files * configure.ac : fix a manually crafted "Checking for" into using AC_MSG routines * Solaris SVR4 packaging should now take care of SMF service registration/teardown * Solaris preremove.in postinstall.in : Usage of @datadir@ caused "${prefix}" strings to pop up - define the vars * Solaris scripts : use lower-cased @datadir@ in templates processed by configure * Solaris/preremove.in : fix FMRI pattern when removing package * Solaris/postinstall.in : fix SMF manifest dir * Solaris/postremove.in : fix verbose RM; wipe the /var/run/nut dir too * Solaris/preremove.in : fix commands when removing package * Solaris/postinstall.in : enable SMF services if configs are already available (esp. create nut-driver instances) * Solaris/preremove.in : fix commands when removing package * Solaris/postinstall.in : enable SMF services if configs are already available (esp. create nut-driver instances) - verbosity * Solaris/nut-driver-enumerator.xml.in : use a unique dependency name (avoid conflict in nut-driver instances chain of deps) * systemd and Solaris : fix up embedded ${prefix} in service files and SMF manifests after generation * systemd/README : add recent authors * Define a NUT_DATADIR and NUT_LIBEXECDIR with expanded path values to use in service manifests * Solaris : packaged service addition/removal more verbose * nut-driver-enumerator.xml.in nut-driver.xml.in : do not block startup of nut server * nut.xml.in : do not block startup of nut server due to failed nut-driver-enumerator * nut-driver-enumerator.sh.in : improve portability by using TAB char as is (not regex \t which gets misinterpreted by some tools) * nut-driver-enumerator.sh.in : comment the caveats * nut-driver-enumerator.sh.in : apcsmart is serial only * nut-driver-enumerator.sh.in : By default, update wrapping of devices into services... but keep the door open to other uses of the script * nut-driver-enumerator.sh.in : refactor a bit and add externally callable actions * Introduce upsdrvsvcctl with semantics similar to upsdrvctl, but managing stop/start of SMF or systemd unit instances * nut-driver-enumerator.sh.in : consider possible difference of device and service instance names * nut-driver-enumerator.sh.in : refactor md5 * nut-driver-enumerator.xml.in : add REFRESH action and do not die on RESTART * Mention nut-driver-enumerator and upsdrvsvcctl in (systemd/|Solaris/)README * upsdrvsvcctl.in : updated comments * upsdrvsvcctl.in : added a resync option * Rename Solaris SMF services to match systemd patterns and ease life for sysadmins * Add systemd nut.target to manage the bundle of NUT services * config-notes.txt : document the systemd and SMF support in NUT * nut.dict : update spellchecker * Solaris/Makefile.am : support copying where attrs can not be preserved * Solaris postinstall : report if services were not instantly enabled due to missing config files * upsdrvsvcctl.in : reformat prettily * nut-driver-enumerator.sh.in : wrap usage() * nut-driver-enumerator.sh.in : added --list-services-for-devices * [email protected] : comment about aligning timeouts with ups.conf maxstartdelay * nut.xml.in : Revise comments * nut-driver-enumerator.sh.in : when amending service unit instance config for systemd, update the Description to state the NUT device section name * nut-driver-enumerator.sh.in : support common NUT_CONFPATH envvar * Add upsdrvsvcctl.txt manpage and references to upsdrvsvcctl in other docs * upsdrvsvcctl.txt manpage : refer to service management system logs * upsdrvsvcctl : support "list upsname" CLI action to help troubleshooting * upsdrvsvcctl : add handling for "shutdown" command * Docs about upsdrvsvcctl - clarify that it may not be preinstalled with non-SMF/non-systemd OS packages * Pass spellcheck for upsdrvsvcctl doc updates * Solaris packaging of nut-driver-enumerator.sh : deliver into libexecdir same as in Linux * Move nut-driver-enumerator.sh.in and upsdrvsvcctl.in into scripts/upsdrvsvcctl to share on par between Linux and Solaris (for starters) * Use @NUT_LIBEXECDIR@ for nut-driver-enumerator.sh * Introduce nut-driver-enumerator.path.in for systemd * nut-driver-enumerator.service.in : be part of nut.target, not common multi-user * Systemd services : be PartOf=nut.target to propagate service stops * postinstall.in : use NUT_DATADIR * nut-monitor.xml.in : depend on nut-server (if locally running) * nut.xml.in : fix path (use pre-eval-ed version) * nut-driver-enumerator.sh.in : add a way to print out just an instance suffix name * nut-driver-enumerator.sh.in : when printing full instance name, do not add stuff if the argument is already a full name * nut-driver-enumerator.sh.in : implement --get-device-for-service * nut-driver (systemd/SMF) : use "nut-driver-enumerator.sh --get-device-for-service" for current service instance name * nut.xml.in : this service is transient * upsdrvsvcctl.in : fix parameter passing * upsdrvsvcctl.in : "clear" the SMF service state when stopping/starting, just in case it was failed * nut-driver-enumerator.sh.in : restart upsd IFF the set of known-device mappings was changed * Revise and relax some dependencies for Solaris SMF services * nut-driver-enumerator.sh.in : info messages go to stderr; reply for request only goes to stdout * nut-driver-enumerator.sh.in : complete the upslist_equals() method * nut.xml.in : never fail on stop (if component services did not stop, it is their problem) * Solaris preremove.in SMF : clear sevices before stopping them, just in case * upsdrvsvcctl.in : post-process clearing of SMF service instances if any have failed * nut.xml.in : never fail on stop (if component services did not stop, it is their problem) * Solaris preremove.in SMF : remove nut before services it depends on * main.c upsdrvctl.c : make debug messages a bit more useful * Solaris preremove.in SMF : do not block stopping NUT driver services, but follow up with upsdrv(svc)ctl stop of everything * Solaris preremove.in SMF : sleep after stopping drivers before removing their services * Solaris preremove.in SMF : force-remove services of drivers * nut-driver.xml.in : rename a dependency to avoid conflicts * Solaris nut.xml.in : add a refresh action handler * Solaris postinstall.in SMF : first use nut-driver-enumerator.sh.in to just register the mappings, no autostarts * Solaris preremove.in SMF : stop drivers with common method (and use NUT_SBINDIR) before going one by one * Solaris postinstall.in SMF : start the drivers via upsdrvsvcctl after registering (so the mapping is stable) * Solaris postinstall.in preremove.in : NUT_SBINDIR => SBINDIR * Add manpage for nut-driver-enumerator[8] * Handle EXTRA_DIST of scripts/upsdrvsvcctl/ with their own Makefile * nut-driver-enumerator.txt : change to be more like other page sources * Spellcheck nut-driver-enumerator.txt * Add scripts/upsdrvsvcctl/README * Update gitignores * List new manpages upsdrvsvcctl nut-driver-enumerator in index * Add upsdrvsvcctl do scripts/Makefile.am SUBDIRS * upsdrvsvcctl.in nut-driver-enumerator.sh.in : Add a way to show configs per device * nut-driver-enumerator.sh.in : fix upsconf_getValue() to return success if key was found, or report an error if not * nut-driver-enumerator.sh.in : expose upsconf_getValue() as --show-device-config-value * nut-driver-enumerator.sh.in : NOTE on top about the choice of simplified shell * nut-driver-enumerator.sh.in : in upsconf_getSection() stop after printing out the section contents * nut-driver-enumerator.sh.in : refactor upsconf_getValue() to use upsconf_getSection() * nut-driver-enumerator.sh.in : update comment in header * nut-driver-enumerator.service.in : do not fail the systemd unit, it cannot restart * Fix references for configure.in to point to configure.ac nowadays * nut-driver-enumerator.sh.in : use fully-pathed SMF svccfg in all parts of code consistently * nut-driver-enumerator.sh.in : comment about not-detecting reconfigurations of existing sections currently
Since nutdrv_qx is both a serial and a USB driver, up until now, its executable and manpages appeared in two lists: serial and USB drivers, in order to be built in both cases, when ./configure'd for only one of them... but, by doing this, when ./configure'd for both, we ended up with dupes, which could potentially cause problems, e.g. when installing them (and this just happened). For the executable, luckily, libtool calls install one file at a time, so this was not, and it still should not be, a problem. For the manpages, we were previously saved by automake, which splits the list of files to be installed in different calls if they are too many (see automake's am__install_max var, currently set to 40), so the two nutdrv_qx entries ended up in different calls to install, but the 8b75b03 commit, by adding more manpages before nutdrv_qx's ones, pushed also the first occurrence to the second call to install, which already contained the other one, causing an error. While other alternative, more flexible, but also less portable, ways for solving this exist (e.g. using GNU make's $(sort) on the generated lists), at least for now, prefer a more portable solution, adding new intermediate lists for serial/USB drivers and using simple automake conditionals. Close networkupstools#594
The PKG_*() macros we use there already print messages, therefore we can't use AC_MSG_CHECKING() before calling them, and AC_MSG_RESULT() after, or we will get something like: checking for autoconf macro support of pkg-config... checking for pkg-config... /usr/bin/pkg-config ^^^ AC_MSG_CHECKING() ^^^ PKG_*() macro output checking pkg-config is at least version 0.9.0... yes ^^^ PKG_*() macro output -- continuation ok ^^^ AC_MSG_RESULT() checking for autoconf macro support of pkg-config module checker... checking for dummy_PKG_CONFIG... yes ^^^ AC_MSG_CHECKING() ^^^ PKG_*() macro output ok ^^^ AC_MSG_RESULT() ...which is not exactly desirable. So, move the messages to AC_MSG_NOTICE(), with the result being explicitly printed only on failure (AC_MSG_WARN() call).
Due to the request to keep also older Metasystem UPSs, we decided to modify a bit the Driver List (some models such as Megaline Series are Legrand and also Metasystem branded). we will keep the same driver for the 2 brands because we added in metasys.c a discrimination variable about battery SOC Data (The only command that was not available in older units).
I cherry-picked 2350f40 from #3 and fb0d431 from this one, amended them to fix a couple of things, and applied them to the Now, a few questions about the supported devices:
|
Readded Keor SPX and Multiplug. Sorry but i'm not so "Skilled" on GitHub, i made mistake with the files. Regarding your questions: - DHEA is only MetaSystem? Yes - WHAD is only Legrand? Yes - Megaline 6250, Megaline 7500, Megaline 8750, Megaline 10000 are only Meta System, right? Yes - Megaline 5000 /2, Megaline 6250 /2, Megaline 7500 /2, Megaline 8750 /2, Megaline 10000 /2 are only Legrand, right? Yes
ok, thanks. |
Dear Daniele,
now that all the files are ok (i think) what do we have to do? do you know when it will be added to NUT?
Thanks in advance!
Best Regards,
Gabriele Taormina
UPS Strategic Business Unit
Field Application Engineer
Phone: +39 0522/207046
Fax: +39 0522/207005
Address: Via Rodano 1 - Reggio Emilia - 42124 - Italy
Email: [email protected]<mailto:[email protected]>
<mailto:[email protected]>Website: www.ups.legrand.com<http://www.ups.legrand.com/>
Website: www.legrand.com<http://www.legrand.com/>
[1506322600142_legrand-vector-logo.png]
…________________________________
Da: Daniele Pezzini <[email protected]>
Inviato: giovedì 6 settembre 2018 02:22
A: zykh/nut
Cc: Gabriele TAORMINA; Author
Oggetto: Re: [zykh/nut] Updated Driver.List after discrimination (#4)
ok, thanks.
Here's the updated branch: https://github.com/zykh/nut/tree/issue-441+legrand_updated
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#4 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Any3Fya2Jop0G20xP2sQNgtL2pSWPbA2ks5uYGq2gaJpZM4WZMKx>.
________________________________
Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.
This e-mail, and any document attached hereby, may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
|
If possible:
Likely in 2.7.5, see also networkupstools#616. |
Dear Daniele,
Regarding the points:
1- i will send you As soon as possible the required doc (in a few days i think)
2- is it possible to pospone the DDL creation after the update of NUT to 2.7.5?
Thanks in advance!
Best Regards,
Gabriele Taormina
UPS Strategic Business Unit
Field Application Engineer
Phone: +39 0522/207046
Fax: +39 0522/207005
Address: Via Rodano 1 - Reggio Emilia - 42124 - Italy
Email: [email protected]<mailto:[email protected]>
<mailto:[email protected]>Website: www.ups.legrand.com<http://www.ups.legrand.com/>
Website: www.legrand.com<http://www.legrand.com/>
[1506322600142_legrand-vector-logo.png]
…________________________________
Da: Daniele Pezzini <[email protected]>
Inviato: martedì 11 settembre 2018 01:24:46
A: zykh/nut
Cc: Gabriele TAORMINA; Author
Oggetto: Re: [zykh/nut] Updated Driver.List after discrimination (#4)
now that all the files are ok (i think) what do we have to do?
If possible:
1. give us the protocol used in the Meta System devices with an 'id code' < 11,
2. give us upsc, upsrw and upscmd 'dumps' of the various supported devices for our DDL: https://networkupstools.org/ddl/
do you know when it will be added to NUT?
Likely in 2.7.5, see also #616<networkupstools#616>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#4 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Any3F9pSmn2fsYoTEr0smdE8BS9jaFQeks5uZvS-gaJpZM4WZMKx>.
________________________________
Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.
This e-mail, and any document attached hereby, may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
|
Awaiting with anticipation...
Sure. |
Dear Daniele,
as promised here's the Protocol for UPSs with an ID < 11.
Let me know if it's all ok now!
Best Regards,
Gabriele Taormina
UPS Strategic Business Unit
Field Application Engineer
Phone: +39 0522/207046
Fax: +39 0522/207005
Address: Via Rodano 1 - Reggio Emilia - 42124 - Italy
Email: [email protected]<mailto:[email protected]>
<mailto:[email protected]>Website: www.ups.legrand.com<http://www.ups.legrand.com/>
Website: www.legrand.com<http://www.legrand.com/>
[1506322600142_legrand-vector-logo.png]
…________________________________
Da: Daniele Pezzini <[email protected]>
Inviato: giovedì 13 settembre 2018 02:07
A: zykh/nut
Cc: Gabriele TAORMINA; Author
Oggetto: Re: [zykh/nut] Updated Driver.List after discrimination (#4)
1- i will send you As soon as possible the required doc (in a few days i think)
Awaiting with anticipation...
2- is it possible to pospone the DDL creation after the update of NUT to 2.7.5?
Sure.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#4 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Any3F_kln8GIzk8FVY0tI6aZ1DfqVpZ8ks5uaaHLgaJpZM4WZMKx>.
________________________________
Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir des informations sensibles et/ ou confidentielles ne devant pas être divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous recevez ce message par erreur), nous vous remercions de le notifier immédiatement à son expéditeur, et de détruire ce message. Toute copie, divulgation, modification, utilisation ou diffusion, non autorisée, directe ou indirecte, de tout ou partie de ce message, est strictement interdite.
This e-mail, and any document attached hereby, may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution or other use of the material or parts thereof is strictly forbidden.
|
aehm.. I did not get the attachment, as GitHub doesn't relay the files attached to mailed answers to its notifications. |
This is the updated version of the protocol mentioned in metasys manpage ("Meta System UPS Protocol Rev.1.12"), later updated again in the form of the "Legrand UPS protocol v1.21" (570c1e5). Reference: - zykh/nut#4 (comment)
File descriptors are leaking to processes spawned by upsmod and upssched, leading to SELinux errors when (for example) sendmail attempts to read from fd #4.
Did anyone ever follow up with this? I'd like to know if the Legrand |
Due to the request to keep also older Metasystem UPSs, we decided to modify a bit the Driver List (some models such as Megaline Series are Legrand and also Metasystem branded). we will keep the same driver for the 2 brands because we added in metasys.c a discrimination variable about battery SOC Data (The only command that was not available in older units).