fddc1de690ad87416c31ceb1d838bdff0e40bc51
[ric-app/mc.git] / sidecars / listener / help
1 #!/usr/bin/env bash
2 # vim: ts=4 sw=4 noet:
3 #----------------------------------------------------------------------------------
4 #
5 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
6 #
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
10 #
11 #          http://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19 #---------------------------------------------------------------------------------
20
21 # provide help from the docker run command:
22 #       docker run -it --rm <container-name> help
23
24
25 cat <<endKat
26
27 The mc_listener image
28
29 Listener
30 This image contains, as the primary application, the mc_listener. Simply 
31 running the image in a container will start the listener. 
32
33
34 Replay
35 The image also contains a replay binary which has the ability to read a
36 raw data capture (rdc) file generated by the listener, and to "replay"
37 the messages by writing them to the appropriate FIFOs in the same manner
38 as the mc_listener application.  This binary is run using the run_replay.sh
39 script, and can be piped the file from the native environment:
40
41   docker run -i --rm -v /var/lib/mc/listener:/var/lib/mc/listener run_replay.sh <data-file
42
43 Alternately, if multiple data files are to be given as input, something like
44 the following can be used:
45
46   cat MLCT_* | docker run -i --rm -v /var/lib/mc/listener:/var/lib/mc/listener run_replay.sh
47
48 where 'data-file' as the rdc data. The timestamps in the original data are
49 preserved, but there is no effort to simulate the rate; messages from the raw
50 data will be written to the FIFOs as fast as possible.  The directory that
51 the replay binary should write FIFOs to should be mounted (as the example is 
52 above). If an alternate path must be used, it must be supplied using the -d path
53 command line option to run_replay.sh.  
54
55 The replay script supports pre-creating the FIFOs either from a list of known
56 and/or expected message types, or by parsing the input file to determine the
57 types contained. Use the '-p' option on the run_replay script command line to
58 enable pre-creation, and -m "list" to supply a list of message types (e.g.
59 -m 1,2,3,10002).  
60
61 If coordination with a FIFO reader is needed, there are two options to delay
62 the start of the replay binary.  The '-g file' will cause the run script to
63 wait until the gate file "file" exists before starting the reader.  This pause
64 happens after FIFO creation if -p is given.  Additionally, a delay in seconds
65 can be given with the -D seconds command line option.  After creating FIFOs, 
66 and optionally waiting for the gate file, the script will delay an additional
67 number of seconds before starting the replay process.
68
69 endKat