diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-06-17 07:43:56 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-06-17 07:43:56 +0100 |
commit | b978efa000250668b2befa4e2cc96e0afa137611 (patch) | |
tree | 0c561efed9b15c17a9d3ef926443f35c58dfb48c /sys-power/nut/files | |
parent | fa5e8e92d94ea9de5d49a1f5ad19abf7272503d0 (diff) |
gentoo auto-resync : 17:06:2023 - 07:43:56
Diffstat (limited to 'sys-power/nut/files')
-rw-r--r-- | sys-power/nut/files/nut-2.6.5-init.d-upsmon | 2 | ||||
-rw-r--r-- | sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch | 64 | ||||
-rw-r--r-- | sys-power/nut/files/nut-2.8.0-init.d-upsd | 37 | ||||
-rw-r--r-- | sys-power/nut/files/nut.powerfail.initd | 1 | ||||
-rw-r--r-- | sys-power/nut/files/systemd_notify.path | 50 |
5 files changed, 152 insertions, 2 deletions
diff --git a/sys-power/nut/files/nut-2.6.5-init.d-upsmon b/sys-power/nut/files/nut-2.6.5-init.d-upsmon index 3aafe1676d6e..729df9c5460b 100644 --- a/sys-power/nut/files/nut-2.6.5-init.d-upsmon +++ b/sys-power/nut/files/nut-2.6.5-init.d-upsmon @@ -4,7 +4,7 @@ extra_started_commands="reload" -pidfile=/var/run/upsmon.pid +pidfile=/run/nut/upsmon.pid bin=/usr/sbin/upsmon depend() { diff --git a/sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch b/sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch new file mode 100644 index 000000000000..ff224a4774bf --- /dev/null +++ b/sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch @@ -0,0 +1,64 @@ +From c0d9ce265c6ca627039845d9544ebbdf87a00f7f Mon Sep 17 00:00:00 2001 +From: Timo Kokkonen <timo.t.kokkonen@iki.fi> +Date: Mon, 11 Jul 2022 20:41:12 +0300 +Subject: [PATCH] docs: man: upsd: Fix driver list when building only some of + drivers + +There are two issues that come up in man page generation when only +some of the drivers are built. + +First is that during configure phase DRIVER_MAN_LIST is collected by +searching any .8 files matching the driver names. This does not work +very well as during the first configure call these files don't exist +yet as none of them are compiled yet. Searching the .txt files where +they are built from works better. + +Second issue is that SRC_DRIVERS_PAGES list needs to contain the +source files where the driver list is generated from. If only some +drivers are built, this needs to be populated from the list of files +we collected to DRIVER_MAN_LIST during configure phase. + +Adding these entries will ensure manpage generation will not fail if +only some of the drivers are built + +Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi> +--- + configure.ac | 4 ++-- + docs/man/Makefile.am | 6 ++++++ + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3aa26c24e..a49ca4417 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1745,8 +1745,8 @@ if test "${WITH_MANS}" = "yes"; then + else + DRIVER_MAN_LIST="" + for i in ${DRIVER_BUILD_LIST}; do +- if test -f ${srcdir}/docs/man/$i.8; then +- DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.8" ++ if test -f ${srcdir}/docs/man/$i.txt; then ++ DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.txt" + fi + done + AC_MSG_RESULT(${DRIVER_MAN_LIST}) +diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am +index 0d693a355..a7345264b 100644 +--- a/docs/man/Makefile.am ++++ b/docs/man/Makefile.am +@@ -695,6 +695,12 @@ SRC_DRIVERS_PAGES = \ + $(SRC_MODBUS_PAGES) \ + $(SRC_LINUX_I2C_PAGES) + ++if SOME_DRIVERS ++SRC_DRIVERS_PAGES += \ ++ $(DRIVER_MAN_LIST) ++endif ++ ++ + # distribute everything, even those not installed by default + # Note that 'dist' target requires AsciiDoc! + SRC_ALL_PAGES = \ +-- +2.35.1 + diff --git a/sys-power/nut/files/nut-2.8.0-init.d-upsd b/sys-power/nut/files/nut-2.8.0-init.d-upsd new file mode 100644 index 000000000000..ce09de52d56d --- /dev/null +++ b/sys-power/nut/files/nut-2.8.0-init.d-upsd @@ -0,0 +1,37 @@ +#!/sbin/openrc-run +# Copyright 1999-2023 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +pidfile=/run/nut/upsd.pid +bin=/usr/sbin/upsd + +depend() { + use net + before upsmon + after upsdrv +} + +start() { + ebegin "Starting upsd" + # clean up first + pkill -u root,nut -x ${bin} + sleep 1 + rm -f ${pidfile} + # now start up + start-stop-daemon --start --quiet --exec ${bin} + eend $? +} + +stop() { + ebegin "Stopping upsd" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} + +reload() { + ebegin "Reloading upsd" + start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile} + eend $? +} diff --git a/sys-power/nut/files/nut.powerfail.initd b/sys-power/nut/files/nut.powerfail.initd index fd26b4f76aec..f81b258a7cdb 100644 --- a/sys-power/nut/files/nut.powerfail.initd +++ b/sys-power/nut/files/nut.powerfail.initd @@ -45,4 +45,3 @@ start() { ewarn "UPS powerfail script scheduled, and flags found, but ${UPS_CTL} missing." fi } - diff --git a/sys-power/nut/files/systemd_notify.path b/sys-power/nut/files/systemd_notify.path new file mode 100644 index 000000000000..657e0075420c --- /dev/null +++ b/sys-power/nut/files/systemd_notify.path @@ -0,0 +1,50 @@ +--- old/configure.ac 2023-06-09 00:53:54.121886669 +0200 ++++ new/configure.ac 2023-06-09 00:57:13.149792791 +0200 +@@ -3220,45 +3220,8 @@ + AC_PATH_PROG([SYSTEMD_ANALYZE_PROGRAM], [systemd-analyze], [/usr/bin/systemd-analyze]) + + dnl Relevant since 2023: https://github.com/systemd/systemd/pull/25916 +-SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY=no +-AS_IF([test -x "$SYSTEMD_ANALYZE_PROGRAM"], [ +- AC_MSG_CHECKING([if your systemd version supports Type=notify]) +- myFILE="`mktemp systemd-analyze-XXXXXX.service`" +- cat > "$myFILE" << EOF +-@<:@Unit@:>@ +-Description=temp +-@<:@Service@:>@ +-ExecStart=/bin/true +-Type=notify +-EOF +- if myOUT="`"$SYSTEMD_ANALYZE_PROGRAM" verify "$myFILE" 2>&1`" \ +- && ! (echo "$myOUT" | grep "Failed to parse service type, ignoring") \ +- ; then +- SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY=yes +- fi +- rm -f "$myFILE" +- AC_MSG_RESULT([${SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY}]) +- ]) +- +-SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD=no +-AS_IF([test -x "$SYSTEMD_ANALYZE_PROGRAM"], [ +- AC_MSG_CHECKING([if your systemd version supports Type=notify-reload]) +- myFILE="`mktemp systemd-analyze-XXXXXX.service`" +- cat > "$myFILE" << EOF +-@<:@Unit@:>@ +-Description=temp +-@<:@Service@:>@ +-ExecStart=/bin/true +-Type=notify-reload +-EOF +- if myOUT="`"$SYSTEMD_ANALYZE_PROGRAM" verify "$myFILE" 2>&1`" \ +- && ! (echo "$myOUT" | grep "Failed to parse service type, ignoring") \ +- ; then +- SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD=yes +- fi +- rm -f "$myFILE" +- AC_MSG_RESULT([${SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD}]) +- ]) ++SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY=yes ++SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD=yes + + AS_IF([test x"${with_libsystemd}" = xyes && test x"${SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY}" = xyes], [ + dnl Built with sd_notify support |