This is an automated email from the ASF dual-hosted git repository.

duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new e574a54b242 Remove the force start parameter in startup script (#35218)
e574a54b242 is described below

commit e574a54b2428dcb24667851c3526ca1661ee90a1
Author: ZhangCheng <chengzh...@apache.org>
AuthorDate: Mon Apr 21 09:57:34 2025 +0800

    Remove the force start parameter in startup script (#35218)
---
 distribution/proxy/src/main/resources/bin/start.sh | 17 ++++-------------
 test/e2e/fixture/src/test/assembly/bin/start.sh    | 15 +++------------
 2 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/distribution/proxy/src/main/resources/bin/start.sh 
b/distribution/proxy/src/main/resources/bin/start.sh
index 72b64520580..dc90e147504 100644
--- a/distribution/proxy/src/main/resources/bin/start.sh
+++ b/distribution/proxy/src/main/resources/bin/start.sh
@@ -102,7 +102,6 @@ MAIN_CLASS=org.apache.shardingsphere.proxy.Bootstrap
 unset -v PORT
 unset -v ADDRESSES
 unset -v CONF_PATH
-unset -v FORCE
 unset -v SOCKET_FILE
 
 print_usage() {
@@ -111,14 +110,13 @@ print_usage() {
     echo "  port: proxy listen port, default is 3307"
     echo "  config_dir: proxy config directory, default is 'conf'"
     echo ""
-    echo "start.sh [-a addresses] [-p port] [-c /path/to/conf] [-f] [-g] [-s 
/path/to/socket]"
+    echo "start.sh [-a addresses] [-p port] [-c /path/to/conf] [-g] [-s 
/path/to/socket]"
     echo "The options are unordered."
     echo "-a  Bind addresses, can be IPv4, IPv6, hostname. In"
     echo "    case more than one address is specified in a"
     echo "    comma-separated list. The default value is '0.0.0.0'."
     echo "-p  Bind port, default is '3307', which could be changed in 
global.yaml"
     echo "-c  Path to config directory of ShardingSphere-Proxy, default is 
'conf'"
-    echo "-f  Force start ShardingSphere-Proxy"
     echo "-g  Enable agent if shardingsphere-agent deployed in 'agent' 
directory"
     echo "-s  The socket file to use for connection."
     exit 0
@@ -172,8 +170,8 @@ if [ $# == 0 ]; then
     CLASS_PATH=${DEPLOY_DIR}/conf:${CLASS_PATH}
 fi
 
-if [[ $1 == -a ]] || [[ $1 == -p ]] || [[ $1 == -c ]] || [[ $1 == -f ]] || [[ 
$1 == -s ]]; then
-    while getopts ":a:p:c:fs:" opt
+if [[ $1 == -a ]] || [[ $1 == -p ]] || [[ $1 == -c ]] || [[ $1 == -s ]]; then
+    while getopts ":a:p:c:s:" opt
     do
         case $opt in
         a)
@@ -185,9 +183,6 @@ if [[ $1 == -a ]] || [[ $1 == -p ]] || [[ $1 == -c ]] || [[ 
$1 == -f ]] || [[ $1
         c)
           echo "The configuration path is $OPTARG"
           CONF_PATH=$OPTARG;;
-        f)
-          echo "The force param is true"
-          FORCE=true;;
         s)
           echo "The socket file is $OPTARG"
           SOCKET_FILE=$OPTARG;;
@@ -219,16 +214,12 @@ if [ -z "$ADDRESSES" ]; then
     ADDRESSES="0.0.0.0"
 fi
 
-if [ -z "$FORCE" ]; then
-    FORCE=false
-fi
-
 if [ "$SOCKET_FILE" ]; then
     ADDRESSES="${ADDRESSES},${SOCKET_FILE}"
 fi
 
 CLASS_PATH=${CONF_PATH}:${CLASS_PATH}
-MAIN_CLASS="${MAIN_CLASS} ${PORT} ${CONF_PATH} ${ADDRESSES} ${FORCE}"
+MAIN_CLASS="${MAIN_CLASS} ${PORT} ${CONF_PATH} ${ADDRESSES}"
 
 echo "The classpath is ${CLASS_PATH}"
 echo "main class ${MAIN_CLASS}"
diff --git a/test/e2e/fixture/src/test/assembly/bin/start.sh 
b/test/e2e/fixture/src/test/assembly/bin/start.sh
index e817a354f17..433a29c00d4 100755
--- a/test/e2e/fixture/src/test/assembly/bin/start.sh
+++ b/test/e2e/fixture/src/test/assembly/bin/start.sh
@@ -40,14 +40,12 @@ MAIN_CLASS=org.apache.shardingsphere.proxy.Bootstrap
 unset -v PORT
 unset -v ADDRESSES
 unset -v CONF_PATH
-unset -v FORCE
 unset -v SOCKET_FILE
 
 print_usage() {
     echo "usage: start.sh [port] [config_dir]"
     echo "  port: proxy listen port, default is 3307"
     echo "  config_dir: proxy config directory, default is conf"
-    echo "-f  Force start ShardingSphere-Proxy"
     exit 0
 }
 
@@ -61,8 +59,8 @@ if [ $# == 0 ]; then
     CLASS_PATH=${DEPLOY_DIR}/conf:${CLASS_PATH}
 fi
 
-if [[ $1 == -a ]] || [[ $1 == -p ]] || [[ $1 == -c ]] || [[ $1 == -f ]] || [[ 
$1 == -s ]]; then
-    while getopts ":a:p:c:fs:" opt
+if [[ $1 == -a ]] || [[ $1 == -p ]] || [[ $1 == -c ]] || [[ $1 == -s ]]; then
+    while getopts ":a:p:c:s:" opt
         do
             case $opt in
             a)
@@ -74,9 +72,6 @@ if [[ $1 == -a ]] || [[ $1 == -p ]] || [[ $1 == -c ]] || [[ 
$1 == -f ]] || [[ $1
             c)
               echo "The configuration path is $OPTARG"
               CONF_PATH=$OPTARG;;
-            f)
-              echo "The force param is true"
-              FORCE=true;;
             s)
               echo "The socket file is $OPTARG"
               SOCKET_FILE=$OPTARG;;
@@ -109,16 +104,12 @@ if [ -z "$ADDRESSES" ]; then
     ADDRESSES="0.0.0.0"
 fi
 
-if [ -z "$FORCE" ]; then
-    FORCE=false
-fi
-
 if [ "$SOCKET_FILE" ]; then
     ADDRESSES="${ADDRESSES},${SOCKET_FILE}"
 fi
 
 CLASS_PATH=${CONF_PATH}:${CLASS_PATH}
-MAIN_CLASS="${MAIN_CLASS} ${PORT} ${CONF_PATH} ${ADDRESSES} ${FORCE}"
+MAIN_CLASS="${MAIN_CLASS} ${PORT} ${CONF_PATH} ${ADDRESSES}"
 
 echo "The classpath is ${CLASS_PATH}"
 echo "main class ${MAIN_CLASS}"

Reply via email to