You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2021/12/10 22:07:48 UTC

[accumulo] branch main updated: Fix accumulo-cluster remote start error (#2380)

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

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new a743c76  Fix accumulo-cluster remote start error (#2380)
a743c76 is described below

commit a743c76bb1a05f75fb094b9c8e95356fee7f65f8
Author: Dave Marion <dl...@apache.org>
AuthorDate: Fri Dec 10 17:07:44 2021 -0500

    Fix accumulo-cluster remote start error (#2380)
    
    * Dont pass empty args to remote services when starting them
    
    The accumulo-cluster script manages local and remote services. Accumulo
    services accept arguments when starting them, but there is an issue
    in the script where it's passing an empty string to the service
    on the remote machine, which causes an error.
    
    Closes #2379
---
 assemble/bin/accumulo-cluster | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/assemble/bin/accumulo-cluster b/assemble/bin/accumulo-cluster
index 787c472..335aa92 100755
--- a/assemble/bin/accumulo-cluster
+++ b/assemble/bin/accumulo-cluster
@@ -129,9 +129,21 @@ function control_service() {
     [[ "$service" == "compactor" ]] && ACCUMULO_SERVICE_INSTANCE="${inst_id}_${5}"
 
     if [[ $host == localhost || $host == "$(hostname -s)" || $host == "$(hostname -f)" || $host == $(get_ip) ]] ; then
-      ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" "${bin}/accumulo-service" "$service" "$control_cmd" "${@:4}"
+      #
+      # The server processes take arguments (e.g. -a, -p, -o, -q [in the case of the Compactor]).
+      #
+      if [[ $# -gt 3 ]]; then
+        ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" "${bin}/accumulo-service" "$service" "$control_cmd" "${@:4}"
+      else
+        ACCUMULO_SERVICE_INSTANCE="${ACCUMULO_SERVICE_INSTANCE}" "${bin}/accumulo-service" "$service" "$control_cmd"
+      fi
     else
-      $SSH "$host" "bash -c 'ACCUMULO_SERVICE_INSTANCE=${ACCUMULO_SERVICE_INSTANCE} ${bin}/accumulo-service \"$service\" \"$control_cmd\" \"${@:4}\" '"
+      if [[ $# -gt 3 ]]; then
+        EXTRA_ARGS="${@:4}"
+        $SSH "$host" "bash -c 'ACCUMULO_SERVICE_INSTANCE=${ACCUMULO_SERVICE_INSTANCE} ${bin}/accumulo-service \"$service\" \"$control_cmd\" $EXTRA_ARGS '"
+      else
+        $SSH "$host" "bash -c 'ACCUMULO_SERVICE_INSTANCE=${ACCUMULO_SERVICE_INSTANCE} ${bin}/accumulo-service \"$service\" \"$control_cmd\"'"
+      fi
     fi
   done
 }