powerman/powerman-piddir.patch

26 lines
800 B
Diff
Raw Normal View History

diff -rupN powerman-2.3.16.old/scripts/powerman.in powerman-2.3.16/scripts/powerman.in
--- powerman-2.3.16.old/scripts/powerman.in 2012-01-12 16:37:34.000000000 -0800
+++ powerman-2.3.16/scripts/powerman.in 2014-08-04 09:40:11.063544169 -0700
@@ -34,7 +34,8 @@ DESC="PowerMan"
DAEMON="$sbindir/powermand"
#DAEMON_ARGS=
CONFIG=$sysconfdir/powerman/powerman.conf
-PIDFILE="$localstatedir/run/powerman/powermand.pid"
+PIDDIR="/run/powerman"
+PIDFILE="$PIDDIR/powermand.pid"
#NICE=
USER=@RUN_AS_USER@
#SIGHUP_RELOAD=
@@ -54,6 +55,11 @@ service_init ()
SIGTERM_TIMEOUT="3"
STATUS=0
+if [ ! -d "$PIDDIR" ] ; then
+ mkdir "$PIDDIR"
+ chown $USER $PIDDIR
+fi
+
# Read configuration defaults to override variables:
# $DAEMON_ARGS, $CONFIG, $PIDFILE, $USER, $NICE, $SIGHUP_RELOAD
##