From 7527fa7e76d0a4d5a4e231e21de673a8c55e8d73 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Tue, 20 Aug 2024 16:56:06 +0200 Subject: [PATCH 1/5] Do not log into zowe.runtimeDirectory Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- bin/start.sh | 121 +++++++++++++++++++++++---------------------------- 2 files changed, 55 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc13c2f5..676d721e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `3.0.0` - +- Bugfix: ommiting `zowe.logDirectory` forces the zss to log into the `zowe.runtimeDirectory`. (#726) ## `2.18.0` - Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) diff --git a/bin/start.sh b/bin/start.sh index 0f7e1238..a4322abe 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -2,9 +2,9 @@ # This program and the accompanying materials are # made available under the terms of the Eclipse Public License v2.0 which accompanies # this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html -# +# # SPDX-License-Identifier: EPL-2.0 -# +# # Copyright Contributors to the Zowe Project. @@ -17,7 +17,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then cd ${ZWE_zowe_runtimeDirectory}/components/zss/bin export _BPXK_AUTOCVT=ON - + # Get component home dir if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_COMPONENT_HOME}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then @@ -26,148 +26,135 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZWES_COMPONENT_HOME="${ZWE_zowe_runtimeDirectory}/components/zss" fi fi - + # Get schema paths if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_SCHEMA_PATHS}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then echo "ZWE_zowe_runtimeDirectory is not defined. Run with ZWES_SCHEA_PATHS defined to the colon-separated file paths of zowe json schemas used to validate the ZSS configuration yaml file, or have ZWE_zowe_runtimeDirectory defined to the path of a zowe install that includes zowe core schemas and zss within /components/zss" fi fi - + # Get config path or fail if [ -z "${ZWE_CLI_PARAMETER_CONFIG}" ]; then echo "ZWE_CLI_PARAMETER_CONFIG is not defined. Rerun script with it defined to a list of paths to zowe.yaml files such as /path/to/zowe.yaml or FILE(/yaml1.yaml):LIB(other.yaml):FILE(/path/to/yaml3.yaml)" fi - + # Take in our defaults ZWES_CONFIG="FILE(${ZWE_CLI_PARAMETER_CONFIG}):FILE(${ZWES_COMPONENT_HOME}/defaults.yaml)" - + # Essential parameters now set up. - + ZSS_SCRIPT_DIR="${ZWES_COMPONENT_HOME}/bin" - + ZWES_SCHEMA_PATHS="${ZWES_COMPONENT_HOME}/schemas/zowe-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/zowe-yaml-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/server-common.json:${ZWES_COMPONENT_HOME}/schemas/zss-config.json" - - + + # this is to resolve ZSS bin path in LIBPATH variable. LIBPATH="${LIBPATH}:${ZSS_SCRIPT_DIR}" - + #### Log file initialization #### - if [ -n "$ZWES_LOG_FILE" ] - then - if [[ $ZWES_LOG_FILE == /* ]] - then + if [ -n "$ZWES_LOG_FILE" ]; then + if [[ $ZWES_LOG_FILE == /* ]]; then echo "Absolute log location given." else ZWES_LOG_FILE="${ZSS_SCRIPT_DIR}/${ZWES_LOG_FILE}" echo "Relative log location given, set to absolute path=$ZWES_LOG_FILE" fi - if [ -n "$ZWES_LOG_DIR" ] - then - echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." + if [ -n "$ZWES_LOG_DIR" ]; then + echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." fi else # _FILE was not specified; default filename, and check and maybe default _DIR - if [ -z "$ZWES_LOG_DIR" ] - then - if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ] - then + if [ -z "$ZWES_LOG_DIR" ]; then + if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ]; then ZWES_LOG_DIR=${ZWE_zowe_logDirectory} else - ZWES_LOG_DIR="../log" + echo "Cannot determine the log directory. Logging disabled." + ZWES_LOG_DIR= + ZWES_LOG_FILE=/dev/null fi fi - if [ -f "$ZWES_LOG_DIR" ] - then + if [ -f "$ZWES_LOG_DIR" ]; then ZWES_LOG_FILE=$ZWES_LOG_DIR - elif [ ! -d "$ZWES_LOG_DIR" ] - then + elif [ ! -d "$ZWES_LOG_DIR" ] && [ ! -z "$ZWES_LOG_DIR" ]; then echo "Will make log directory $ZWES_LOG_DIR" mkdir -p $ZWES_LOG_DIR - if [ $? -ne 0 ] - then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ]; then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi ZWES_ROTATE_LOGS=0 - if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ] - then + if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ]; then ZWES_LOG_FILE="$ZWES_LOG_DIR/zssServer-`date +%Y-%m-%d-%H-%M`.log" - if [ -z "$ZWES_LOGS_TO_KEEP" ] - then + if [ -z "$ZWES_LOGS_TO_KEEP" ]; then ZWES_LOGS_TO_KEEP=5 fi echo $ZWES_LOGS_TO_KEEP|egrep '^\-?[0-9]+$' >/dev/null - if [ $? -ne 0 ] - then - echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." + if [ $? -ne 0 ]; then + echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." ZWES_LOGS_TO_KEEP=5 fi - if [ $ZWES_LOGS_TO_KEEP -ge 0 ] - then + if [ $ZWES_LOGS_TO_KEEP -ge 0 ]; then ZWES_ROTATE_LOGS=1 fi fi #Clean up excess logs, if appropriate. - if [ $ZWES_ROTATE_LOGS -ne 0 ] - then - for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP` - do + if [ $ZWES_ROTATE_LOGS -ne 0 ]; then + for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP`; do echo zssServer.sh removing $f rm -f $f done fi fi ZSS_CHECK_DIR="$(dirname "$ZWES_LOG_FILE")" - if [ ! -d "$ZSS_CHECK_DIR" ] - then - echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" + if [ ! -d "$ZSS_CHECK_DIR" ]; then + echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" mkdir -p $ZSS_CHECK_DIR - if [ $? -ne 0 ] - then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ]; then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi #Now sanitize final log filename: if it is relative, make it absolute before cd to js - if [ "$ZWES_LOG_FILE" != "/dev/null" ] - then + if [ "$ZWES_LOG_FILE" != "/dev/null" ]; then ZSS_CHECK_DIR=$(cd "$(dirname "$ZWES_LOG_FILE")"; pwd) ZWES_LOG_FILE=$ZSS_CHECK_DIR/$(basename "$ZWES_LOG_FILE") fi + + if [ ! -z $(echo "${ZWED_LOG_FILE}" | grep "^${ZWE_zowe_runtimeDirectory}") ]; then + echo "Logging into zowe.runtimeDirectory not allowed. Logging disabled." + ZWED_LOG_FILE=/dev/null + fi + echo ZWES_LOG_FILE=${ZWES_LOG_FILE} export ZWES_LOG_FILE=$ZWES_LOG_FILE - if [ ! -e $ZWES_LOG_FILE ] - then + if [ ! -e $ZWES_LOG_FILE ]; then touch $ZWES_LOG_FILE - if [ $? -ne 0 ] - then - echo "Cannot make log file. Logging disabled." + if [ $? -ne 0 ]; then + echo "Cannot make log file. Logging disabled." ZWES_LOG_FILE=/dev/null fi else - if [ -d $ZWES_LOG_FILE ] - then - echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." + if [ -d $ZWES_LOG_FILE ]; then + echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi - if [ ! -w "$ZWES_LOG_FILE" ] - then + if [ ! -w "$ZWES_LOG_FILE" ]; then echo file "$ZWES_LOG_FILE" is not writable. Logging disabled. ZWES_LOG_FILE=/dev/null fi #### Log file determined #### - + # Startup zss export dir=`dirname "$0"` cd $ZSS_SCRIPT_DIR - - # determine amode for zssServer + + # determine amode for zssServer ZSS_SERVER_31="./zssServer" ZSS_SERVER_64="./zssServer64" - + if [ "$ZWE_components_zss_agent_64bit" != "false" ] && [ -x "${ZSS_SERVER_64}" ]; then ZSS_SERVER="${ZSS_SERVER_64}" else @@ -183,7 +170,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 else _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 | tee $ZWES_LOG_FILE - fi + fi else echo "Zowe ZSS server is unsupported on ${OSNAME}. Supported systems: OS/390" fi From 24312825b01d5fe1bb778d8917fb169bb9c8308f Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 23 Aug 2024 10:59:24 +0200 Subject: [PATCH 2/5] If no log dir, disable logging in prod Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- bin/start.sh | 127 +++++++++++++++++++++++++++++---------------------- 2 files changed, 74 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 676d721e..269705d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `3.0.0` -- Bugfix: ommiting `zowe.logDirectory` forces the zss to log into the `zowe.runtimeDirectory`. (#726) +- Enhancement: if no `zowe.logDirectory` is provided, logging is disabled. (#726) ## `2.18.0` - Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) diff --git a/bin/start.sh b/bin/start.sh index a4322abe..3d5410e0 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -2,9 +2,9 @@ # This program and the accompanying materials are # made available under the terms of the Eclipse Public License v2.0 which accompanies # this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html -# +# # SPDX-License-Identifier: EPL-2.0 -# +# # Copyright Contributors to the Zowe Project. @@ -17,7 +17,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then cd ${ZWE_zowe_runtimeDirectory}/components/zss/bin export _BPXK_AUTOCVT=ON - + # Get component home dir if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_COMPONENT_HOME}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then @@ -26,135 +26,154 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZWES_COMPONENT_HOME="${ZWE_zowe_runtimeDirectory}/components/zss" fi fi - + # Get schema paths if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_SCHEMA_PATHS}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then echo "ZWE_zowe_runtimeDirectory is not defined. Run with ZWES_SCHEA_PATHS defined to the colon-separated file paths of zowe json schemas used to validate the ZSS configuration yaml file, or have ZWE_zowe_runtimeDirectory defined to the path of a zowe install that includes zowe core schemas and zss within /components/zss" fi fi - + # Get config path or fail if [ -z "${ZWE_CLI_PARAMETER_CONFIG}" ]; then echo "ZWE_CLI_PARAMETER_CONFIG is not defined. Rerun script with it defined to a list of paths to zowe.yaml files such as /path/to/zowe.yaml or FILE(/yaml1.yaml):LIB(other.yaml):FILE(/path/to/yaml3.yaml)" fi - + # Take in our defaults ZWES_CONFIG="FILE(${ZWE_CLI_PARAMETER_CONFIG}):FILE(${ZWES_COMPONENT_HOME}/defaults.yaml)" - + # Essential parameters now set up. - + ZSS_SCRIPT_DIR="${ZWES_COMPONENT_HOME}/bin" - + ZWES_SCHEMA_PATHS="${ZWES_COMPONENT_HOME}/schemas/zowe-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/zowe-yaml-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/server-common.json:${ZWES_COMPONENT_HOME}/schemas/zss-config.json" - - + + # this is to resolve ZSS bin path in LIBPATH variable. LIBPATH="${LIBPATH}:${ZSS_SCRIPT_DIR}" - + #### Log file initialization #### - if [ -n "$ZWES_LOG_FILE" ]; then - if [[ $ZWES_LOG_FILE == /* ]]; then + if [ -n "$ZWES_LOG_FILE" ] + then + if [[ $ZWES_LOG_FILE == /* ]] + then echo "Absolute log location given." else ZWES_LOG_FILE="${ZSS_SCRIPT_DIR}/${ZWES_LOG_FILE}" echo "Relative log location given, set to absolute path=$ZWES_LOG_FILE" fi - if [ -n "$ZWES_LOG_DIR" ]; then - echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." + if [ -n "$ZWES_LOG_DIR" ] + then + echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." fi else # _FILE was not specified; default filename, and check and maybe default _DIR - if [ -z "$ZWES_LOG_DIR" ]; then - if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ]; then + if [ -z "$ZWES_LOG_DIR" ] + then + if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ] + then ZWES_LOG_DIR=${ZWE_zowe_logDirectory} else - echo "Cannot determine the log directory. Logging disabled." - ZWES_LOG_DIR= - ZWES_LOG_FILE=/dev/null + if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then + ZWES_LOG_DIR="../log" + else + echo "Cannot determine the log directory. Logging disabled." + ZWES_LOG_DIR= + ZWES_LOG_FILE=/dev/null + fi fi fi - if [ -f "$ZWES_LOG_DIR" ]; then + if [ -f "$ZWES_LOG_DIR" ] + then ZWES_LOG_FILE=$ZWES_LOG_DIR - elif [ ! -d "$ZWES_LOG_DIR" ] && [ ! -z "$ZWES_LOG_DIR" ]; then + elif [ ! -d "$ZWES_LOG_DIR" ] + then echo "Will make log directory $ZWES_LOG_DIR" mkdir -p $ZWES_LOG_DIR - if [ $? -ne 0 ]; then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ] + then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi ZWES_ROTATE_LOGS=0 - if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ]; then + if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ] + then ZWES_LOG_FILE="$ZWES_LOG_DIR/zssServer-`date +%Y-%m-%d-%H-%M`.log" - if [ -z "$ZWES_LOGS_TO_KEEP" ]; then + if [ -z "$ZWES_LOGS_TO_KEEP" ] + then ZWES_LOGS_TO_KEEP=5 fi echo $ZWES_LOGS_TO_KEEP|egrep '^\-?[0-9]+$' >/dev/null - if [ $? -ne 0 ]; then - echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." + if [ $? -ne 0 ] + then + echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." ZWES_LOGS_TO_KEEP=5 fi - if [ $ZWES_LOGS_TO_KEEP -ge 0 ]; then + if [ $ZWES_LOGS_TO_KEEP -ge 0 ] + then ZWES_ROTATE_LOGS=1 fi fi #Clean up excess logs, if appropriate. - if [ $ZWES_ROTATE_LOGS -ne 0 ]; then - for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP`; do + if [ $ZWES_ROTATE_LOGS -ne 0 ] + then + for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP` + do echo zssServer.sh removing $f rm -f $f done fi fi ZSS_CHECK_DIR="$(dirname "$ZWES_LOG_FILE")" - if [ ! -d "$ZSS_CHECK_DIR" ]; then - echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" + if [ ! -d "$ZSS_CHECK_DIR" ] + then + echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" mkdir -p $ZSS_CHECK_DIR - if [ $? -ne 0 ]; then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ] + then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi #Now sanitize final log filename: if it is relative, make it absolute before cd to js - if [ "$ZWES_LOG_FILE" != "/dev/null" ]; then + if [ "$ZWES_LOG_FILE" != "/dev/null" ] + then ZSS_CHECK_DIR=$(cd "$(dirname "$ZWES_LOG_FILE")"; pwd) ZWES_LOG_FILE=$ZSS_CHECK_DIR/$(basename "$ZWES_LOG_FILE") fi - - if [ ! -z $(echo "${ZWED_LOG_FILE}" | grep "^${ZWE_zowe_runtimeDirectory}") ]; then - echo "Logging into zowe.runtimeDirectory not allowed. Logging disabled." - ZWED_LOG_FILE=/dev/null - fi - echo ZWES_LOG_FILE=${ZWES_LOG_FILE} export ZWES_LOG_FILE=$ZWES_LOG_FILE - if [ ! -e $ZWES_LOG_FILE ]; then + if [ ! -e $ZWES_LOG_FILE ] + then touch $ZWES_LOG_FILE - if [ $? -ne 0 ]; then - echo "Cannot make log file. Logging disabled." + if [ $? -ne 0 ] + then + echo "Cannot make log file. Logging disabled." ZWES_LOG_FILE=/dev/null fi else - if [ -d $ZWES_LOG_FILE ]; then - echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." + if [ -d $ZWES_LOG_FILE ] + then + echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi - if [ ! -w "$ZWES_LOG_FILE" ]; then + if [ ! -w "$ZWES_LOG_FILE" ] + then echo file "$ZWES_LOG_FILE" is not writable. Logging disabled. ZWES_LOG_FILE=/dev/null fi #### Log file determined #### - + # Startup zss export dir=`dirname "$0"` cd $ZSS_SCRIPT_DIR - - # determine amode for zssServer + + # determine amode for zssServer ZSS_SERVER_31="./zssServer" ZSS_SERVER_64="./zssServer64" - + if [ "$ZWE_components_zss_agent_64bit" != "false" ] && [ -x "${ZSS_SERVER_64}" ]; then ZSS_SERVER="${ZSS_SERVER_64}" else @@ -170,7 +189,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 else _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 | tee $ZWES_LOG_FILE - fi + fi else echo "Zowe ZSS server is unsupported on ${OSNAME}. Supported systems: OS/390" fi From 3ef0e0511fcf7da777da5c62bf94a7e849209974 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 23 Aug 2024 11:00:59 +0200 Subject: [PATCH 3/5] Minor update Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 269705d7..92650925 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `3.0.0` -- Enhancement: if no `zowe.logDirectory` is provided, logging is disabled. (#726) +- Enhancement: if no `zowe.logDirectory` is defined in config, logging is disabled. (#726) ## `2.18.0` - Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) From 2cd75d062df19af43fbb283b3af802196778bb4f Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 23 Aug 2024 11:13:10 +0200 Subject: [PATCH 4/5] Do not create empty dir Signed-off-by: Martin Zeithaml --- bin/start.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/start.sh b/bin/start.sh index 3d5410e0..347a07b2 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -88,12 +88,13 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZWES_LOG_FILE=$ZWES_LOG_DIR elif [ ! -d "$ZWES_LOG_DIR" ] then - echo "Will make log directory $ZWES_LOG_DIR" - mkdir -p $ZWES_LOG_DIR - if [ $? -ne 0 ] - then - echo "Cannot make log directory. Logging disabled." - ZWES_LOG_FILE=/dev/null + if [ -n "${ZWES_LOG_DIR}" ]; then + echo "Will make log directory $ZWES_LOG_DIR" + mkdir -p $ZWES_LOG_DIR + if [ $? -ne 0 ]; then + echo "Cannot make log directory. Logging disabled." + ZWES_LOG_FILE=/dev/null + fi fi fi ZWES_ROTATE_LOGS=0 From b55b510ab16360c32838fbffcac082e54559ca2f Mon Sep 17 00:00:00 2001 From: Martin Zeithaml <66114686+Martin-Zeithaml@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:35:20 +0200 Subject: [PATCH 5/5] Update start.sh Signed-off-by: Martin Zeithaml <66114686+Martin-Zeithaml@users.noreply.github.com> --- bin/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/start.sh b/bin/start.sh index 347a07b2..6f4a6e5c 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -77,7 +77,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then ZWES_LOG_DIR="../log" else - echo "Cannot determine the log directory. Logging disabled." + echo "No log directory. Logging disabled." ZWES_LOG_DIR= ZWES_LOG_FILE=/dev/null fi