debian: Correct naming in init scripts
authorJustin Pettit <jpettit@nicira.com>
Mon, 28 Jun 2010 20:43:10 +0000 (13:43 -0700)
committerJustin Pettit <jpettit@nicira.com>
Mon, 28 Jun 2010 21:14:08 +0000 (14:14 -0700)
A number of the init scripts assumed that the package name was the same
as the binary, which is not always true.  This fixes those issues as
well as some incorrect names in usage messages.

Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
debian/corekeeper.init
debian/openvswitch-controller.init
debian/openvswitch-monitor.init
debian/openvswitch-switch.init

index b116f68..b544568 100755 (executable)
@@ -57,7 +57,7 @@ case "$1" in
         exit 0
         ;;
   *)
-        N=/etc/init.d/$NAME
+        N=/etc/init.d/corekeeper
         echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
         exit 1
         ;;
index cf01fcf..d489869 100755 (executable)
@@ -42,7 +42,7 @@ test -x $DAEMON || exit 0
 . /lib/lsb/init-functions
 
 # Default options, these can be overriden by the information
-# at /etc/default/$NAME
+# at /etc/default/openvswitch-controller
 DAEMON_OPTS=""          # Additional options given to the server 
 
 DODTIME=10              # Time to wait for the server to die, in seconds
@@ -260,7 +260,7 @@ case "$1" in
         log_warning_msg "cannot re-read the config file (use restart)."
         ;;
   *)
-        N=/etc/init.d/$NAME
+        N=/etc/init.d/openvswitch-controller
         echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
         exit 1
         ;;
index 6f2c048..62c0ac8 100755 (executable)
@@ -46,7 +46,7 @@ test -x $DAEMON || exit 0
 . /lib/lsb/init-functions
 
 # Default options, these can be overriden by the information
-# at /etc/default/$NAME
+# at /etc/default/openvswitch-monitor
 DAEMON_OPTS=""          # Additional options given to the daemon 
 
 DODTIME=10              # Time to wait for the daemon to die, in seconds
@@ -55,8 +55,9 @@ DODTIME=10              # Time to wait for the daemon to die, in seconds
                         # 'restart' will not work
                         
 # Include defaults if available
-if [ -f /etc/default/$NAME ] ; then
-    . /etc/default/$NAME
+default=/etc/default/openvswitch-monitor
+if [ -f $default ] ; then
+    . $default
 fi
 
 set -e
@@ -165,7 +166,7 @@ case "$1" in
         log_warning_msg "cannot re-read the config file (use restart)."
         ;;
   *)
-        N=/etc/init.d/$NAME
+        N=/etc/init.d/openvswitch-monitor
         echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
         exit 1
         ;;
index ef92340..a5b6857 100755 (executable)
@@ -327,7 +327,7 @@ case "$1" in
         done
         ;;
     *)
-        N=/etc/init.d/$NAME
+        N=/etc/init.d/openvswitch-switch
         echo "Usage: $N {start|stop|restart|force-reload|status|force-stop|unload}" >&2
         exit 1
         ;;