X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/721ff8ccc6a84ecb2285c997b0fd07c8b972d9de..a78867ddc7e61af8e004f51102a802c583ffbecd:/scripts/domtool-slave diff --git a/scripts/domtool-slave b/scripts/domtool-slave index 2d5588f..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 \ @@ -35,7 +42,7 @@ case $1 in ;; restart|reload|force-reload) - $SELF stop + set +e; $SELF stop; set -e $SELF start ;;