From a78867ddc7e61af8e004f51102a802c583ffbecd Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Fri, 15 Feb 2008 04:35:18 +0000 Subject: [PATCH] init scripts: Fix bug with writing PID files --- scripts/domtool-server | 11 +++++++++-- scripts/domtool-slave | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/domtool-server b/scripts/domtool-server index da7282a..6078c60 100755 --- a/scripts/domtool-server +++ b/scripts/domtool-server @@ -1,9 +1,10 @@ #!/usr/bin/pagsh.openafs -# This script should go in /etc/init.d/ on Debian Linux systems running Domtool dispatchers. +# This script should go in /etc/init.d/ on Debian Linux systems +# running Domtool dispatchers. SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) -PIDFILE="/var/run/k5start-domtool-server.pid" +PIDFILE="/var/run/domtool/k5start-server.pid" set -e @@ -13,6 +14,12 @@ case $1 in if sudo -u domtool domtool-admin-sudo ping; then echo "...already running." else + PIDDIR=$(dirname "$PIDFILE") + if test ! -d "$PIDDIR"; then + mkdir -m 0755 $PIDDIR + chown domtool:domtool $PIDDIR + fi + start-stop-daemon --start --pidfile $PIDFILE \ -c domtool:domtool \ --exec /usr/bin/k5start -- -U -b \ diff --git a/scripts/domtool-slave b/scripts/domtool-slave index 2653813..5392bea 100755 --- a/scripts/domtool-slave +++ b/scripts/domtool-slave @@ -1,9 +1,10 @@ #!/usr/bin/pagsh.openafs -# This script should go in /etc/init.d/ on Debian Linux systems running Domtool slaves. +# This script should go in /etc/init.d/ on Debian Linux systems +# running Domtool slaves. SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) -PIDFILE="/var/run/k5start-domtool-slave.pid" +PIDFILE="/var/run/domtool/k5start-slave.pid" set -e @@ -13,6 +14,12 @@ case $1 in if sudo -u domtool domtool-admin-sudo slave-ping; then echo "...already running." else + PIDDIR=$(dirname "$PIDFILE") + if test ! -d "$PIDDIR"; then + mkdir -m 0755 $PIDDIR + chown domtool:domtool $PIDDIR + fi + start-stop-daemon --start --pidfile $PIDFILE \ -c domtool:domtool \ --exec /usr/bin/k5start -- -U -b \ -- 2.20.1