You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zh...@apache.org on 2024/06/14 09:06:54 UTC

(pulsar) branch branch-3.0 updated: [fix][cli] Fix the pulsar-daemon parameter passthrough syntax (#22905)

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

zhaocong pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new d34f522615e [fix][cli] Fix the pulsar-daemon parameter passthrough syntax (#22905)
d34f522615e is described below

commit d34f522615eac190084461c6dff78b812c3dac82
Author: Cong Zhao <zh...@apache.org>
AuthorDate: Fri Jun 14 17:02:33 2024 +0800

    [fix][cli] Fix the pulsar-daemon parameter passthrough syntax (#22905)
    
    Co-authored-by: Lari Hotari <lh...@apache.org>
    (cherry picked from commit 7a21918cb70e6da33e1829d1f28d21bdd03be799)
---
 bin/pulsar-daemon | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/bin/pulsar-daemon b/bin/pulsar-daemon
index 210162b6a21..2c05cb5c49d 100755
--- a/bin/pulsar-daemon
+++ b/bin/pulsar-daemon
@@ -157,7 +157,7 @@ start ()
     echo starting $command, logging to $logfile
     echo Note: Set immediateFlush to true in conf/log4j2.yaml will guarantee the logging event is flushing to disk immediately. The default behavior is switched off due to performance considerations.
     pulsar=$PULSAR_HOME/bin/pulsar
-    nohup $pulsar $command "$1" > "$out" 2>&1 < /dev/null &
+    nohup $pulsar $command "$@" > "$out" 2>&1 < /dev/null &
     echo $! > $pid
     sleep 1; head $out
     sleep 2;
@@ -216,7 +216,7 @@ stop ()
 
 case $startStop in
   (start)
-    start "$*"
+    start "$@"
     ;;
 
   (stop)
@@ -224,21 +224,20 @@ case $startStop in
     ;;
 
   (restart)
-    forceStopFlag=$(echo "$*"|grep "\-force")
-    if [[ "$forceStopFlag" != "" ]]
+    if [[ "$1" == "-force" ]]
     then
-      stop "-force"
+      stop -force
+      # remove "-force" from the arguments
+      shift
     else
       stop
     fi
     if [ "$?" == 0 ]
     then
-       sleep 3
-       paramaters="$*"
-       startParamaters=${paramaters//-force/}
-       start "$startParamaters"
+      sleep 3
+      start "$@"
     else
-       echo "WARNNING :  $command failed restart, for $command is not stopped completely."
+      echo "WARNNING :  $command failed restart, for $command is not stopped completely."
     fi
     ;;