slackbuilds_ponce/system/apcupsd/patches/init-script-fixups.diff
Robby Workman 060221841f system/apcupsd: fixup a restart issue + minor tweaks
Thanks to Fabio Bas for the bug report and solution.

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2017-06-03 08:00:05 +07:00

35 lines
1,019 B
Diff

diff -Nur apcupsd-3.14.14.orig/platforms/slackware/apcupsd.in apcupsd-3.14.14/platforms/slackware/apcupsd.in
--- apcupsd-3.14.14.orig/platforms/slackware/apcupsd.in 2015-01-29 08:13:25.000000000 -0600
+++ apcupsd-3.14.14/platforms/slackware/apcupsd.in 2017-05-29 21:34:28.782782149 -0500
@@ -9,17 +9,18 @@
APCPID=@PIDDIR@/apcupsd.pid
DISTVER="@DISTVER@"
-return=" Done."
+return=""
case "$1" in
start)
rm -f @PWRFAILDIR@/powerfail
rm -f @nologdir@/nologin
- echo -n "Starting apcupsd power management.."
+ echo -n "Starting apcupsd power management: /sbin/apcupsd"
if [ -f ${APCPID} ]; then
return=" Already running."
else
+ mkdir -p @LOCKDIR@
@sbindir@/apcupsd && touch @LOCKDIR@/apcupsd \
|| return=" Failed."
fi
@@ -29,8 +30,9 @@
stop)
echo -n "Stopping apcupsd power management.."
if [ -f ${APCPID} ]; then
- THEPID=`cat ${APCPID}`
+ THEPID=$(cat ${APCPID})
kill ${THEPID} || return=" Failed."
+ sleep 2
rm -f ${APCPID}
else
return=" Nothing to stop."