Bug#901358: ups-monitor script needs to honor PWRFAILDIR

2018-06-11 Thread Elliott Mitchell
tags 901358 patch
quit

Need to attach the patch...


-- 
(\___(\___(\__  --=> 8-) EHM <=--  __/)___/)___/)
 \BS (| ehem+sig...@m5p.com  PGP 87145445 |)   /
  \_CS\   |  _  -O #include  O-   _  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445


--- ups-monitor.dpkg-new	2016-07-16 08:19:48.0 -0700
+++ ups-monitor	2017-10-25 12:05:43.462235341 -0700
@@ -20,7 +20,10 @@
 
 case "$1" in
 	poweroff | killpower)
-		if [ -f /etc/apcupsd/powerfail ]; then
+		faildir="$(grep -e^PWRFAILDIR /etc/apcupsd/apcupsd.conf)"
+		faildir="${faildir#PWRFAILDIR }"
+
+		if [ -f "${faildir:=/etc/apcupsd}/powerfail" ]; then
 			echo ""
 			echo -n "apcupsd: Ordering UPS to kill power... "
 			/etc/apcupsd/apccontrol killpower


Bug#901358: ups-monitor script needs to honor PWRFAILDIR

2018-06-11 Thread Elliott Mitchell
Package: apcupsd
Version: 3.14.14-0.3

If the value PWRFAILDIR is modified in /etc/apcupsd/apcupsd.conf, the
/etc/apcupsd/ups-monitor script WILL fail.  The attached patch should
solve this.

PWRFAILDIR should likely default to "/run" or "/run/apcupsd" as those
are STRONGLY prefered for runtime state.  This allows `apcupsd` to
function on a system with read-only root.


-- 
(\___(\___(\__  --=> 8-) EHM <=--  __/)___/)___/)
 \BS (| ehem+sig...@m5p.com  PGP 87145445 |)   /
  \_CS\   |  _  -O #include  O-   _  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445