powerman/powerman-piddir.patch

25 lines
673 B
Diff
Raw Normal View History

--- scripts/powerman.init.in
+++ scripts/powerman.init.in
@@ -34,7 +34,8 @@
DAEMON="$sbindir/powermand"
#DAEMON_ARGS=
CONFIG=$sysconfdir/powerman/powerman.conf
-PIDFILE="$localstatedir/run/powerman/powermand.pid"
+PIDDIR="$localstatedir/run/powerman"
+PIDFILE="$PIDDIR/powermand.pid"
#NICE=
USER=@RUN_AS_USER@
#SIGHUP_RELOAD=
@@ -53,7 +54,10 @@
SCRIPT_NAME="`basename \"$0\" .init | sed 's/^[SK][0-9][0-9]*//'`"
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
##