Prechádzať zdrojové kódy

celerybeat debian init script: Die if $CELERYD is not executable

Ask Solem 15 rokov pred
rodič
commit
e76d41d736
1 zmenil súbory, kde vykonal 7 pridanie a 0 odobranie
  1. 7 0
      contrib/debian/init.d/celerybeat

+ 7 - 0
contrib/debian/init.d/celerybeat

@@ -91,6 +91,13 @@ if [ ! -z "$VIRTUALENV" ]; then
     CELERYBEAT="$VIRTUALENV/bin/$CELERYBEAT"
 fi
 
+if [ -f "$CELERYBEAT" && ! -x "$CELERYBEAT" ]; then
+    echo "ERROR: $CELERYBEAT is not executable."
+    echo "Please make it executable by doing: chmod +x '$CELERYBEAT'"
+
+    echo "celerybeat is disabled"
+    exit
+fi
 
 case "$1" in
   start)