Report abuse

diff -uw functions.5.2 functions.5.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- functions.5.2       2009-11-19 13:58:31.000000000 +0100
+++ functions.5.4       2009-11-19 14:00:31.000000000 +0100
@@ -366,15 +366,17 @@
        base=${1##*/}

        # First try "pidof"
+       __pids_var_run "$1" "$pid_file"
+       RC=$?
+       if [ -z "$pid_file" -a -z "$pid" ]; then           # <- this line seems to fix the problem
        pid="$(__pids_pidof "$1")"                         # because we have no pidfile if running once
+       fi
        if [ -n "$pid" ]; then
                echo $"${base} (pid $pid) is running..."
                return 0
        fi
 
-       # Next try "/var/run/*.pid" files
-       __pids_var_run "$1" "$pid_file"
-       case "$?" in
+       case "$RC" in
                0)
                        echo $"${base} (pid $pid) is running..."
                        return 0