ddanielr commented on code in PR #4763:
URL: https://github.com/apache/accumulo/pull/4763#discussion_r1694305012


##########
assemble/bin/accumulo-service:
##########
@@ -137,40 +192,61 @@ function main() {
   mkdir -p "$ACCUMULO_LOG_DIR" 2>/dev/null
   mkdir -p "$ACCUMULO_PID_DIR" 2>/dev/null
 
-  host="$(hostname)"
-  if [[ -z $host ]]; then
-    host=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut 
-f1 -d'/')
+  HOST="$(hostname)"
+  if [[ -z $HOST ]]; then
+    HOST=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut 
-f1 -d'/')
   fi
-  service="$1"
 
-  if [[ $service == "master" ]]; then
+  local service_type="$1"
+  local command_name="$2"
+  shift 2
+  local service_name="unknown"
+  local all_flag=false
+
+  if [[ $service_type == "master" ]]; then
     echo "WARN : Use of 'master' service name is deprecated; use 'manager' 
instead."
-    service="manager"
+    service_type="manager"
+  fi
+
+  # Check and see if accumulo-cluster is calling this script
+  if [ -z ${ACCUMULO_SERVICE_INSTANCE+x} ]; then
+    # The rest of the arguments are from a user

Review Comment:
   I was trying to ensure that ACCUMULO_SERVICE_INSTANCE always contained a 
non-empty string. 
   However, after your comment I went back and tested setting a single instance 
of each service type.
    
   When accumulo-cluster starts up a single tserver, ACCUMULO_SERVICE_INSTANCE 
is set to a empty value. 
   Then this is passed to accumulo-service.
   
https://github.com/apache/accumulo/blob/8b879c4e7ae8583e72448d66d073973a508fb716/assemble/bin/accumulo-cluster#L141
 
   
   I've switched the logic to use your suggestion and tested that it works with 
single and multiple instances of accumulo services.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to