adding newly introduced UserExternal to crtmqm

Removing redundant env variable in dockerfile

userexternal only if gt 9201

restore env variable for UNKNOWN_ID
This commit is contained in:
kirandarbha
2020-10-21 11:32:14 +05:30
parent c37f8f1c4c
commit f39f90728f
2 changed files with 14 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ RUN chown -R 1001:root /etc/mqm/* \
&& install --directory --mode 2775 --owner 1001 --group root /run/runmqdevserver && install --directory --mode 2775 --owner 1001 --group root /run/runmqdevserver
ENV MQ_ENABLE_EMBEDDED_WEB_SERVER=1 MQ_GENERATE_CERTIFICATE_HOSTNAME=localhost ENV MQ_ENABLE_EMBEDDED_WEB_SERVER=1 MQ_GENERATE_CERTIFICATE_HOSTNAME=localhost
ENV LD_LIBRARY_PATH=/opt/mqm/lib64 ENV LD_LIBRARY_PATH=/opt/mqm/lib64
ENV MQS_PERMIT_UNKNOWN_ID=true
ENV MQ_CONNAUTH_USE_HTP=true ENV MQ_CONNAUTH_USE_HTP=true
ENV MQS_PERMIT_UNKNOWN_ID=true
USER 1001 USER 1001
ENTRYPOINT ["runmqdevserver"] ENTRYPOINT ["runmqdevserver"]

View File

@@ -203,9 +203,21 @@ func getQueueManagerDataDir(mounts map[string]string, name string) string {
} }
func getCreateQueueManagerArgs(mounts map[string]string, name string, devMode bool) []string { func getCreateQueueManagerArgs(mounts map[string]string, name string, devMode bool) []string {
// use "UserExternal" only if we are 9.2.0.1 or above.
mqVersion, _, err := command.Run("dspmqver", "-b", "-f", "2")
if err != nil {
log.Printf("Error Getting MQ version to find oa: %v", strings.TrimSuffix(string(mqVersion), "\n"))
}
oaVal := "user"
if mqVersion > "9.2.0.0" {
oaVal = "UserExternal"
}
//build args
args := []string{"-ii", "/etc/mqm/", "-ic", "/etc/mqm/", "-q", "-p", "1414"} args := []string{"-ii", "/etc/mqm/", "-ic", "/etc/mqm/", "-q", "-p", "1414"}
if devMode { if devMode {
args = append(args, "-oa", "user") args = append(args, "-oa", oaVal)
} }
if _, ok := mounts["/mnt/mqm-log"]; ok { if _, ok := mounts["/mnt/mqm-log"]; ok {
args = append(args, "-ld", "/mnt/mqm-log/log") args = append(args, "-ld", "/mnt/mqm-log/log")