diff --git a/NEWS.adoc b/NEWS.adoc index e25bcbb8c8..cf6e2feee8 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -72,6 +72,10 @@ https://github.com/networkupstools/nut/milestone/9 (which is something NUT code tried to do since the beginning of time), and could lead to "segmentation fault" crashes on some platforms. [issue #2948, PR #2963] + * Documentation build recipes overly zealously pre-processed source files, + which was not applicable for each and every document type we have (e.g. + binary images for illustrations); this caused grief with some toolkits. + [issue #2989] - common code: * Revised common `writepid()` to use `altpidpath()` as location for the diff --git a/clients/upsmon.c b/clients/upsmon.c index 9c45dffba8..791617d8fe 100644 --- a/clients/upsmon.c +++ b/clients/upsmon.c @@ -3824,7 +3824,10 @@ int main(int argc, char *argv[]) exit(check_pdflag()); if (shutdowncmd == NULL) - printf("Warning: no shutdown command defined!\n"); + printf("Warning: no shutdown command defined%s\n", + (minsupplies < 1) + ? ", but that is OK for a monitoring-only client." + : "!"); /* we may need to get rid of a flag from a previous shutdown */ if (powerdownflag != NULL) diff --git a/conf/upsmon.conf.sample.in b/conf/upsmon.conf.sample.in index 04cd464ead..8a8383e876 100644 --- a/conf/upsmon.conf.sample.in +++ b/conf/upsmon.conf.sample.in @@ -9,6 +9,9 @@ # MINSUPPLIES (may be 0 if this system is only monitoring other NUT servers), # and a POWERDOWNFLAG if this machine is a "primary" system connected to # the UPS and drives its late-shutdown power-off command in an emergency. +# You should also define a SHUTDOWNCMD (like the example below, or something +# special for your deployment) if MINSUPPLIES is at least 1 and you MONITOR +# an UPS. A NOTIFYCMD integrating with `upssched` is a common situation too. # -------------------------------------------------------------------------- # RUN_AS_USER @@ -158,9 +161,11 @@ MINSUPPLIES 1 # 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. # -# For Windows setup use something like: +# For Windows setup you should escape backslashes (or use forward slashes in +# recent OS releases). To shut down, use something like: # SHUTDOWNCMD "C:\\WINDOWS\\system32\\shutdown.exe -s -t 0" -# If you have command line using space character you have to add double quote to them, like this: +# If you have a command line using space characters, you have to add double +# quote to them, like this: # SHUTDOWNCMD "\"C:\\Program Files\\some command.bat\" -first_arg -second_arg" # Or use the old DOS 8.3 file name, like this: # SHUTDOWNCMD "C:\\PROGRA~1\\SOMECO~1.bat -first_arg -second_arg" diff --git a/docs/Makefile.am b/docs/Makefile.am index 0afa01aa5d..66f68e758d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -913,7 +913,7 @@ $(SPELLCHECK_BUILDDIR)/$(SPELLCHECK_SRC_ONE)-spellchecked: $(SPELLCHECK_SRCDIR)/ SPELLCHECK_AUTO_ONE = ( \ SPELLCHECK_SRC_ONE="`basename '$?'`" ; \ rm -f "$@".failed ; \ - $(MAKE) $(AM_MAKEFLAGS) -k -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${SPELLCHECK_SRC_ONE}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${SPELLCHECK_SRC_ONE}-spellchecked" \ + $(MAKE) $(AM_MAKEFLAGS) -k -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${SPELLCHECK_SRC_ONE}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" VPATH="$(SPELLCHECK_SRCDIR):$(SPELLCHECK_BUILDDIR):$(VPATH)" "$(SPELLCHECK_BUILDDIR)/$${SPELLCHECK_SRC_ONE}-spellchecked" \ || { RES=$$? ; touch "$@".failed; exit $$RES; } \ ) @@ -947,7 +947,7 @@ spellcheck: if test "$(SPELLCHECK_ENV_DEBUG)" != no ; then \ echo "ASPELL MAKEFILE DEBUG: Will see from `pwd` if '$(SPELLCHECK_SRCDIR)/$${docsrc}-spellchecked' is up to date" >&2; \ else true ; fi ; \ - $(MAKE) $(AM_MAKEFLAGS) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ + $(MAKE) $(AM_MAKEFLAGS) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" VPATH="$(SPELLCHECK_SRCDIR):$(SPELLCHECK_BUILDDIR):$(VPATH)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ || FAILED="$$FAILED $(SPELLCHECK_SRCDIR)/$$docsrc"; \ done ; \ else \ @@ -957,12 +957,12 @@ spellcheck: echo "ASPELL MAKEFILE DEBUG: from `pwd`: SPELLCHECK_NOEXT_DOCS='$${SPELLCHECK_NOEXT_DOCS}' SPELLCHECK_AUTO_TGT='$${SPELLCHECK_AUTO_TGT}'" ; \ else true ; fi ; \ if [ x"$${SPELLCHECK_AUTO_TGT}" != x ] ; then \ - $(MAKE) $(AM_MAKEFLAGS) -k -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" $${SPELLCHECK_AUTO_TGT} ; \ + $(MAKE) $(AM_MAKEFLAGS) -k -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" VPATH="$(SPELLCHECK_SRCDIR):$(SPELLCHECK_BUILDDIR):$(VPATH)" $${SPELLCHECK_AUTO_TGT} ; \ FAILED="`for docsrc in $(SPELLCHECK_SRC); do if [ -e "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked-auto.failed" ] ; then printf '%s ' "$(SPELLCHECK_SRCDIR)/$${docsrc}" ; rm -f "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked-auto.failed" ; fi ; done`" ; \ fi ; \ if [ x"$${SPELLCHECK_NOEXT_DOCS}" != x ] ; then \ for docsrc in $${SPELLCHECK_NOEXT_DOCS} ; do \ - $(MAKE) $(AM_MAKEFLAGS) -k -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ + $(MAKE) $(AM_MAKEFLAGS) -k -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" VPATH="$(SPELLCHECK_SRCDIR):$(SPELLCHECK_BUILDDIR):$(VPATH)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ || FAILED="$$FAILED $(SPELLCHECK_SRCDIR)/$$docsrc"; \ done ; \ fi ; \ @@ -1027,7 +1027,7 @@ spellcheck-interactive: if test "$(SPELLCHECK_ENV_DEBUG)" != no ; then \ echo "ASPELL (INTERACTIVE) MAKEFILE DEBUG: Will see from `pwd` if '$(SPELLCHECK_SRCDIR)/$${docsrc}-spellchecked' is up to date" >&2; \ else true ; fi ; \ - $(MAKE) $(AM_MAKEFLAGS) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_INTERACTIVE="true" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ + $(MAKE) $(AM_MAKEFLAGS) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_INTERACTIVE="true" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" VPATH="$(SPELLCHECK_SRCDIR):$(SPELLCHECK_BUILDDIR):$(VPATH)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ || FAILED="$$FAILED $(SPELLCHECK_SRCDIR)/$$docsrc"; \ done ; \ if test -n "$$FAILED" ; then \ @@ -1131,6 +1131,9 @@ $(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC) Makefile cd "$(abs_top_builddir)" ; \ fi ;; \ esac ; \ + case "$$F" in \ + *.xml|*.xsl|*.css|*.jpg|*.png|*.pdn|*.svg) ;; \ + *.txt|*.adoc|*.in|*.sample|*.conf|*) \ if $$MAN_SECTIONS_DEFAULT ; then \ sed \ -e 's,\(home page:\) https://www.networkupstools.org/*$$,\1 $(NUT_WEBSITE_BASE)/,' ; \ @@ -1142,7 +1145,8 @@ $(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC) Makefile -e 's,\(linkman:[^ []*\[\)8\],\1$(MAN_SECTION_CMD_SYS)],g' \ -e 's,\(linkman:[^ []*\[\)1\],\1$(MAN_SECTION_CMD_USR)],g' \ -e 's,\(linkman:[^ []*\[\)7\],\1$(MAN_SECTION_MISC)],g' ; \ - fi < "$${F}" > "$${F}-prepped" || exit ; \ + fi < "$${F}" > "$${F}-prepped" || exit ;; \ + esac; \ COUNT="`expr $$COUNT + 1`" ; \ done ; \ if ! test -e "$@" ; then touch "$@" ; fi ; \ @@ -1188,6 +1192,9 @@ $(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC) Makefile if $$IS_TEXT ; then \ grep -w linkman "$${linkroot}/$${F}" > /dev/null || IS_TEXT=false ; \ fi ; \ + case "$$F" in \ + *.xml|*.xsl|*.css|*.jpg|*.png|*.pdn|*.svg) ;; \ + *.txt|*.adoc|*.in|*.sample|*.conf|*) \ if $$MAN_SECTIONS_DEFAULT || ! $$IS_TEXT ; then \ sed \ -e 's,\(home page:\) https://www.networkupstools.org/*$$,\1 $(NUT_WEBSITE_BASE)/,' ; \ @@ -1200,7 +1207,8 @@ $(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC) Makefile -e 's,\(linkman:[^ []*\[\)1\],\1$(MAN_SECTION_CMD_USR)],g' \ -e 's,\(linkman:[^ []*\[\)7\],\1$(MAN_SECTION_MISC)],g' ; \ fi < "$${linkroot}/$${F}" > "$${linkroot}/$${F}-prepped" \ - || { rm -f "$@.working" ; exit 1 ; } ; \ + || { rm -f "$@.working" ; exit 1 ; } ;; \ + esac ; \ COUNT="`expr $$COUNT + 1`" ; \ done ; \ fi ; \ diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am index f8d4471128..a339b7ea0c 100644 --- a/docs/man/Makefile.am +++ b/docs/man/Makefile.am @@ -2065,6 +2065,9 @@ $(abs_top_builddir)/docs/man/.prep-src-docs: $(PREP_SRC) Makefile cd "$(abs_top_builddir)" ; \ fi ;; \ esac ; \ + case "$$F" in \ + *.xml|*.xsl|*.css|*.jpg|*.png|*.pdn|*.svg) ;; \ + *.txt|*.adoc|*.in|*.sample|*.conf|*) \ if $$MAN_SECTIONS_DEFAULT ; then \ sed \ -e 's,\(home page:\) https://www.networkupstools.org/*$$,\1 $(NUT_WEBSITE_BASE)/,' ; \ @@ -2081,7 +2084,8 @@ $(abs_top_builddir)/docs/man/.prep-src-docs: $(PREP_SRC) Makefile -e '1 s,\(^.*(\)8)$$,\1$(MAN_SECTION_CMD_SYS)),g' \ -e '1 s,\(^.*(\)1)$$,\1$(MAN_SECTION_CMD_USR)),g' \ -e '1 s,\(^.*(\)7)$$,\1$(MAN_SECTION_MISC)),g' ; \ - fi < "$${F}" > "$${F}-prepped" || exit ; \ + fi < "$${F}" > "$${F}-prepped" || exit ;; \ + esac ; \ COUNT="`expr $$COUNT + 1`" ; \ done ; \ else \ @@ -2126,6 +2130,9 @@ $(abs_top_builddir)/docs/man/.prep-src-docs: $(PREP_SRC) Makefile if $$IS_TEXT ; then \ grep -w linkman "$${linkroot}/$${F}" > /dev/null || IS_TEXT=false ; \ fi ; \ + case "$$F" in \ + *.xml|*.xsl|*.css|*.jpg|*.png|*.pdn|*.svg) ;; \ + *.txt|*.adoc|*.in|*.sample|*.conf|*) \ if $$MAN_SECTIONS_DEFAULT || ! $$IS_TEXT ; then \ sed \ -e 's,\(home page:\) https://www.networkupstools.org/*$$,\1 $(NUT_WEBSITE_BASE)/,' ; \ @@ -2143,7 +2150,8 @@ $(abs_top_builddir)/docs/man/.prep-src-docs: $(PREP_SRC) Makefile -e '1 s,\(^.*(\)1)$$,\1$(MAN_SECTION_CMD_USR)),g' \ -e '1 s,\(^.*(\)7)$$,\1$(MAN_SECTION_MISC)),g' ; \ fi < "$${linkroot}/$${F}" > "$${linkroot}/$${F}-prepped" \ - || { rm -f "$@.working" ; exit 1 ; } ; \ + || { rm -f "$@.working" ; exit 1 ; } ;; \ + esac ; \ COUNT="`expr $$COUNT + 1`" ; \ done ; \ fi ; \ diff --git a/scripts/systemd/nutshutdown.in b/scripts/systemd/nutshutdown.in index 0af98b28e9..be0b55861b 100755 --- a/scripts/systemd/nutshutdown.in +++ b/scripts/systemd/nutshutdown.in @@ -1,6 +1,7 @@ #!/bin/sh -# Network UPS Tools (NUT) systemd-shutdown integration handler. +# Network UPS Tools (NUT) systemd-shutdown integration handler for UPS power +# cycling (or power-off) and power-race avoidance. # # NOTE: This script requires both nut-server package (or more specifically, # the drivers for your device, which may be in further packages grouped @@ -8,6 +9,10 @@ # and their configuration files to be present locally and on still-mounted # filesystems (may be read-only). # +# It is typically installed as /usr/lib/systemd/system-shutdown/nutshutdown +# but other OSes and service management frameworks may also use an adapted +# variant of this script. +# # Copyright (C) 2011-2025 by NUT contributors # Michal Hlavinka, Laurent Bigonville, Arnaud Quette, Jim Klimov et al. #