Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Feb 20, 2025
1 parent 36fdcd0 commit 8376353
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion freva-rest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ COPY docker-scripts/logging.sh /usr/local/lib/logging.sh
RUN mkdir -p /logs && chmod -R 2666 /logs

ENTRYPOINT ["/docker-entrypoint-initdb.d/entrypoint.sh"]
CMD python3 -m freva_rest.cli
CMD ["freva-rest-server"]
2 changes: 1 addition & 1 deletion freva-rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You can pull the container from the GitHub container registry:
docker pull ghcr.io/freva-clint/freva-rest:latest
```

By default the container starts with the ``freva-rest-service`` command.
By default the container starts with the ``freva-rest-server`` command.
See the `freva-rest-server --help` command for configure options.

### Server Startup Options
Expand Down
27 changes: 19 additions & 8 deletions freva-rest/docker-scripts/follow
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,32 @@ VALID_SERVICES=("mysql" "mongodb" "redis" "solr")
logs=()
for service in "$@"; do
service_lower=$(echo "$service" | tr '[:upper:]' '[:lower:]')
if [[ " ${VALID_SERVICES[*]} " =~ " $service_lower " ]]; then
log_file="/logs/${service_lower}.log"
case "${service_lower}" in
"mongo"|"mongodb"|"mongod")
log_file="/logs/mongodb.log"
;;
"mysql"|"mysqld")
log_file="/logs/mysqld.log"
;;
"redis")
log_file="/logs/reids.log"
;;
"solr")
log_file="/logs/solr.log"
;;
"*")
log_error "Error: '$service' is not a valid service. Allowed: ${VALID_SERVICES[*]}"
exit 1
esac
if [[ -f "$log_file" ]]; then
logs+=("$log_file")
else
log_warn Log file for '$service_lower' does not exist: $log_file"
log_warn "Log file for '$service_lower' does not exist: $log_file"
fi
else
log_error "Error: '$service' is not a valid service. Allowed: ${VALID_SERVICES[*]}"
exit 1
fi
done
if [[ ${#logs[@]} -eq 0 ]]; then
log_error "No valid services provided. Allowed: ${VALID_SERVICES[*]}"
exit 1
fi
log_info "Following $@"
tail -f "${logs[@]}"

0 comments on commit 8376353

Please sign in to comment.