[Pkg-nagios-changes] [pkg-mod-gearman] 15/48: Added subsys lock to worker init script.

Stig Sandbeck Mathisen ssm at debian.org
Sun Nov 24 22:38:09 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository pkg-mod-gearman.

commit b82f7ea6de30793b37de7bc66164f61493a6fcbb
Author: awiddersheim <awiddersheim at hotmail.com>
Date:   Sat Sep 7 13:28:14 2013 -0400

    Added subsys lock to worker init script.
    
    This is required on RHEL style machines to properly handle run level changes.
---
 worker/initscript.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/worker/initscript.in b/worker/initscript.in
index 24d7c2a..5e793f4 100755
--- a/worker/initscript.in
+++ b/worker/initscript.in
@@ -21,6 +21,7 @@ NAME=mod_gearman_worker
 CONFIG=%CONFIG_WORKER%
 PIDFILE=%PIDFILE%
 USER=%USER%
+LOCKFILE=/var/lock/subsys/$NAME
 USERID=`id -u`
 
 # load extra environment variables
@@ -44,6 +45,7 @@ case "$1" in
             $CMD
         fi
         if [ $? -eq 0 ]; then
+            touch $LOCKFILE
             echo "OK"
         else
             echo "failed"
@@ -62,6 +64,7 @@ case "$1" in
             done
             ps -p $pid > /dev/null 2>&1;
             if [ $? -ne 0 ]; then
+                rm -f $LOCKFILE $PIDFILE
                 echo "OK"
                 exit 0;
             else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-mod-gearman



More information about the Pkg-nagios-changes mailing list