Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] apcupsd: add powerfail logic at shutdown
@ 2023-09-08  7:44 basploeger
  2023-09-08  8:07 ` [PR PATCH] [Updated] " basploeger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: basploeger @ 2023-09-08  7:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 413 bytes --]

There is a new pull request by basploeger against master on the void-packages repository

https://github.com/basploeger/void-packages apcupsd-powerfail
https://github.com/void-linux/void-packages/pull/45970

apcupsd: add powerfail logic at shutdown

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/45970.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-apcupsd-powerfail-45970.patch --]
[-- Type: text/x-diff, Size: 2073 bytes --]

From 01029f5e312b010d389f55055ff26388579bdb42 Mon Sep 17 00:00:00 2001
From: Bas Ploeger <5904333+basploeger@users.noreply.github.com>
Date: Sat, 2 Apr 2022 22:00:49 +0200
Subject: [PATCH] apcupsd: add powerfail logic at shutdown

---
 srcpkgs/apcupsd/files/apcupsd-powerfail.sh | 9 +++++++++
 srcpkgs/apcupsd/files/apcupsd/run          | 5 +++++
 srcpkgs/apcupsd/template                   | 3 ++-
 3 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/apcupsd/files/apcupsd-powerfail.sh

diff --git a/srcpkgs/apcupsd/files/apcupsd-powerfail.sh b/srcpkgs/apcupsd/files/apcupsd-powerfail.sh
new file mode 100644
index 0000000000000..8798e855b3802
--- /dev/null
+++ b/srcpkgs/apcupsd/files/apcupsd-powerfail.sh
@@ -0,0 +1,9 @@
+PWRFAILDIR=$( grep -e ^PWRFAILDIR /etc/apcupsd/apcupsd.conf | cut -d ' ' -f 2 )
+PWRFAILDIR=${PWRFAILDIR:=/etc/apcupsd}
+
+if [ -f "${PWRFAILDIR}/powerfail" ]; then
+   echo
+   echo "APCUPSD will now power off the UPS"
+   echo
+   /etc/apcupsd/apccontrol killpower
+fi
diff --git a/srcpkgs/apcupsd/files/apcupsd/run b/srcpkgs/apcupsd/files/apcupsd/run
index e570f226c90a8..6ca6b0787c45b 100644
--- a/srcpkgs/apcupsd/files/apcupsd/run
+++ b/srcpkgs/apcupsd/files/apcupsd/run
@@ -1,4 +1,9 @@
 #!/bin/sh
 exec 2>&1
+
+PWRFAILDIR=$( grep -e ^PWRFAILDIR /etc/apcupsd/apcupsd.conf | cut -d ' ' -f 2 )
+PWRFAILDIR=${PWRFAILDIR:=/etc/apcupsd}
+rm -f "${PWRFAILDIR}/powerfail"
+
 [ -r conf] && . ./conf
 exec apcupsd -b ${OPTS}
diff --git a/srcpkgs/apcupsd/template b/srcpkgs/apcupsd/template
index ba1394b2d9d07..5b7c1404589fb 100644
--- a/srcpkgs/apcupsd/template
+++ b/srcpkgs/apcupsd/template
@@ -1,7 +1,7 @@
 # Template file for 'apcupsd'
 pkgname=apcupsd
 version=3.14.14
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --disable-install-distdir
@@ -37,4 +37,5 @@ post_install() {
 	# This binary is not needed and conflicts with a binary from an other package.
 	rm ${DESTDIR}/usr/bin/smtp
 	vsv apcupsd
+	vinstall ${FILESDIR}/apcupsd-powerfail.sh 644 etc/runit/shutdown.d 89-apcupsd-powerfail.sh
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] apcupsd: add powerfail logic at shutdown
  2023-09-08  7:44 [PR PATCH] apcupsd: add powerfail logic at shutdown basploeger
@ 2023-09-08  8:07 ` basploeger
  2023-12-08  1:47 ` github-actions
  2023-12-23  1:45 ` [PR PATCH] [Closed]: " github-actions
  2 siblings, 0 replies; 4+ messages in thread
From: basploeger @ 2023-09-08  8:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 418 bytes --]

There is an updated pull request by basploeger against master on the void-packages repository

https://github.com/basploeger/void-packages apcupsd-powerfail
https://github.com/void-linux/void-packages/pull/45970

apcupsd: add powerfail logic at shutdown

#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/45970.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-apcupsd-powerfail-45970.patch --]
[-- Type: text/x-diff, Size: 2053 bytes --]

From 63b9ea2af33aef2837e402d1dc3c38fda6e8083a Mon Sep 17 00:00:00 2001
From: Bas Ploeger <s.c.w.ploeger@gmail.com>
Date: Sat, 2 Apr 2022 22:00:49 +0200
Subject: [PATCH] apcupsd: add powerfail logic at shutdown

---
 srcpkgs/apcupsd/files/apcupsd-powerfail.sh | 9 +++++++++
 srcpkgs/apcupsd/files/apcupsd/run          | 5 +++++
 srcpkgs/apcupsd/template                   | 3 ++-
 3 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/apcupsd/files/apcupsd-powerfail.sh

diff --git a/srcpkgs/apcupsd/files/apcupsd-powerfail.sh b/srcpkgs/apcupsd/files/apcupsd-powerfail.sh
new file mode 100644
index 0000000000000..8798e855b3802
--- /dev/null
+++ b/srcpkgs/apcupsd/files/apcupsd-powerfail.sh
@@ -0,0 +1,9 @@
+PWRFAILDIR=$( grep -e ^PWRFAILDIR /etc/apcupsd/apcupsd.conf | cut -d ' ' -f 2 )
+PWRFAILDIR=${PWRFAILDIR:=/etc/apcupsd}
+
+if [ -f "${PWRFAILDIR}/powerfail" ]; then
+   echo
+   echo "APCUPSD will now power off the UPS"
+   echo
+   /etc/apcupsd/apccontrol killpower
+fi
diff --git a/srcpkgs/apcupsd/files/apcupsd/run b/srcpkgs/apcupsd/files/apcupsd/run
index e570f226c90a8..6ca6b0787c45b 100644
--- a/srcpkgs/apcupsd/files/apcupsd/run
+++ b/srcpkgs/apcupsd/files/apcupsd/run
@@ -1,4 +1,9 @@
 #!/bin/sh
 exec 2>&1
+
+PWRFAILDIR=$( grep -e ^PWRFAILDIR /etc/apcupsd/apcupsd.conf | cut -d ' ' -f 2 )
+PWRFAILDIR=${PWRFAILDIR:=/etc/apcupsd}
+rm -f "${PWRFAILDIR}/powerfail"
+
 [ -r conf] && . ./conf
 exec apcupsd -b ${OPTS}
diff --git a/srcpkgs/apcupsd/template b/srcpkgs/apcupsd/template
index ba1394b2d9d07..5b7c1404589fb 100644
--- a/srcpkgs/apcupsd/template
+++ b/srcpkgs/apcupsd/template
@@ -1,7 +1,7 @@
 # Template file for 'apcupsd'
 pkgname=apcupsd
 version=3.14.14
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="
  --disable-install-distdir
@@ -37,4 +37,5 @@ post_install() {
 	# This binary is not needed and conflicts with a binary from an other package.
 	rm ${DESTDIR}/usr/bin/smtp
 	vsv apcupsd
+	vinstall ${FILESDIR}/apcupsd-powerfail.sh 644 etc/runit/shutdown.d 89-apcupsd-powerfail.sh
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: apcupsd: add powerfail logic at shutdown
  2023-09-08  7:44 [PR PATCH] apcupsd: add powerfail logic at shutdown basploeger
  2023-09-08  8:07 ` [PR PATCH] [Updated] " basploeger
@ 2023-12-08  1:47 ` github-actions
  2023-12-23  1:45 ` [PR PATCH] [Closed]: " github-actions
  2 siblings, 0 replies; 4+ messages in thread
From: github-actions @ 2023-12-08  1:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/45970#issuecomment-1846429816

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Closed]: apcupsd: add powerfail logic at shutdown
  2023-09-08  7:44 [PR PATCH] apcupsd: add powerfail logic at shutdown basploeger
  2023-09-08  8:07 ` [PR PATCH] [Updated] " basploeger
  2023-12-08  1:47 ` github-actions
@ 2023-12-23  1:45 ` github-actions
  2 siblings, 0 replies; 4+ messages in thread
From: github-actions @ 2023-12-23  1:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

There's a closed pull request on the void-packages repository

apcupsd: add powerfail logic at shutdown
https://github.com/void-linux/void-packages/pull/45970

Description:

#### Testing the changes
- I tested the changes in this PR: **YES**


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-23  1:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08  7:44 [PR PATCH] apcupsd: add powerfail logic at shutdown basploeger
2023-09-08  8:07 ` [PR PATCH] [Updated] " basploeger
2023-12-08  1:47 ` github-actions
2023-12-23  1:45 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).