Skip to content

Commit

Permalink
[fix][cli] Fix the pulsar-daemon parameter passthrough syntax (apache…
Browse files Browse the repository at this point in the history
…#22905)

Co-authored-by: Lari Hotari <lhotari@apache.org>
(cherry picked from commit 7a21918)
(cherry picked from commit d34f522)
  • Loading branch information
coderzc authored and srinath-ctds committed Jul 1, 2024
1 parent f7ee78d commit ee21988
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions bin/pulsar-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -216,29 +216,28 @@ stop ()

case $startStop in
(start)
start "$*"
start "$@"
;;

(stop)
stop $1
;;

(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
;;

Expand Down

0 comments on commit ee21988

Please sign in to comment.