Skip to content

Commit

Permalink
Merge pull request #448 from zowe/users/aditya/update-jobname
Browse files Browse the repository at this point in the history
Removed hardcoded 1 from _BPX_JOBNAME and Get instance id for cookie from v2 env var
  • Loading branch information
1000TurquoisePogs authored Apr 20, 2022
2 parents 1f4c8a8 + afe5638 commit f257f1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
8 changes: 4 additions & 4 deletions bin/zssServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ fi

if [ -f "$CONFIG_FILE" ]; then
if [ "$ZWES_LOG_FILE" = "/dev/null" ]; then
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ1 ${ZSS_SERVER} "${CONFIG_FILE}" 2>&1
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ ${ZSS_SERVER} "${CONFIG_FILE}" 2>&1
else
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ1 ${ZSS_SERVER} "${CONFIG_FILE}" 2>&1 | tee $ZWES_LOG_FILE
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ ${ZSS_SERVER} "${CONFIG_FILE}" 2>&1 | tee $ZWES_LOG_FILE
fi
else
if [ "$ZWES_LOG_FILE" = "/dev/null" ]; then
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ1 ${ZSS_SERVER} 2>&1
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ ${ZSS_SERVER} 2>&1
else
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ1 ${ZSS_SERVER} 2>&1 | tee $ZWES_LOG_FILE
_BPX_SHAREAS=NO _BPX_JOBNAME=${ZOWE_PREFIX}SZ ${ZSS_SERVER} 2>&1 | tee $ZWES_LOG_FILE
fi
fi
# This program and the accompanying materials are
Expand Down
9 changes: 2 additions & 7 deletions c/zss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1167,13 +1167,8 @@ static void readAgentAddressAndPort(JsonObject *serverConfig, JsonObject *envCon
static char* generateCookieName(JsonObject *envConfig, int port) {
int cookieLength=256;
char *cookieName = safeMalloc(cookieLength+1, "CookieName");
char *zoweInstanceId = getenv("ZOWE_INSTANCE");
char *haInstanceCountStr = getenv("ZWE_HA_INSTANCES_COUNT");
int haInstanceCount=0;
if (haInstanceCountStr != NULL) {
haInstanceCount = atoi(haInstanceCountStr);
}
if (haInstanceCount > 1 && zoweInstanceId != NULL) {
char *zoweInstanceId = getenv("ZWE_zowe_cookieIdentifier");
if (zoweInstanceId != NULL) {
snprintf(cookieName, cookieLength, "%s.%s", SESSION_TOKEN_COOKIE_NAME, zoweInstanceId);
} else {
snprintf(cookieName, cookieLength, "%s.%d", SESSION_TOKEN_COOKIE_NAME, port);
Expand Down

0 comments on commit f257f1d

Please sign in to comment.