From 16e76ba13e0f8c8725f7463f8878924f3a9b8e78 Mon Sep 17 00:00:00 2001 From: Russ Sayers Date: Thu, 3 Sep 2020 19:14:38 +1000 Subject: [PATCH] DEVX-2039: added test for log dir permissions --- microservices-orders/scripts/run-services.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/microservices-orders/scripts/run-services.sh b/microservices-orders/scripts/run-services.sh index 2f2460fb2..6544eb0f8 100755 --- a/microservices-orders/scripts/run-services.sh +++ b/microservices-orders/scripts/run-services.sh @@ -12,6 +12,12 @@ ADDITIONAL_ARGS=${ADDITIONAL_ARGS:-""} LOG_DIR=${LOG_DIR:="logs"} PIDS_FILE=${PIDS_FILE:=".microservices.pids"} +# check if we can write to the log directory +if [ ! -w $LOG_DIR ]; then + echo "Unable to write to the logs dir with uid `id -u`. Logging to /tmp." + LOG_DIR=/tmp +fi + echo "Config File arg: $CONFIG_FILE_ARG" echo "Additional Args: $ADDITIONAL_ARGS" echo "Starting microservices from $JAR"