|
15 | 15 | # limitations under the License.
|
16 | 16 |
|
17 | 17 | set -e
|
18 |
| - |
19 |
| -stop() |
20 |
| -{ |
21 |
| - endmqm $MQ_QMGR_NAME |
22 |
| -} |
23 |
| - |
24 |
| -parameterCheck() |
25 |
| -{ |
26 |
| - : ${MQ_QMGR_NAME?"ERROR: You need to set the MQ_QMGR_NAME environment variable"} |
27 |
| - |
28 |
| - # We want to do parameter checking early as then we can stop and error early before it looks |
29 |
| - # like everything is going to be ok (when it won't) |
30 |
| - if [ ! -z ${MQ_TLS_KEYSTORE+x} ]; then |
31 |
| - if [ -z ${MQ_TLS_PASSPHRASE+x} ]; then |
32 |
| - echo "Error: If you supply MQ_TLS_KEYSTORE, you must supply MQ_TLS_PASSPHRASE" |
33 |
| - exit 1; |
34 |
| - fi |
35 |
| - fi |
36 |
| -} |
37 |
| - |
38 |
| -config() |
39 |
| -{ |
40 |
| - # Populate and update the contents of /var/mqm - this is needed for |
41 |
| - # bind-mounted volumes, and also to migrate data from previous versions of MQ |
42 |
| - |
43 |
| - setup-var-mqm.sh |
44 |
| - |
45 |
| - if [ -z "${MQ_DISABLE_WEB_CONSOLE}" ]; then |
46 |
| - echo $MQ_ADMIN_PASSWORD |
47 |
| - # Start the web console, if it's been installed |
48 |
| - which strmqweb && setup-mqm-web.sh |
49 |
| - fi |
50 |
| - |
51 |
| - ls -l /var/mqm |
52 |
| - source /opt/mqm/bin/setmqenv -s |
53 |
| - echo "----------------------------------------" |
54 |
| - dspmqver |
55 |
| - echo "----------------------------------------" |
56 |
| - |
57 |
| - QMGR_EXISTS=`dspmq | grep ${MQ_QMGR_NAME} > /dev/null ; echo $?` |
58 |
| - if [ ${QMGR_EXISTS} -ne 0 ]; then |
59 |
| - echo "Checking filesystem..." |
60 |
| - amqmfsck /var/mqm |
61 |
| - echo "----------------------------------------" |
62 |
| - MQ_DEV=${MQ_DEV:-"true"} |
63 |
| - if [ "${MQ_DEV}" == "true" ]; then |
64 |
| - # Turns on early adopt if we're using Developer defaults |
65 |
| - export AMQ_EXTRA_QM_STANZAS=Channels:ChlauthEarlyAdopt=Y |
66 |
| - fi |
67 |
| - crtmqm -q ${MQ_QMGR_NAME} || true |
68 |
| - if [ ${MQ_QMGR_CMDLEVEL+x} ]; then |
69 |
| - # Enables the specified command level, then stops the queue manager |
70 |
| - strmqm -e CMDLEVEL=${MQ_QMGR_CMDLEVEL} || true |
71 |
| - fi |
72 |
| - echo "----------------------------------------" |
73 |
| - fi |
74 |
| - strmqm ${MQ_QMGR_NAME} |
75 |
| - |
76 |
| - # Turn off script failing here because of listeners failing the script |
77 |
| - set +e |
78 |
| - for MQSC_FILE in $(ls -v /etc/mqm/*.mqsc); do |
79 |
| - runmqsc ${MQ_QMGR_NAME} < ${MQSC_FILE} |
80 |
| - done |
81 |
| - set -e |
82 |
| - |
83 |
| - echo "----------------------------------------" |
84 |
| - mq-dev-config.sh ${MQ_QMGR_NAME} |
85 |
| - echo "----------------------------------------" |
86 |
| -} |
87 |
| - |
88 |
| -state() |
89 |
| -{ |
90 |
| - dspmq -n -m ${MQ_QMGR_NAME} | awk -F '[()]' '{ print $4 }' |
91 |
| -} |
92 |
| - |
93 |
| -monitor() |
94 |
| -{ |
95 |
| - # Loop until "dspmq" says the queue manager is running |
96 |
| - until [ "`state`" == "RUNNING" ]; do |
97 |
| - sleep 1 |
98 |
| - done |
99 |
| - dspmq |
100 |
| - |
101 |
| - echo "IBM MQ Queue Manager ${MQ_QMGR_NAME} is now fully running" |
102 |
| - |
103 |
| - # Loop until "dspmq" says the queue manager is not running any more |
104 |
| - until [ "`state`" != "RUNNING" ]; do |
105 |
| - sleep 5 |
106 |
| - done |
107 |
| - |
108 |
| - # Wait until queue manager has ended before exiting |
109 |
| - while true; do |
110 |
| - STATE=`state` |
111 |
| - case "$STATE" in |
112 |
| - ENDED*) break;; |
113 |
| - *) ;; |
114 |
| - esac |
115 |
| - sleep 1 |
116 |
| - done |
117 |
| - dspmq |
118 |
| -} |
119 |
| - |
120 | 18 | mq-license-check.sh
|
121 |
| -parameterCheck |
122 |
| -config |
123 |
| -trap stop SIGTERM SIGINT |
124 |
| -monitor |
| 19 | +echo "----------------------------------------" |
| 20 | +mq-parameter-check.sh |
| 21 | +echo "----------------------------------------" |
| 22 | +setup-var-mqm.sh |
| 23 | +echo "----------------------------------------" |
| 24 | +which strmqweb && setup-mqm-web.sh |
| 25 | +echo "----------------------------------------" |
| 26 | +mq-pre-create-setup.sh |
| 27 | +echo "----------------------------------------" |
| 28 | +mq-create-qmgr.sh |
| 29 | +echo "----------------------------------------" |
| 30 | +mq-start-qmgr.sh |
| 31 | +echo "----------------------------------------" |
| 32 | +mq-configure-qmgr.sh |
| 33 | +echo "----------------------------------------" |
| 34 | +mq-dev-config.sh |
| 35 | +echo "----------------------------------------" |
| 36 | +exec mq-monitor-qmgr.sh |
0 commit comments