Browse Source

glob returns wildcard pattern when no pids have been found

Rinat Shigapov 11 years ago
parent
commit
5607139125
1 changed files with 6 additions and 0 deletions
  1. 6 0
      extra/generic-init.d/celeryd

+ 6 - 0
extra/generic-init.d/celeryd

@@ -292,6 +292,12 @@ check_status () {
 
     local one_failed=
     for pid_file in "$CELERYD_PID_DIR"/*.pid; do
+        if [ ! -r $pid_file ]; then
+            echo "${SCRIPT_NAME} is stopped: no pids were found"
+            one_failed=true
+            break
+        fi
+
         local node=`basename "$pid_file" .pid`
         local pid=`cat "$pid_file"`
         local cleaned_pid=`echo "$pid" | sed -e 's/[^0-9]//g'`