summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenk Hesselink <henk@hondo.nl>2016-11-20 19:18:57 -0500
committerHenk Hesselink <henk@hondo.nl>2016-11-20 19:18:57 -0500
commit19da676f5342285c06d612af9d43ee6058f37714 (patch)
treee41ec49bb4d0fe5a5b235bdab143ffa4ebe547b3
parent749ce13ae6e9cecf69997d36228f2cab9a2eb8ec (diff)
downloadGit-Auto-Deploy-19da676f5342285c06d612af9d43ee6058f37714.zip
Git-Auto-Deploy-19da676f5342285c06d612af9d43ee6058f37714.tar.gz
Git-Auto-Deploy-19da676f5342285c06d612af9d43ee6058f37714.tar.bz2
Fix pidfile handling in Debian packaging
-rwxr-xr-xplatforms/debian/stdeb/git-auto-deploy.init4
-rwxr-xr-xplatforms/debian/stdeb/git-auto-deploy.postinst6
2 files changed, 6 insertions, 4 deletions
diff --git a/platforms/debian/stdeb/git-auto-deploy.init b/platforms/debian/stdeb/git-auto-deploy.init
index 05fa03b..daf95c8 100755
--- a/platforms/debian/stdeb/git-auto-deploy.init
+++ b/platforms/debian/stdeb/git-auto-deploy.init
@@ -18,7 +18,7 @@ DAEMON=$(which $NAME)
DAEMON_UID="git-auto-deploy"
DAEMON_GID="git-auto-deploy"
RUNDIR=/var/run/$NAME
-PIDFILE=/var/run/$NAME.pid
+PIDFILE=$RUNDIR/$NAME.pid
LOGFILE=/var/log/$NAME.log
#PWD=/opt/Git-Auto-Deploy/
OPTIONS="--daemon-mode --pid-file $PIDFILE --log-file $LOGFILE --config /etc/$NAME.conf.json"
@@ -64,7 +64,7 @@ do_start()
mkdir $RUNDIR
fi
- if ! dpkg-statoverride --list $dir >/dev/null 2>&1; then
+ if ! dpkg-statoverride --list $RUNDIR >/dev/null 2>&1; then
chown $DAEMON_UID:$DAEMON_GID $RUNDIR
chmod g-w,o-rwx $RUNDIR
fi
diff --git a/platforms/debian/stdeb/git-auto-deploy.postinst b/platforms/debian/stdeb/git-auto-deploy.postinst
index 90b4c9a..f09e23f 100755
--- a/platforms/debian/stdeb/git-auto-deploy.postinst
+++ b/platforms/debian/stdeb/git-auto-deploy.postinst
@@ -6,7 +6,8 @@ GAD_GID="git-auto-deploy"
HOME_DIR="/etc/$NAME"
DATA_DIR="/var/lib/$NAME"
-PID_FILE="/var/run/$NAME.pid"
+PID_DIR="/var/run/$NAME
+PID_FILE="$PID_DIR/$NAME.pid"
# Add user and group
adduser --quiet --system --home $HOME_DIR --no-create-home --ingroup nogroup --disabled-password $GAD_UID
@@ -31,8 +32,9 @@ chown -R $GAD_UID:$GAD_GID $DATA_DIR
chmod 750 $DATA_DIR
# Create pid file
+mkdir $PID_DIR
touch $PID_FILE
-chown $GAD_UID:$GAD_GID $PID_FILE
+chown $GAD_UID:$GAD_GID $PID_DIR $PID_FILE
chmod 750 $PID_FILE
update-rc.d $NAME defaults