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 b116f6821b4011e323b827e03ca741065ba6236e..b544568e728c3153824848829b158fda25562a19 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 cf01fcfc01c795b8c9a13d278ef7d43a52bf6d33..d489869edc6fd8cce5c3d3f93e31ddc9ce0f7c0b 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 6f2c0487e51f5823c7b7032a8d7235d19d2ab87a..62c0ac8f7c671da6fe8ccd811c3777eec69810db 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 ef92340fb5ee4e2bbe59115b7c37a7a31c505b1c..a5b6857ef5f2f267bfcd9379d72b5f2bdbec7f83 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
         ;;