3 #----------------------------------------------------------------------------------
5 # Copyright (c) 2018-2020 AT&T Intellectual Property.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 #---------------------------------------------------------------------------------
22 # ----------------------------------------------------------------------
23 # Mnemonic: container_start.sh
24 # Abstract: For some "pod" environments a single container is required.
25 # This starts all of the related processes which normally would
26 # be started in individual containers.
28 # There are environment variables which affect the operation
31 # GSLITE_ROOT -- Assumed to be the root directory for the
32 # core MC xAPP. If not defined, /mc/gs-lite is
35 # When NOT running in simulation mode, a registration message is
36 # sent to the xAPP manager via the registration script in /playpen.
37 # An unregister message is "queued" and should be sent when this
38 # script receives a terminating event, or exits normally.
40 # Date: 13 February 2019
41 # Author: E. Scott Daniels
42 # ----------------------------------------------------------------------
44 # MUST have a posix style function declaration!
46 trap - EXIT # prevent running this again when we force the exit
47 /playpen/bin/xam_register -U
53 FIFO_DIR="/tmp/mcl/fifos"
55 SIMULATOR_MODE=`python /mc/extract_params.py ${XAPP_DESCRIPTOR_PATH}/config-file.json simulator_mode`
56 RMR_PORT=`python /mc/extract_rmr_port.py ${XAPP_DESCRIPTOR_PATH}/config-file.json rmr-data`
60 if [ "$SIMULATOR_MODE" != "true" ]
62 # --- start "sidecars" first. They are expected to need /playpen as the working dir
66 if [ "$RMR_PORT" != "" ]
68 bin/mc_listener -p $RMR_PORT
72 ) >/tmp/listener.std 2>&1 &
74 echo "listener was started" >&2
76 trap 'unreg' EXIT 1 2 3 4 15 # unregister on exit/hup/quit/term
77 /playpen/bin/xam_register.sh # register the xapp now that listener is up
81 # ---- finally, start the core MC application -----------------------------
82 cd ${GSLITE_ROOT:-/mc/gs-lite}/demo/queries