[Python-modules-commits] [celery] 01/03: Remove bashisms from initd scripts

Brian May bam at moszumanska.debian.org
Wed Mar 29 20:54:46 UTC 2017


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

bam pushed a commit to branch master
in repository celery.

commit fe0a322f110f182dc98d703815d17663fa5ac893
Author: Ask Solem <ask at celeryproject.org>
Date:   Mon May 23 13:45:39 2016 -0700

    Remove bashisms from initd scripts
    
    Patch from
    https://github.com/celery/celery/commit/44c0ebf9c46406988e5002f8a78aa2dd506451d6
---
 extra/generic-init.d/celerybeat | 9 +++++++--
 extra/generic-init.d/celeryd    | 7 ++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/extra/generic-init.d/celerybeat b/extra/generic-init.d/celerybeat
index 78aa25a..a1596a3 100755
--- a/extra/generic-init.d/celerybeat
+++ b/extra/generic-init.d/celerybeat
@@ -33,9 +33,14 @@ if [ $(id -u) -ne 0 ]; then
     exit 1
 fi
 
+origin_is_runlevel_dir () {
+    set +e
+    dirname $0 | grep -q "/etc/rc.\.d"
+    echo $?
+}
 
-# May be a runlevel symlink (e.g. S02celeryd)
-if [ -L "$0" ]; then
+# Can be a runlevel symlink (e.g. S02celeryd)
+if [ $(origin_is_runlevel_dir) -eq 0 ]; then
     SCRIPT_FILE=$(readlink "$0")
 else
     SCRIPT_FILE="$0"
diff --git a/extra/generic-init.d/celeryd b/extra/generic-init.d/celeryd
index 7ad4599..d88e029 100755
--- a/extra/generic-init.d/celeryd
+++ b/extra/generic-init.d/celeryd
@@ -41,9 +41,14 @@ if [ $(id -u) -ne 0 ]; then
     exit 1
 fi
 
+origin_is_runlevel_dir () {
+    set +e
+    dirname $0 | grep -q "/etc/rc.\.d"
+    echo $?
+}
 
 # Can be a runlevel symlink (e.g. S02celeryd)
-if [[ `dirname $0` == /etc/rc*.d ]]; then
+if [ $(origin_is_runlevel_dir) -eq 0 ]; then
     SCRIPT_FILE=$(readlink "$0")
 else
     SCRIPT_FILE="$0"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/celery.git



More information about the Python-modules-commits mailing list