Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions assemble/bin/accumulo-service
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ Services:
all All services (list command only)
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 [--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
}
Expand Down Expand Up @@ -339,6 +339,9 @@ function main() {
if [[ -z $command_name ]]; then
invalid_args "<command> cannot be empty"
fi
if [[ $command_name =~ ^(stop|kill)$ && $all_flag != 'true' && -z $ACCUMULO_CLUSTER_ARG && -z $service_name ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to add this arg check in the logic for the stop_service and kill_service functions?

invalid_args "'$command_name' requires --all or a service <name> (e.g. ${service}_${group}_1; see '$service list')"
fi
case "$command_name" in
start)
start_service "$service" "$service_name" "$@"
Expand Down