From: Justin Pettit Date: Mon, 28 Jun 2010 20:43:10 +0000 (-0700) Subject: debian: Correct naming in init scripts X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=366d78fd926e3d7f2b78ec8cf63dbab72fa9c8b7;p=openvswitch debian: Correct naming in init scripts 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 --- diff --git a/debian/corekeeper.init b/debian/corekeeper.init index b116f682..b544568e 100755 --- a/debian/corekeeper.init +++ b/debian/corekeeper.init @@ -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 ;; diff --git a/debian/openvswitch-controller.init b/debian/openvswitch-controller.init index cf01fcfc..d489869e 100755 --- a/debian/openvswitch-controller.init +++ b/debian/openvswitch-controller.init @@ -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 ;; diff --git a/debian/openvswitch-monitor.init b/debian/openvswitch-monitor.init index 6f2c0487..62c0ac8f 100755 --- a/debian/openvswitch-monitor.init +++ b/debian/openvswitch-monitor.init @@ -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 ;; diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init index ef92340f..a5b6857e 100755 --- a/debian/openvswitch-switch.init +++ b/debian/openvswitch-switch.init @@ -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 ;;