From d6a3d92671259a2ee653a0d8f407d7682ee099f2 Mon Sep 17 00:00:00 2001 From: Dom G Date: Tue, 15 Sep 2026 11:41:04 -0400 Subject: [PATCH] Fail accumulo-service stop/kill when no service name is given --- assemble/bin/accumulo-service | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assemble/bin/accumulo-service b/assemble/bin/accumulo-service index 17da2f8b547..2300e7f74a5 100755 --- a/assemble/bin/accumulo-service +++ b/assemble/bin/accumulo-service @@ -32,15 +32,15 @@ Services: all All services (list command only) Commands: start Starts service(s) - stop [--all | []] Stops service(s) - kill [--all | []] Kills service(s) + stop [--all | ] Stops service(s) + kill [--all | ] Kills service(s) list [--json] 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 } @@ -339,6 +339,9 @@ function main() { if [[ -z $command_name ]]; then invalid_args " cannot be empty" fi + if [[ $command_name =~ ^(stop|kill)$ && $all_flag != 'true' && -z $ACCUMULO_CLUSTER_ARG && -z $service_name ]]; then + invalid_args "'$command_name' requires --all or a service (e.g. ${service}_${group}_1; see '$service list')" + fi case "$command_name" in start) start_service "$service" "$service_name" "$@"