Be less picky about precise name of process in init script.
authorBen Pfaff <blp@nicira.com>
Wed, 23 Jul 2008 21:54:19 +0000 (14:54 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 23 Jul 2008 21:55:04 +0000 (14:55 -0700)
The previous version always printed ERROR because for whatever reason
we were comparing "/usr/sbin/secchan" against "secchan", which of
course failed.

debian/openflow-switch.init

index 74ec269..2d0ff60 100755 (executable)
@@ -50,8 +50,14 @@ running_pid()
     [ ! -d /proc/$pid ] &&  return 1
     cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
     # Is this the expected child?
-    [ "$cmd" != "$name" ] &&  return 1
-    return 0
+    case $cmd in
+        $name|*/$name)
+            return 0
+            ;;
+        *)
+            return 1
+            ;;
+    esac
 }
 
 running()