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

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


The following commit(s) were added to refs/heads/2.1 by this push:
     new ec91052417 Fail accumulo-service stop/kill when no service name is 
given (#6537)
ec91052417 is described below

commit ec91052417adf0ae64f2961eef10592ad4df2228
Author: Dom G. <[email protected]>
AuthorDate: Thu Sep 17 15:10:23 2026 -0400

    Fail accumulo-service stop/kill when no service name is given (#6537)
---
 assemble/bin/accumulo-service | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/assemble/bin/accumulo-service b/assemble/bin/accumulo-service
index c04424819c..1a2e734562 100755
--- a/assemble/bin/accumulo-service
+++ b/assemble/bin/accumulo-service
@@ -34,15 +34,15 @@ Services:
 
 Commands:
   start                   Starts service(s)
-  stop [--all | [<name>]] Stops service(s)
-  kill [--all | [<name>]] Kills service(s)
+  stop [--all | <name>]   Stops service(s)
+  kill [--all | <name>]   Kills service(s)
   list                    List running service(s)
 
 EOF
 }
 
 function invalid_args {
-  echo -e "Invalid arguments: $1\n"
+  echo -e "Invalid arguments: $1\n" 1>&2
   print_usage 1>&2
   exit 1
 }
@@ -189,6 +189,9 @@ function stop_service() {
     done
 
   else
+    if [[ -z $service_name ]]; then
+      invalid_args "'stop' requires --all or a service <name> (e.g. 
${service_type}_${group}_1; see '$service_type list')"
+    fi
     echo "Stopping service process: $service_name"
     local pid_file="${ACCUMULO_PID_DIR}/accumulo-${service_name}.pid"
     control_process "TERM" "$service_name" "$pid_file"
@@ -218,6 +221,9 @@ function kill_service() {
     done
 
   else
+    if [[ -z $service_name ]]; then
+      invalid_args "'kill' requires --all or a service <name> (e.g. 
${service_type}_${group}_1; see '$service_type list')"
+    fi
     local pid_file="${ACCUMULO_PID_DIR}/accumulo-${service_name}.pid"
     control_process "KILL" "$service_name" "$pid_file"
   fi

Reply via email to