You are on page 1of 46

Author: Dorian Faucon

Document Revision: Version 004


Revision Date: 24 January 2013

Training Exercise Book

Training Exercise Book


Also known as: The Little Blue Cook Book

Author & Function Email


Dorian Faucon
dorian.faucon@thalesgroup.com
Commissioning & Training Engineer

General Note
The reader should know before reading that this Training Exercise Book is an additional document to the training and
has for aim to assist the customer in his practical training. Last but not least, this document is more a personal
reminder than a real and official document.

History of the document


Date Vers. Information
12/10/2010 001 Creation of the document (from ADS-B base version 004)
10/02/2011 002 Additions to Exercise XV
25/09/2012 003 Addition of Chapter 5
24/02/2013 004 Additional explanations and minor corrections

1
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

TRAINING EXERCISE BOOK.....................................................................................................................................1


GENERAL NOTE..............................................................................................................................................................1
HISTORY OF THE DOCUMENT..........................................................................................................................................1
SHORT LIST OF LINUX COMMANDS.................................................................................................................................3
CHAPTER 1: LINUX EXERCISES.......................................................................................................................................4
Exercise I. Navigating inside the terminal...........................................................................................................4
Exercise II. File Creation / Copy / Move / Remove...............................................................................................4
Exercise III. Directory Creation / Copy / Move / Remove.....................................................................................4
Exercise IV. File Editing / Content checking..........................................................................................................5
Exercise V. Tail, pipe and grep tool & Appending information to a file...............................................................5
Exercise VI. Linking Files.......................................................................................................................................6
Exercise VII. Networking and access rights...........................................................................................................7
Exercise VIII. Secure Shell operations...................................................................................................................8
Exercise IX. File rights and building a script.........................................................................................................9
Exercise X. Variables...........................................................................................................................................10
Exercise XI. Mounting a USB stick, mounting an ISO, unmounting....................................................................10
Exercise XII. Using aliases, editing aliases..........................................................................................................11
CHAPTER 2: SOLUTIONS TO THE LINUX EXERCISES.....................................................................................................12
Exercise I. Navigating inside the terminal.........................................................................................................12
Exercise II. Directory Creation / Copy / Move / Remove....................................................................................13
Exercise III. File Creation / Copy / Move / Remove.............................................................................................14
Exercise IV. Editing / Content checking...............................................................................................................14
Exercise V. Tail, pipe tool & Appending information to a file............................................................................15
Exercise VI. Linking Files.....................................................................................................................................16
Exercise VII. Networking......................................................................................................................................17
Exercise VIII. Secure Shell operations.................................................................................................................20
Exercise IX. File rights and building a script.......................................................................................................21
Exercise X. Variables...........................................................................................................................................24
Exercise XI. Mounting a USB stick or CD, mounting an ISO, unmounting.........................................................26
Exercise XII. Using aliases, editing aliases..........................................................................................................27
SHORT LIST OF GROUND STATION COMMANDS (MAGS VERSION)..............................................................................29
CHAPTER 3: GROUND STATION EXERCISES..................................................................................................................29
Exercise XIII. Local configuration.......................................................................................................................29
Exercise XIV. Changing the IP configuration with LCMS...................................................................................29
Exercise XV. Save a configuration from remote, through a script.......................................................................30
Exercise XVI. Starting / Stopping the ground station service..............................................................................30
Exercise XVII. Seeing the data stream on the ground station..............................................................................30
Exercise XVIII. Configuring the output of the GS................................................................................................31
CHAPTER 4: SOLUTIONS TO GROUND STATION EXERCISES.........................................................................................32
Exercise XIII. Local configuration.......................................................................................................................32
Exercise XIV. Changing the IP configuration with LCMS...................................................................................34
Exercise XV. Save a configuration from remote, through a script.......................................................................36
Exercise XVI. Starting / Stopping the ground station service..............................................................................38
Exercise XVII. Seeing the data stream on the ground station..............................................................................39
CHAPTER 5: REMOTE CONTROL & MONITORING SYSTEM (RCMS) TOOLS................................................................41
Exercise XVIII. Recording Tool............................................................................................................................41
Exercise XIX. Technical Situation Display (TSD)................................................................................................41
Exercise XX. Replay Tool.....................................................................................................................................42
Exercise XXI. Replaying data into the Technical Situation Display....................................................................42
Exercise XXII. Master Technical System Control (MTSC)..................................................................................43
Exercise XXIII. MAGS Configurator....................................................................................................................43
Exercise XXIV. User Configuration for MTSC.....................................................................................................43
Exercise XXV. Access Control for MTSC.............................................................................................................44
Exercise XXVI. Log files – CPS & RCMS............................................................................................................44
Exercise XXVII. CMS Cluster redundancy...........................................................................................................45

2
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Short list of Linux commands


alias Creates a shortcut for commands
cal Display calendar
cat Concatenate and print (display) the content of file(s)
cd Change directory
chmod Change access permissions
chown Change file owner and group
clear Clear terminal screen
cp Copy one or more files to another location
date Display or change the date & time
df Display free disk space
diff Display the differences between two files
dir Briefly list directory contents
dmesg Print kernel & driver messages
echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject a removable media
exit Exit the shell
fgrep Search file(s) for lines that match a fixed string
find Search for files that meet a desired criteria
grep Search file(s) for lines that match a given pattern
head Output the first part of file(s)
help Display help for a built-in command
history Command that calls the history of commands used by current user
hostname Print or set system name
ifconfig Configure a network interface
ifdown Stop a network interface
ifup Start a network interface
kill Stop a process from running
less Display output one screen at a time
ln Make links between files
ls List information about file(s)
man Help manual
mkdir Create new folder(s)
more Display output one screen at a time
mount Mount a file system
mv Move or rename files or directories
passwd Modify a user password
ping Test a network connection
ps Process status
pwd Print working directory
reboot Reboot the system
rm Remove file(s)
scp Secure copy (remote file copy)
ssh Secure Shell client (remote login program)
su Substitute user identity
tail Output the last part of files
tar Tape Archiver (file compressor/archiver)
touch Change file timestamps
traceroute Trace Route to Host
umount Unmount a device
unalias Remove an alias
uname Print system information
vi Text Editor
wc Print byte, word and line counts
who Print all usernames currently logged in

3
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

whoami Print the current user id and name

4
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Chapter 1: Linux Exercises

Exercise I. Navigating inside the terminal


Difficulty:  (one fox!)
HINT: Commands/tools that can be used during this exercise: cd, ls, pwd, man, info
1. Open a terminal and through command lines, navigate to the location /usr/local/etc/<customer>/<project>.
2. Once in this directory, show the content of the current directory, of the parent directory and of /usr/local/etc
3. Navigate to the directory /tmp
4. Navigate to the home directory of the current user.
5. Check in which current directory you are located

Exercise II. File Creation / Copy / Move / Remove


Difficulty: 
HINT: Commands/tools that can be used during this exercise: cd, ls, touch, cp, mv, rm, man, info
1. Navigate to /tmp
2. Create an empty file named “creation-file”
3. Check content of /tmp to see if “creation-file” was created
4. Copy this file to the current location and name it “copied-file”
5. Check content of /tmp
6. Move this file to the current location and rename it “moved-file”
7. Remove “moved-file” in /tmp and do not remove “creation-file”

Exercise III. Directory Creation / Copy / Move / Remove


Difficulty: 
HINT: Commands/tools that can be used during this exercise: cd, ls, cp, mv, rm, mkdir, man, info
1. Navigate to the home directory
2. Create a directory in home directory of the current user and name it “blue”.
3. Move the directory “blue” to /tmp and rename it “red”
4. Move “creation-file” from /tmp to /tmp/red
5. Move the directory “red” to the home directory and rename it “green”
6. Check the content of the “green” directory
7. Copy the “green” directory to /tmp and name it “orange”
8. Check the content of the “orange” directory
9. Remove the “green” directory

5
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise IV. File Editing / Content checking


Difficulty: 
HINT: Commands/tools that can be used during this exercise: cd, more, less, vi, nedit, man, info
1. Navigate to “orange” directory.
2. Open “creation-file” with the vi tool, edit the file to add any message you’d like inside
3. Save and quit the vi application
4. Open “creation-file” with the nedit tool, edit the file and add two extra lines. One of the lines must contain the
word “target”
5. Save and quit the nedit application
6. Without opening the vi or the nedit application, show the content of the “creation-file”

The most common command line editor is "vi". Start vi from the command line. vi has two modes, one editing mode
and other mode in which you can move within the file. To start editing the file use "i". Once you want to save: press
the Esc key (escape button) and write ":wq". If you want to exit without saving use ":q!".

Other common vi commands are:


:wq Write & quit o Add line after dd Delete line /exp Find expression
:set number Show line number O Add line before Ndd Delete N lines n Next occurrence
:wq! Force write & quit p Paste after yy Copy line <Esc> Quit mode
i Insert P Paste before Nyy Copy N lines R Replace
u Undo

Exercise V. Tail, pipe and grep tool & Appending information to a file
Difficulty: 
HINT: Commands/tools that can be used during this exercise: cd, tail, echo, more, less, vi, nedit, grep, man, info
1. Navigate to the “orange” directory and using the grep command, search the “creation-file” for the word (or
pattern) “target”.
2. Using the command in step 1 and the “>” symbol, create a new document called “create.txt”
3. Read the content of “create.txt”
4. Using the command in step 1 and the “>>” symbol, append the result in “create.txt”
5. Read the content of “create.txt”. As you can notice, the “>” symbol creates and replaces any former file and the
“>>” symbol appends (or adds) any new information at the end of the file instead of replacing any former
content.
6. Read the last content of “create.txt” using “tail” with the follow option.
7. Open a second terminal window, navigate to “orange” and type: echo ‘Hello Target’.
8. Repeat step 7 but this time append the result in the “create.txt” file
9. Return to the first terminal, check for any new material. Cancel the tail command with Ctrl + C.
10. Using the command in step 6 and using the pipe symbol “ | ” as well as the command “grep”, search for the
word/pattern “target”.
11. Return to the second terminal; type: echo ‘Hello TarGEt’ >> create.txt.
12. Return to the first terminal; check any output. Cancel the tail command with Ctrl + C.
13. Use the command in step 10 but add an option to grep so that his search becomes non-case sensitive.
14. Repeat step 11.
15. Return to the first terminal and check for any output. Cancel the tail command with Ctrl + C.
16. Read the complete content of “create.txt”

6
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise VI. Linking Files


Difficulty: 
HINT: Commands/tools that can be used during this exercise: cd, ls, ln, mkdir, mv, man, info
1. Navigate to /tmp
2. Check the content of the /tmp directory and make sure the “orange” directory is there
3. Make a direct link with symbolic option, located in /tmp, to the “create.txt” in the “orange” directory.
4. Check the detailed content of the /tmp directory to see the path of your link
5. Repeat step 3 but name “link2” your second direct link with symbolic option
6. Repeat step 4.
7. Make a relative link with symbolic link, located in /tmp, to the “create.txt” in the “orange” directory, name it
“link3”
8. Repeat step 4.
9. Create a new directory in /tmp and name it “green”
10. Move your three links (and just the links !) to /tmp/green
11. Check the detailed content of the /tmp/green directory to see the path of your three links.
12. Move the /tmp/orange directory to /tmp/green
13. Repeat step 11.
14. Force overwrite the direct link so that he now shows the correct path
15. Repeat step 11.

7
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise VII. Networking and access rights


Difficulty: 
HINT: Commands/tools of this exercise: ls, system-config-network, more, less, vi, nedit ifconfig, ifup, ifdown, su,
man, info
1. Type in the terminal: system-config-network. You will be asked to give the root password of the system.
2. A graphical interface will open to let you reconfigure each interface (eth0, 1, 2 etc…)
3. Select eth0 and open it’s properties by click on the Edit button or double-clicking on the eth0 line. Here you
can change IP, mask and gateway of the interface. Note that you can also choose DHCP if needed.
4. Press Ok when finished. The changes are recorded and will be taken into account on the next reboot of the
Network Daemon.
5. To reboot the Network Daemon, keep the eth0 selected and press De-activate button. Once the operation is
done, press the Activate button. You should now be on the newly configured IP.
6. Quit the graphical interface window.
7. In the terminal, you can call many other graphical interfaces if necessary, simply type: “system-config-”, do not
press Enter but twice the Tabulation key. You will see all available tools.
8. In the terminal, type “/sbin/ifconfig”. Make sure that the changes made in the graphical interface are correct.
9. Using “/sbin/ifconfig”, try to change the IP address of eth0 to 10.10.10.45. If the syntax of your command is
correct, you should receive a “Permission denied” notification.
10. With the use of the command “su – root”, login as the root user after giving in the password of the root user.
11. Try the command used in step 8.
12. Repeat step 8. Note that this change is only temporary and will cease to be valid next time the Network
Daemon restarts.
13. Now let’s try to do the same exercise of permanently changing the IP to 10.10.10.45 without using the
graphical interface. Navigate to /etc/sysconfig/network-scripts/ and read the content of the directory.
14. Read the content of the file “ifcfg-eth0”
15. Read the content of the file “route-eth0”
16. Read the content of the file named “network” in the parent directory where you are currently located
17. Copy all three files to /tmp as safety measure for this exercise. They will serve as backup files.
18. Edit the files that need to be edited (in /etc/sysconfig/network-scripts/) in order to make the change to
10.10.10.45 active at the next reboot of the Network Daemon
19. Try all three possible methods to restart the Network Daemon:
a. “/sbin/ifdown <target interface>” followed by “/sbin/ifup <target interface>” (replace <target interface>
with the wished interface that needs to be restarted. Check with “/sbin/ifconfig”.
b. “/etc/init.d/network <cmd>” and replace <cmd> with the correct value (start, stop, restart, status). Check
with “/sbin/ifconfig”.
c. “/sbin/service network <cmd>” and replace <cmd> with the correct value (start, stop, restart, status).
Check with “/sbin/ifconfig”.
20. Repeat steps 18 and 19 until you have correctly configured the network.
21. Type “exit” to quit the root session.

8
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise VIII. Secure Shell operations


Difficulty: 
HINT: Commands/tools of this exercise: ls, more, less, echo, vi, nedit, su, ssh, scp, man, info
1. For this exercise, you will:
a. Either need a remote unit (another RCMS, a GS, etc…). Find out what the IP of this remote machine is and
place your own machine in the same network.
b. Or have to use your local machine as “virtual” remote unit. Use IP 127.0.0.1 in this case.
2. Read the content of the file “/etc/hosts” and check if this IP is already known by the system under one or more
synonyms. If not, log in as root, open /etc/hosts and add the IP’s machine with a synonym (for example:
machine)
3. Type “ping –c4 –w10 <IP @ of the target machine>” and replace <IP @ of the target machine> with the IP of
the foreign machine.
4. Type “ping –c4 –w10 <synonym of the target machine>” and replace <synonym of the target machine> with
the synonym of the foreign machine found in /etc/hosts.
5. If the ping activities have been successful (if not, your machines are not connected, check network
configuration & cabling), you are now able to proceed with the Secure Shell operations. Type “ssh
<user>@<IP @ or synonym>” and replace the two < … > fields with appropriate input. You will now be
prompted to build an RSA key and then enter the password of the user on the foreign machine.
6. You are now logged in on the foreign machine and can operate as if you were on your local machine. Check
the content of the / directory for example.
7. Create an empty file named “transfer” in /tmp of the foreign machine.
8. Type “exit” to return to your current machine.
9. You will now try, with the use of the “scp” command (secure copy), to retrieve the “transfer” file located in
the /tmp of the foreign machine and place it on your local machine in the home directory of your current user.
10. Check the content of your home directory to see if “transfer” is present.
11. Type: ssh <user>@<IP @ or synonym> “echo ‘Hello from far far away’ > /tmp/transfer”
12. Repeat step 9 but rename the copied file to transfer2
13. Check the content of “transfer2” in your home directory.

9
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise IX. File rights and building a script


Difficulty: 
HINT: Commands/tools of this exercise: ls, more, less, vi, nedit, su, chmod, chown, man, info
1. Navigate to /tmp and read the content of the directory. There should be a directory “green”
2. Ask for a detailed read of the /tmp directory as well as the content of the /tmp/green directory
3. A format of 10 values are printed first:
a. the first value signals if the file is a regular data ( - ), a directory ( d ), a symbolical link ( l ), or a possible 5
others that are very rarely seen: p (named pipe), S (socket), D (door), b (block oriented machine data), c
(sign oriented machine data).
b. The next values come in groups of three, the first being the “owner” rights: the first of three values
designated if the “user” is allowed to read the file (r if yes, - if no), to write in this file (w if yes, - if no) and
to execute this file (x if yes, - if no)
c. The second group of three signals the “group” rights, same as b. All users who are not the owner of the file
but are contained in the same group as the file will have these rights.
d. The third group of three signals the “others” rights, same as b. All users who are neither user nor group
member have these rights.

lrwxrwxrwx 1 supervisor users 17 Jul 25 12:24 create.txt -> orange/create.txt


drwxr-xr-x 2 supervisor users 4096 Jul 25 12:22 green
drwx------ 2 root root 4096 Jul 25 09:52 old
-rw-r--r-- 1 roger users 267 Jul 24 18:42 poster.txt
-rw-r--r-- 1 roger users 267 Jul 24 18:42 strawberry

Data Type File Owner File Group Last modified File Name

Rights Link Counter File Size

4. To build a script, you first need to create an empty file where you will type in your commands. Name it
“script.sh”
5. Open this file with either nedit or vi, and type the following lines:

#! /bin/ksh
#Author : Zorro
#Date : 25/08/2011
#Filename : script.sh

echo “Hello Zorro !”

6. Lines starting with the “ # ” symbol will not be executed and are just hidden comment lines for an eventual file
reader. To launch this script, you will need to give the correct execution rights to your file (give at least the
execution right to the owner of the file). You can use the “chmod” command and the “ls” with the detailed
option to check that the rights were correctly taken into account
7. Once the execution rights are given to your script, you can type, if you are in /tmp, the line “./script.sh” or if
you have navigated elsewhere, use a direct or relative path as follows “/tmp/script.sh” or “../script.sh” etc etc…
8. Log in as root user and change the owner of your script to “root” and the file group to “supervisor” by using the
“chown” command. Do the same with the “green” directory and all the files contained in “green”. Check with
a detailed “ls” that the change has been made.
9. Revert to the former owner and file group.
10. Type “exit” to log-out from root user.
11. Edit your script so that it will now automatically create in /tmp a “red” directory, containing a “blue.sh” script
with execution rights for it’s owner.
12. Run your script and check with a detailed “ls” if the “blue.sh” and “red” have been correctly created.

10
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise X. Variables

$1 - $9 Positional parameter from 1 to 9 $$ Process number of this shell


Process ID of the last command run in the
$0 Name of the currently executed command $!
background
${n} Other positional parameter (named n) $- Current options supplied to the shell
Number of positional arguments given to the All arguments given to the shell, starting from
$# $*
invocated shell $1
$? Exit status of last command (if 0, all is OK) $@ Same as $*, except when quoted

Difficulty: 
HINT: Commands/tools of this exercise: ls, vi, nedit, cat, chmod, man, pwd, date, info
1. Navigate to /tmp and copy “script.sh” to “zorro.sh”
2. Make sure that “zorro.sh” still has execution rights
3. Modify “zorro.sh” to contain the following:

#! /bin/ksh
#Author : Zorro
#Date : 25/08/2011
#Filename : zorro.sh

echo “Hello Zorro !”


answer=”Hello there, Sergeant Garcia!”
echo $answer

echo “My script is called $0”


echo “My first argument (\$1) is $1”
echo “My second argument (\$2) is $2”
echo “I have received as input a total of $# arguments”
echo “My fourth argument (\$4) is with a default value ${4-:defaultValue}”
echo “Here was the complete list of arguments received: $*”

4. Type “./zorro.sh red green blue”


5. Type “./zorro.sh red green blue yellow”
6. Create a “generate-script.sh” that will automatically generate a script named after the first variable, with
comments as header of file with Author, Date and Filename automatically filed, and with execution rights for
the owner of the file.

Exercise XI. Mounting a USB stick, mounting an ISO, unmounting.


Difficulty: 
HINT: Commands/tools of this exercise: ls, dmesg, mount, umount, su, mkdir, rm, man, info
1. The first method to mounting an element is the graphical way. Please insert a USB stick or a CD into the
machine and wait for an icon to appear on the desktop.
2. Using the mouse, right click on the new icon and click on “Mount Volume”
3. Double click on the File System icon and navigate to the “media” directory. Enter, you will find a new
directory with the name of your media (CD name, USB name, etc…). You can now use the files (with the file
manager, or by accessing in with the terminal through /media/<name of your media>/
4. To unmount this volume, exit all windows and applications using files from your media, the right click on the
icon and click on “Unmount Volume”.
5. To achieve the same result with a terminal, please log in as root user in the terminal.
6. Type “ls /media” and check content of the directory.
7. Create a new directory in /media called “test”
8. If you inserted a CD-ROM, skip this step. If you inserted a USB stick, type “dmesg | grep sd” and look for a
line that can look like “ sdb: sdb1”. The last value that looks like sda1, sdb1, sdc1, sda2, sdb2, sdc2 etc is the
correct media. (Note that the function “fdisk –l” also may achieve this purpose)

11
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

9. In the terminal, type “mount /dev/cdrom /media/test” if you inserted a CD-ROM or “mount /dev/<sdXX>
/media/test” if you inserted a USB (replace XX with the last values found in the dmesg command).
10. Navigate to /media/test and check it’s content.
11. Navigate to another directory outside of /media/test and exit all applications using files in /media/test
12. Type “umount /media/test” to unmount the volume. Now check the content of /media/test
13. To mount a virtual image (such as an ISO file), let’s assume you have a test.iso located in /tmp. You must then
type “mount –o loop /tmp/test.iso /media/test” instead of “mount /dev/cdrom /media/test”.
14. Navigate to /tmp/test and check content.
15. Unmount the virtual image from /media/test.
16. Create new directories “test2” and “test3” in /media and mount in “test” a CD-ROM, in “test2” an USB and in
“test3” an ISO image.
17. Check content of all three locations
18. Unmount all three locations and check that all three directories are now empty
19. Remove all three empty directories
20. Type “exit” to log-out from the root user.

Exercise XII. Using aliases, editing aliases


Difficulty: 
HINT: Commands/tools of this exercise: ls, vi, nedit, touch, chmod, date, man, info
1. Navigate to the home directory of your current user
2. Read the content of the current directory
3. Read the hidden content of the current directory
4. Read the content of the file “.bashrc”
5. Open “.bashrc” and make an alias of your own, called “reader” that will change the rights of a file to read only
for all users
6. Save & quit your application
7. Quit your current terminal
8. Open a new terminal
9. Create a “dummy” file (empty) and check it’s current rights
10. Use the “reader” command on “dummy” and check it’s rights
11. Make a new alias called “watchTime” that will give you the current clock time.
12. Make a new alias of your own
13. Repeat steps 7 and 8
14. Try your two new aliases
15. Log in as root user, try your aliases. Check the content of the “.bashrc” file.
16. Log out.

12
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Chapter 2: Solutions to the Linux Exercises

Exercise I. Navigating inside the terminal


Short Explanation
For each command, you can first call the manual pages concerning the command to understand it’s usage. To do this,
simply type “man <name of the command>” or “info <name of the command>”. For example: “man cd” or “info cd”
to read how to use the cd command (cd stands for change directory).

The Linux tree structure is in many respects the same as the windows tree structure. Instead of C:\ as starting point of
the tree, Linux uses / (called “root” of the tree structure) as starting point.

To navigate through the directories, one can use direct or relative navigation. Direct navigation implies using the full
path of the location. For example: to move to a location in /usr/local/etc from anywhere in the system, you would have
to use “cd /usr/local/etc” as a direct link.
Relative navigation implies moving from your current position to this new position. For example: you are located
in /usr/local/etc/orange and want to navigate to /usr/local/etc, you will then use the command “cd ..” which is the
shortcut implying “move to my parent directory”.

Shortcuts are:
Exactly where I am (Linux replaces . with the value The home directory of my current user (example:
. ~
from the pwd command) user is supervisor, directory is /home/supervisor)
The directory directly before my current location, Root directory – this is the starting point of the tree
.. /
also known as the parent directory architecture

Example of terminal output while doing exercise 1:

[supervisor@rcms /]$ cd /usr/local/etc/cats/cambodia/


[supervisor@rcms cambodia]$ pwd
/usr/local/etc/cats/cambodia/
[supervisor@rcms cambodia]$ ls .
config.xml display-cambodia.xml hosts
[supervisor@rcms cambodia]$ ls ..
cambodia
[supervisor@rcms cambodia]$ ls ../..
cats recordasxcat10.cfg recordasxcat23.cfg replayasxcat20.cfg
config.xml recordasxcat19.cfg recordraw.cfg replayasxcat21.cfg
default recordasxcat20.cfg replayasxcat10.cfg replayasxcat23.cfg
display.xml recordasxcat21.cfg replayasxcat19.cfg replayraw.cfg
[supervisor@rcms cambodia]$ ls /usr/local/etc/
cats recordasxcat10.cfg recordasxcat23.cfg replayasxcat20.cfg
config.xml recordasxcat19.cfg recordraw.cfg replayasxcat21.cfg
default recordasxcat20.cfg replayasxcat10.cfg replayasxcat23.cfg
display.xml recordasxcat21.cfg replayasxcat19.cfg replayraw.cfg
[supervisor@rcms cambodia]$ cd /tmp
[supervisor@rcms tmp]$ pwd
/tmp
[supervisor@rcms tmp]$ cd ~
[supervisor@rcms ~]$ pwd
/home/supervisor

13
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XIII. Directory Creation / Copy / Move / Remove


Short Explanation
Command lines generally have the following structure:
Command –(a serie of options) [Source file…] [Target file]
The commands will execute it’s function with those given parameters. For some commands (see their manual pages
for details), some fields are considered mandatory, some optional.. For example, the touch command only needs a
target file as mandatory field; but the mv command needs one or more source files and only one destination.

The touch command is used to change the time stamp (or last modification date) of a file. When no file exists, touch
will create an empty file with a time stamp.
The cp command will copy one or more files from their location to a target destination.
The mv command will move one or more files from their location to a target destination.
The rm command will remove one or more files from their location.

Example of terminal output while doing exercise 2:

[supervisor@rcms /]$ cd /tmp


[supervisor@rcms tmp]$ touch creation-file
[supervisor@rcms tmp]$ ls
creation-file
[supervisor@rcms tmp]$ cp creation-file copied-file
[supervisor@rcms tmp]$ ls
copied-file creation-file
[supervisor@rcms tmp]$ mv copied-file moved-file
[supervisor@rcms tmp]$ ls
creation-file moved-file
[supervisor@rcms tmp]$ rm moved-file
[supervisor@rcms tmp]$ ls
creation-file

14
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XIV. File Creation / Copy / Move / Remove


Short Explanation
The difficulty here is that when you want to copy or remove a directory containing numerous files, Linux needs the
correct authorization to do such an operation. The limitation is the following:
- if you copy a directory, does this mean that every file in the directory should also be copied ?
- if you remove a directory, does this mean that every file in the directory should also be removed ?
If the answer is yes, Linux must apply the same command to every file contained in the directory as well, and this as a
background operation.
To answer this specific question, the commands need to have the recursive option enabled, otherwise they will refuse
to operate on a directory. This means that the order (i.e. recursive option) given to the directory will also be impacted
on any sub-directory or file and therefore enable Linux to change the complete directory and it’s content.

Example of terminal output while doing exercise 3:

[supervisor@rcms /]$ cd ~
[supervisor@rcms ~]$ mkdir blue
[supervisor@rcms ~]$ ls .
blue Desktop exercises
[supervisor@rcms ~]$ mv blue /tmp/red
[supervisor@rcms ~]$ mv /tmp/creation-file /tmp/red/
[supervisor@rcms ~]$ mv /tmp/red ~/green
[supervisor@rcms ~]$ ls
Desktop exercises green
[supervisor@rcms ~]$ ls /tmp

[supervisor@rcms ~]$ ls green/


creation-file
[supervisor@rcms ~]$ cp -r green /tmp/orange
[supervisor@rcms ~]$ ls /tmp/orange/
creation-file
[supervisor@rcms ~]$ rm -r green
[supervisor@rcms ~]$ ls
Desktop exercises
[supervisor@rcms ~]$ ls /tmp
orange
[supervisor@rcms ~]$ ls /tmp/orange/
creation-file

Exercise XV. Editing / Content checking


Example of terminal output while doing exercise 4:

[supervisor@rcms ~]$ cd /tmp/orange/


[supervisor@rcms orange]$ vi creation-file
[supervisor@rcms orange]$ more creation-file
Hello World!
[supervisor@rcms orange]$ nedit creation-file
nedit: the current locale is utf8 (en_GB.UTF-8)
nedit: changed locale to non-utf8 (en_GB)
NEdit: Converting .nedit file to 5.5 version.
To keep, use Preferences -> Save Defaults
[supervisor@rcms orange]$ more creation-file
Hello World!
Line 1
Line 2 with the word target
[supervisor@rcms orange]$ less creation-file

15
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

16
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XVI. Tail, pipe tool & Appending information to a file


Short Explanation
The grep function is a search word function. If the wished word is found, it will output the complete line containing
this word.
The tail function (similar to the head function) is a function that follows the end of a file content dynamically if the
follow option is enabled (header would follow the beginning of a file). This means if an additional line appears at the
end of a file, this will be noticed by the function and shown in the terminal. You can of course use the tail function
without the follow option and it’s output will no longer by dynamic.
The combination of the tail and grep functions through the pipe “ | ” symbol is done by allocating a common
communication channel (represented by the pipe) where both functions can simultaneously work. The pipe symbol
can be used to combine many commands, at will of the user.

Example of terminal output while doing exercise 5:

Terminal 1 Terminal 2
[supervisor@rcms /]$ cd /tmp/orange/
[supervisor@rcms orange]$ grep target creation-file
Line 2 with the word target
[supervisor@rcms orange]$ grep target creation-file >
create.txt
[supervisor@rcms orange]$ ls
create.txt creation-file
[supervisor@rcms orange]$ more create.txt
Line 2 with the word target
[supervisor@rcms orange]$ grep target creation-file
>> create.txt
[supervisor@rcms orange]$ more create.txt
Line 2 with the word target
Line 2 with the word target
[supervisor@rcms orange]$ tail -f create.txt [supervisor@rcms /]$ cd /tmp/orange/
Line 2 with the word target [supervisor@rcms orange]$ echo 'Hello Target'
Line 2 with the word target Hello Target
Hello Target [supervisor@rcms orange]$ echo 'Hello Target' >>
create.txt

[supervisor@rcms orange]$ tail -f create.txt | grep


target
Line 2 with the word target
Line 2 with the word target [supervisor@rcms orange]$ echo 'Hello TarGEt' >>
create.txt
[supervisor@rcms orange]$ tail -f create.txt | grep -i
target
Line 2 with the word target
Line 2 with the word target
Hello Target
Hello TarGEt [supervisor@rcms orange]$ echo 'Hello TarGEt' >>
Hello TarGEt create.txt

[supervisor@rcms orange]$ more create.txt


Line 2 with the word target
Line 2 with the word target
Hello Target
Hello TarGEt
Hello TarGEt
[supervisor@rcms orange]$

17
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XVII. Linking Files


Short Explanation
This exercise makes use of relative and direct linking, as talked about in previous exercise 1. The ln command is a
link creation command. It most often needs the symbolic option to work properly and the force option to overwrite an
existing link.

Example of terminal output while doing exercise 6:

[supervisor@rcms orange]$ cd /tmp


[supervisor@rcms tmp]$ ls
orange
[supervisor@rcms tmp]$ ln -s /tmp/orange/create.txt
[supervisor@rcms tmp]$ ls -l
total 4
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 create.txt -> /tmp/orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms tmp]$ ln -s /tmp/orange/create.txt link2
[supervisor@rcms tmp]$ ls -l
total 4
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 create.txt -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 link2 -> /tmp/orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms tmp]$ ln -s orange/create.txt link3
[supervisor@rcms tmp]$ ls -l
total 4
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 create.txt -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 link2 -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 17 Jul 28 13:20 link3 -> orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms tmp]$ mkdir green
[supervisor@rcms tmp]$ man cp
[supervisor@rcms tmp]$ man mv
[supervisor@rcms tmp]$ mv create.txt link2 link3 /tmp/green/
[supervisor@rcms tmp]$ ls -l green/
total 0
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 create.txt -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 link2 -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 17 Jul 28 13:20 link3 -> orange/create.txt
[supervisor@rcms tmp]$ mv /tmp/orange/ /tmp/green/
[supervisor@rcms tmp]$ ls -l green/
total 4
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 create.txt -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 22 Jul 28 13:20 link2 -> /tmp/orange/create.txt
lrwxrwxrwx 1 supervisor users 17 Jul 28 13:20 link3 -> orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms tmp]$ ln -sf /tmp/green/orange/create.txt green/create.txt
[supervisor@rcms tmp]$ cd green/
[supervisor@rcms green]$ ln -sf /tmp/green/orange/create.txt link2
[supervisor@rcms green]$ ls -l
total 4
lrwxrwxrwx 1 supervisor users 28 Jul 28 13:24 create.txt -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 supervisor users 28 Jul 28 13:24 link2 -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 supervisor users 17 Jul 28 13:20 link3 -> orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms green]$

18
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XVIII. Networking


Short Explanation:
Networking is quite a subtle issue. For this, it is strongly recommended to read more extensive documentation on the
Internet. Here is a basic diagram to summarize the most common issue encountered: PC1 tries to talk to PC2, both on
different networks separated by a router.

Network 1 Router Network 2


PC1 192.168.24.0/2 149.204.17.0/2 PC2
.10 4 .254 .94 4 .15

PC1 should have a route to PC2 with the address and mask 149.204.17.0/24 through the gateway 192.168.24.254
PC2 should have a route to PC1 with address and mask 192.168.24.0/24 through the gateway 149.204.17.94

Example of terminal output while doing exercise 7:

[supervisor@rcms green]$ system-config-network


[supervisor@rcms green]$ system-config-
system-config-authentication system-config-printer
system-config-date system-config-rootpassword
system-config-display system-config-securitylevel
system-config-keyboard system-config-securitylevel-tui
system-config-language system-config-services
system-config-lvm system-config-soundcard
system-config-network system-config-time
system-config-network-cmd system-config-users
[supervisor@rcms green]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:9E:FF:25
inet addr:192.168.24.4 Bcast:192.168.24.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe9e:ff25/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:39129 errors:0 dropped:0 overruns:0 frame:0
TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3389179 (3.2 MiB) TX bytes:7384 (7.2 KiB)
Base address:0xd010 Memory:f0000000-f0020000

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1768 errors:0 dropped:0 overruns:0 frame:0
TX packets:1768 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4722864 (4.5 MiB) TX bytes:4722864 (4.5 MiB)

[supervisor@rcms green]$ /sbin/ifconfig eth0 10.10.10.45


SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied

[supervisor@rcms green]$ su - root


Password:
[root@rcms ~]# /sbin/ifconfig eth0 10.10.10.45
[root@rcms ~]# /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:9E:FF:25
inet addr:10.10.10.45 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::a00:27ff:fe9e:ff25/64 Scope:Link

19
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1


RX packets:40303 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3489254 (3.3 MiB) TX bytes:10845 (10.5 KiB)
Base address:0xd010 Memory:f0000000-f0020000

[root@rcms ~]# cd /etc/sysconfig/network-scripts/


[root@rcms network-scripts]# ls
ifcfg-eth0 ifdown-ipv6 ifdown-tunnel ifup-ipv6 ifup-routes network-functions
ifcfg-lo ifdown-isdn ifup ifup-ipx ifup-sit network-functions-ipv6
ifdown ifdown-post ifup-aliases ifup-isdn ifup-sl route-eth0
ifdown-bnep ifdown-ppp ifup-bnep ifup-plip ifup-tunnel
ifdown-eth ifdown-routes ifup-eth ifup-plusb ifup-wireless
ifdown-ippp ifdown-sit ifup-ippp ifup-post init.ipv6-global
ifdown-ipsec ifdown-sl ifup-ipsec ifup-ppp net.hotplug
[root@rcms network-scripts]# more ifcfg-eth0
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=08:00:27:9E:FF:25
IPADDR=192.168.24.4
NETMASK=255.255.255.0
ONBOOT=yes
[root@rcms network-scripts]# more route-eth0
GATEWAY0=
NETMASK0=240.0.0.0
ADDRESS0=224.0.0.0
[root@rcms network-scripts]# more ../network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=rcms
GATEWAY=192.168.24.254
[root@rcms network-scripts]# cp ifcfg-eth0 route-eth0 ../network /tmp
[root@rcms network-scripts]# vi ifcfg-eth0
[root@rcms network-scripts]# vi ../network
[root@rcms network-scripts]# more ifcfg-eth0
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=08:00:27:9E:FF:25
IPADDR=10.10.10.45
NETMASK=255.255.255.0
ONBOOT=yes
[root@rcms network-scripts]# more ../network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=rcms
GATEWAY=10.10.10.254
[root@rcms network-scripts]# ifdown eth0
[root@rcms network-scripts]# ifup eth0
[root@rcms network-scripts]# /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:9E:FF:25
inet addr:10.10.10.45 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe9e:ff25/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

20
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

RX packets:42543 errors:0 dropped:0 overruns:0 frame:0


TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3677312 (3.5 MiB) TX bytes:18373 (17.9 KiB)
Base address:0xd010 Memory:f0000000-f0020000

[root@rcms network-scripts]# /etc/init.d/network restart


Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@rcms network-scripts]# /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:9E:FF:25
inet addr:10.10.10.45 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe9e:ff25/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:42745 errors:0 dropped:0 overruns:0 frame:0
TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3694758 (3.5 MiB) TX bytes:26276 (25.6 KiB)
Base address:0xd010 Memory:f0000000-f0020000

[root@rcms network-scripts]# service network restart


Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@rcms network-scripts]# /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:9E:FF:25
inet addr:10.10.10.45 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe9e:ff25/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43020 errors:0 dropped:0 overruns:0 frame:0
TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3718115 (3.5 MiB) TX bytes:33881 (33.0 KiB)
Base address:0xd010 Memory:f0000000-f0020000

[root@rcms network-scripts]# exit


[supervisor@rcms green]$

21
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XIX. Secure Shell operations


Short Explanation:
Secure Shell is a crypted communication medium. It uses conventional RSA public and private keys to communicate
information from one host to another.

Secure Shell generally permits a user to:


- log in to a remote station (with any user as long as the password is known) and then use the foreign host as a
local one.
- remotely copy information from one host to another
- execute commands on a remote machine

Example of terminal output while doing exercise 8:

The example here did not have a foreign machine available and therefore used 127.0.0.1 (localhost)

[supervisor@rcms green]$ more /etc/hosts


# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 rcms localhost.localdomain localhost

# ADS-B and raw data


# ---------------------------------------------------------
233.71.15.30 adsbtrack
233.71.15.31 adsbraw

# Ground stations
# ---------------------------------------------------------
10.10.10.1 PhnomPenh Phnom-Penh phnompenh phnom-penh gs1
10.10.10.2 SiemReap Siem-Reap siemreap siem-reap gs2
10.10.10.3 StungTreng Stung-Treng stungtreng stung-treng gs3
#10.10.10.10 rcms
#255.255.255.0 mask
[supervisor@rcms green]$ ping -c4 -w10 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.273 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.038 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.063 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.039 ms

--- 127.0.0.1 ping statistics ---


4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 0.038/0.103/0.273/0.098 ms
[supervisor@rcms green]$ ping -c4 -w10 rcms
PING rcms (127.0.0.1) 56(84) bytes of data.
64 bytes from rcms (127.0.0.1): icmp_seq=1 ttl=64 time=0.096 ms
64 bytes from rcms (127.0.0.1): icmp_seq=2 ttl=64 time=0.031 ms
64 bytes from rcms (127.0.0.1): icmp_seq=3 ttl=64 time=0.049 ms
64 bytes from rcms (127.0.0.1): icmp_seq=4 ttl=64 time=0.061 ms

--- rcms ping statistics ---


4 packets transmitted, 4 received, 0% packet loss, time 3011ms
rtt min/avg/max/mdev = 0.031/0.059/0.096/0.024 ms
[supervisor@rcms green]$ ssh supervisor@rcms
The authenticity of host 'rcms (127.0.0.1)' can't be established.
RSA key fingerprint is d0:e6:52:6a:32:c2:32:31:2a:27:6c:4e:21:c3:bf:1d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rcms' (RSA) to the list of known hosts.

22
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

supervisor@rcms's password:
Last login: Thu Jul 28 12:31:53 2011
[supervisor@rcms ~]$ exit
Connection to rcms closed.
[supervisor@rcms green]$ ssh root@rcms
root@rcms's password:
Last login: Tue Jul 26 13:13:12 2011 from rcms
[root@rcms ~]# ls /
bin dev home local media mnt opt root selinux sys tmp var
boot etc lib lost+found misc net proc sbin srv tftpboot usr
[root@rcms ~]# touch /tmp/transfer
[root@rcms ~]# exit
[supervisor@rcms green]$ scp root@rcms:/tmp/transfer ~
root@rcms's password:
transfer 100% 0 0.0KB/s 00:00
[supervisor@rcms green]$ ls ~
Desktop exercises transfer
[supervisor@rcms green]$ ssh root@rcms "echo 'Hello from far far away' > /tmp/transfer"
root@rcms's password:
[supervisor@rcms green]$ scp root@rcms:/tmp/transfer ~/transfer2
root@rcms's password:
transfer 100% 24 0.0KB/s 00:00
[supervisor@rcms green]$ more ~/transfer2
Hello from far far away
[supervisor@rcms green]$

Exercise XX. File rights and building a script


Short Explanation:
There are two ways of using chmod (octal method or symbolic method).
Goal: give to file “blue.txt” the rights of rwx r-x --x (former value of “blue.txt” is -wxr-x--x)
Example of octal method:
Value: rwx r-x --x
Binary: 111 101 001
User Group Other
Right rwx r-x --x
Binary value 111 101 001
Decimal value 4+2+1 4+0+1 0+0+1
Decimal value summed 7 5 1
Use of chmod: chmod <octal value> <target file>
Solution: chmod 751 blue.txt
Example of symbolic method:
With the use of symbols, you can slide away from the octal method and use the following:
User category:
u: apply to user
g: apply to group
o: apply to other
a: apply to all three categories
Operator:
+: add right
-: suppress right
=: absolute assignment (will replace anything with current input)
Right:
r: read
w: write
x: execute
Use of chmod: chmod <ugoa><+-=><rwx> <target file>

23
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Solution: chmod u+x blue.txt

Example of terminal output while doing exercise 9:

[supervisor@rcms green]$ cd /tmp


[supervisor@rcms tmp]$ ls
custom.conf.patch ifcfg-eth0 route-eth0 tmpVpfsWdxorg.config
gconfd-root network ssh-gJcdOG2210 tmpW0hYrBxorg.config
gconfd-supervisor orbit-root tmpa19I3rxorg.config tmpXamvpXxorg.config
green orbit-supervisor tmpHAhryfxorg.config transfer
[supervisor@rcms tmp]$ ls -l /tmp /tmp/green/
/tmp:
total 20
drwxr-xr-x 3 supervisor users 4096 Jul 28 13:24 green
-rw-r--r-- 1 root root 174 Jul 28 13:30 ifcfg-eth0
-rw-r--r-- 1 root root 71 Jul 28 13:30 network
-rw-r--r-- 1 root root 48 Jul 28 13:30 route-eth0
-rw-r--r-- 1 root root 24 Jul 28 13:49 transfer

/tmp/green/:
total 4
lrwxrwxrwx 1 supervisor users 28 Jul 28 13:24 create.txt -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 supervisor users 28 Jul 28 13:24 link2 -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 supervisor users 17 Jul 28 13:20 link3 -> orange/create.txt
drwxr-xr-x 2 supervisor users 4096 Jul 28 13:10 orange
[supervisor@rcms tmp]$ touch script.sh
[supervisor@rcms tmp]$ vi script.sh
[supervisor@rcms tmp]$ more script.sh
#! /bin/ksh
#Author: Zorro
#Date: 25/08/2011
#Filename: script.sh

echo "Hello Zorro !"


[supervisor@rcms tmp]$ chmod u+x script.sh
[supervisor@rcms tmp]$ ls -l script.sh
-rwxr--r-- 1 supervisor users 88 Jul 28 13:55 script.sh
[supervisor@rcms tmp]$ ./script.sh
Hello Zorro !
[supervisor@rcms tmp]$ /tmp/script.sh
Hello Zorro !
[supervisor@rcms tmp]$ cd green/
[supervisor@rcms green]$ ../script.sh
Hello Zorro !
[supervisor@rcms tmp]$ su - root
Password:
[root@rcms ~]# chown root:supervisor /tmp/script.sh
[root@rcms ~]# chown -R root:supervisor /tmp/green
[root@rcms ~]# ls -l /tmp/ /tmp/green/*
lrwxrwxrwx 1 root supervisor 28 Jul 28 13:24 /tmp/green/create.txt -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 root supervisor 28 Jul 28 13:24 /tmp/green/link2 -> /tmp/green/orange/create.txt
lrwxrwxrwx 1 root supervisor 17 Jul 28 13:20 /tmp/green/link3 -> orange/create.txt

/tmp/:
total 24
drwxr-xr-x 3 root supervisor 4096 Jul 28 13:24 green
-rw-r--r-- 1 root root 174 Jul 28 13:30 ifcfg-eth0
-rw-r--r-- 1 root root 71 Jul 28 13:30 network

24
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

-rw-r--r-- 1 root root 48 Jul 28 13:30 route-eth0


-rwxr--r-- 1 root supervisor 88 Jul 28 13:55 script.sh
-rw-r--r-- 1 root root 24 Jul 28 13:49 transfer

/tmp/green/orange:
total 8
-rw-r--r-- 1 root supervisor 95 Jul 28 13:13 create.txt
-rw-r--r-- 1 root supervisor 48 Jul 28 13:07 creation-file
[root@rcms ~]# chown -R supervisor:users /tmp/script.sh /tmp/green
[root@rcms ~]# exit
[supervisor@rcms tmp]$ vi script.sh
[supervisor@rcms tmp]$ more script.sh
#! /bin/ksh
#Author: Zorro
#Date: 25/08/2011
#Filename: script.sh

echo "Hello Zorro !"


mkdir /tmp/red
touch /tmp/red/blue.sh
chmod u+x /tmp/red/blue.sh
echo "Script finished"
[supervisor@rcms tmp]$ ./script.sh
Hello Zorro !
[supervisor@rcms tmp]$ ls -l red/blue.sh /tmp
-rwxr--r-- 1 supervisor users 0 Jul 28 14:15 red/blue.sh

/tmp:
total 24
drwxr-xr-x 3 supervisor users 4096 Jul 28 13:24 green
-rw-r--r-- 1 root root 174 Jul 28 13:30 ifcfg-eth0
-rw-r--r-- 1 root root 71 Jul 28 13:30 network
drwxr-xr-x 2 supervisor users 4096 Jul 28 14:15 red
-rw-r--r-- 1 root root 48 Jul 28 13:30 route-eth0
-rwxr--r-- 1 supervisor users 176 Jul 28 14:15 script.sh
-rw-r--r-- 1 root root 24 Jul 28 13:49 transfer
[supervisor@rcms tmp]$

25
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XXI. Variables


Short Explanation:

Variables permit you to save entries or values throughout a script. This is particularly useful when you want to build
generic means of doing tasks in different locations.

This is typically the first steps to developing software. For further use, please follow up on constructs using if, do,
while, how to do mathematical operations, how to use functions, etc…

The use of “cat <<-EOF”, further down in the example, is a trick to force the cat command to record everything it
sees until it meets the characters EOF.

Example of terminal output while doing exercise 10:

[supervisor@rcms tmp]$ cp script.sh zorro.sh


[supervisor@rcms tmp]$ ls -l zorro.sh
-rwxr--r-- 1 supervisor users 176 Jul 28 14:21 zorro.sh
[supervisor@rcms tmp]$ vi zorro.sh
[supervisor@rcms tmp]$ more zorro.sh
#! /bin/ksh
#Author: Zorro
#Date: 25/08/2011
#Filename: script.sh

echo "Hello Zorro !"


answer="Hello there, I’m Sergeant Garcia!"
echo $answer

echo "My script is called $0"


echo "My first argument is (\$1) is $1"
echo "My second argument is (\$2) is $2"
echo "I have received as input a total of $# arguments"
echo "My fourth argument (\$4) is with a default value ${4-:defaultValue}"
echo "Here was the complete list of arguments received: $*"
[supervisor@rcms tmp]$ ./zorro.sh red green blue
Hello Zorro !
Hello therem Sergeant Garcia!
My script is called ./zorro.sh
My first argument is ($1) is red
My second argument is ($2) is green
I have received as input a total of 3 arguments
My fourth argument ($4) is with a default value :defaultValue
Here was the complete list of arguments received: red green blue
[supervisor@rcms tmp]$ ./zorro.sh red green blue yellow
Hello Zorro !
Hello therem Sergeant Garcia!
My script is called ./zorro.sh
My first argument is ($1) is red
My second argument is ($2) is green
I have received as input a total of 4 arguments
My fourth argument ($4) is with a default value yellow
Here was the complete list of arguments received: red green blue yellow
[supervisor@rcms tmp]$ vi generate-script.sh
[supervisor@rcms tmp]$ chmod u+x generate-script.sh
[supervisor@rcms tmp]$ more generate-script.sh
#! /bin/ksh
#Author: Zorro

26
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

#Date: 25/08/2011
#Filename: generate-script.sh

execshell=/bin/ksh
binpath=$(pwd)
fname=${1-default.sh}

#Creating the file with the header


echo "Creating file... ${binpath}/${fname} "
cat <<-EOF > ${binpath}/${fname}
#!${execshell}
#Author: ${USER}
#Date: $(date +%d/%m/%Y)
#File: ${fname}

EOF

#Giving the execution rights


chmod u+x ${binpath}/${fname}

#Showing the rights result


ls -l ${binpath}/${fname}

echo "Creation finished"


[supervisor@rcms tmp]$ ./generate-script.sh test.sh
Creating file... /tmp/test.sh
-rwxr--r-- 1 supervisor users 65 Jul 28 15:32 /tmp/test.sh
Creation finished
[supervisor@rcms tmp]$ more test.sh
#!/bin/ksh
#Author: supervisor
#Date: 28/07/2011
#File: test.sh

[supervisor@rcms tmp]$

27
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XXII. Mounting a USB stick or CD, mounting an ISO, unmounting.


Short Explanation:
Mounting an object means authorizing Linux to read (and write when possible) the content of an external media such
as a USB stick, a CD, etc…
In this case, the recommended way of mounting objects is to use the graphical interface. However, some machines are
not equipped with graphic cards and therefore the command lines method can sometimes come in handy.

Example of terminal output while doing exercise 11:

[supervisor@rcms tmp]$ su - root


Password:
[root@rcms ~]# ls /media/
[root@rcms ~]# mkdir /media/test
[root@rcms ~]# dmesg | grep sd
SCSI device sda: 43282432 512-byte hdwr sectors (22161 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back
SCSI device sda: 43282432 512-byte hdwr sectors (22161 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 >
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:0:0: Attached scsi generic sg0 type 0
EXT3 FS on sda2, internal journal
EXT3 FS on sda8, internal journal
EXT3 FS on sda7, internal journal
EXT3 FS on sda6, internal journal
EXT3 FS on sda5, internal journal
EXT3 FS on sda1, internal journal
Adding 1020116k swap on /dev/sda3. Priority:-1 extents:1 across:1020116k
SCSI device sdb: 15622144 512-byte hdwr sectors (7999 MB)
sdb: Write Protect is off
sdb: Mode Sense: 23 00 00 00
sdb: assuming drive cache: write through
SCSI device sdb: 15622144 512-byte hdwr sectors (7999 MB)
sdb: Write Protect is off
sdb: Mode Sense: 23 00 00 00
sdb: assuming drive cache: write through
sdb: sdb1
sd 1:0:0:0: Attached scsi removable disk sdb
sd 1:0:0:0: Attached scsi generic sg1 type 0
[root@rcms ~]# mount /dev/sdb1 /media/test
[root@rcms ~]# cd /media/test/
[root@rcms test]# ls
MLAT-RPMS
[root@rcms /]# cp /media/test/MLAT-RPMS/ADS
ADSB-CFG-CATS-CAMBODIA_0.1.iso ADS-B Software 4.10.iso
[root@rcms /]# cp /media/test/MLAT-RPMS/ADSB-CFG-CATS-CAMBODIA_0.1.iso /tmp
[root@rcms /]# umount /media/test/
[root@rcms /]# mount -o loop /tmp/ADSB-CFG-CATS-CAMBODIA_0.1.iso /media/test/
[root@rcms /]# ls /media/test/
ADSB-CFG-CATS-CAMBODIA autorun Copyright installCPS.sh pkgs.txt repodata
[root@rcms /]# umount /media/test/
[root@rcms /]# mkdir /media/test2 /media/test3
[root@rcms /]# mount /dev/cdrom /media/test

28
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

mount: block device /dev/cdrom is write-protected, mounting read-only


[root@rcms /]# mount /dev/sdb1 /media/test2
[root@rcms /]# mount -o loop /tmp/ADSB-CFG-CATS-CAMBODIA_0.1.iso /media/test3
[root@rcms /]# ls /media/test*
/media/test:
ADSB-CFG-CATS-CAMBODIA autorun Copyright installCPS.sh pkgs.txt repodata

/media/test2:
MLAT-RPMS

/media/test3:
ADSB-CFG-CATS-CAMBODIA autorun Copyright installCPS.sh pkgs.txt repodata
[root@rcms /]# umount /media/test*
[root@rcms /]# ls /media/test*
/media/test:

/media/test2:

/media/test3:
[root@rcms /]# rm -r /media/test*
rm: remove directory `/media/test'? y
rm: remove directory `/media/test2'? y
rm: remove directory `/media/test3'? y
[root@rcms /]# exit

Exercise XXIII. Using aliases, editing aliases


Short Explanation:

An alias is a way of building command shortcuts. Instead of typing a long command line like “snmpwalk –v3 –u
monitor –A 12monitor21 –l authNoPriv <hostname>:<port> snmpEngineID.0”, you could build an alias “blue” that
contains always the following “snmpwalk –v3 –u monitor –A 12monitor21 –l authNoPriv”. You could then type
“blue <hostname>:<port> snmpEngineID.0” to obtain the exact same result.

This is simply a way of making life easier for the user if he wants to work with shortcuts. Some users generally like to
have aliases such as:
alias cp=’cp –i’
alias rm=’rm –i’
alias mv=’mv –i’

Example of terminal output while doing exercise 12:

[supervisor@rcms tmp]$ cd ~
[supervisor@rcms ~]$ pwd
/home/supervisor
[supervisor@rcms ~]$ ls
Desktop exercises transfer transfer2
[supervisor@rcms ~]$ ls -a
. .bashrc exercises .ICEauthority .neditdb .Xclients
.. .cache .gconf .lesshst .ssh .Xclients-default
.bash_history .config .gconfd .local .tools .xsession-errors
.bash_logout Desktop .gnome2 .mozilla transfer .zshrc
.bash_profile .dmrc .gnome2_private .nedit transfer2
[supervisor@rcms ~]$ more .bashrc
# .bashrc

# Source global definitions

29
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions


[supervisor@rcms ~]$ man alias
[supervisor@rcms ~]$ vi .bashrc
[supervisor@rcms ~]$ more .bashrc
# .bashrc

# Source global definitions


if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions


alias reader='chmod 444'
[supervisor@rcms ~]$ exit

---------New Terminal opened---------


[supervisor@rcms ~]$ touch dummy
[supervisor@rcms ~]$ ls -l dummy
-rw-r--r-- 1 supervisor users 0 Jul 29 09:01 dummy
[supervisor@rcms ~]$ reader dummy
[supervisor@rcms ~]$ ls -l dummy
-r--r--r-- 1 supervisor users 0 Jul 29 09:01 dummy
[supervisor@rcms ~]$ vi .bashrc
[supervisor@rcms ~]$ more .bashrc
# .bashrc

# Source global definitions


if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions


alias reader='chmod 444'
alias watchTime='date +%H:%M:%S'
alias squirrel='touch -r ~/dummy'
[supervisor@rcms ~]$ exit

---------New Terminal opened---------


[supervisor@rcms ~]$ watchTime
09:06:52
[supervisor@rcms ~]$ squirrel blue
[supervisor@rcms ~]$ ls -l dummy blue
-rw-r--r-- 1 supervisor users 0 Jul 29 09:01 blue
-r--r--r-- 1 supervisor users 0 Jul 29 09:01 dummy

30
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Short list of Ground Station commands (MAGS version)


minicom When using the serial cable, use minicom to log in
When logging in as “supervisor” or “root”, default passwords are “12super21” or “12uap21”
gs <command> To start/stop/show status/restart the GS application
<command> can be respectively : start, stop, restart, reload
gsinfo <option> To read statistic and status information from GS main application
<option> can be : -a, -b, -c, -h, -l, -p, -s, -t. Use “gsinfo –h” to see signification of each option
netconfig To save all the network changes
/mnt/app/gsapp –h Help for the run GS application (only run when rgs is stopped)
/mnt/app/gsapp –a Show the ADS-B output of the station (rgs stop necessary)
/mnt/app/gsapp –r Show the Raw Data output of the station (rgs stop necessay)
sv Show version
sp Show problems

Chapter 3: Ground Station Exercises

Exercise XXIV. Local configuration


Difficulty: 
HINT: Commands/tools of this exercise: ls, ssh, vi, man, info
1. Connect through SSH to the ground station
2. Read content of /
3. Read the content of spb3.xml, system.xml & site.xml
4. Log out from the remote ground station

Exercise XXV. Changing the IP configuration with LCMS


Difficulty: 
HINT: Commands/tools of this exercise: ls, more, less, vi, minicom, su, man, info

Method 1: Use of Graphical Interface


1. Launch the LCMS
2. Connect with an RJ45 cable to the Maintenance Interface of the GS
3. Open the GS Manager with the toolbar
4. Close the GS Manager, open a terminal, and type “gsmanager –d 192.168.23.1 –u supervisor –r supervisor &”
5. Go to the “GS → SPB3 → Network” tab
6. Write down (on a scrap paper) the Main IP of the primary address before changing the IP. To change the IP:
right click on the address, go to “edit”, enter the new IP address, then press the Enter key.
7. Go to the “GS → SPB3 → Configuration” tab
8. Under “Configuration Settings” section, Save the current modification by clicking on the associated “Start”
9. Go to the “GS → SPB3 → Software → Update” tab
10. Under the “Reboot / Restart” section, Reboot the kernel.
11. Wait a short while for the machine to reboot the SPB3.
12. With a second machine, or by changing the IP of the LCMS and connecting to the Main IP interface (Net 1)
with the RJ45, check that the GS IP has correctly changed and that you can call a GS manager using
“gsmanager –d <New IP address> -r supervisor &”. Do not revert back to the original IP, this will be done in
Method 2.

31
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Method 2: Use of terminal


1. Launch the LCMS
2. Connect with a USB to Serial SubD 9 adapter and a SubD 9 to MicroSubD 9 adapter to the console of the GS
3. If this is not the first time “minicom” is used on this computer with a USB to Serial adapter, skip to step 8. If it
is the first time, open a terminal, log in a “root” user and type “minicom –s”
4. Choose “Serial port setup”
5. In option “A – Serial Device”, change the value to “/dev/ttyUSB0” (if the default USB device is not ttyUSB0,
check with the “dmesg | grep ttyUSB” command in a new terminal if it was assigned to ttyUSB1, ttyUSB2,
etc… and change accordingly)
6. Go to “Save setup as dfl”
7. Go to “Exit from Minicom
8. In the terminal, type “minicom”. An “Initializing Modem” panel should appear shortly followed by the prompt
interface of the GS.
9. Using “vi /etc/network”, modify the address of the Main interface (eth1) back to the IP you wrote down (on a
scrap piece of paper) in Method 1, step 6. Save and quit vi.
10. Type “netconfig”. This will restart the network interface.
11. Type “ifconfig eth1” and check that eth1 has correctly changed his IP.
12. With a second machine, or by changing the IP of the LCMS and connecting to the Main IP interface with the
RJ45, check that the GS IP has correctly changed and that you can call a GS manager using “gsmanager –d
<New IP address> -r supervisor &”.
13. Quit the minicom interface by holding down the Ctrl key and the A key at the same time (Ctrl + A). Press the
Q key to quit and a window with “Leave without reset” will appear. Choose “Yes” and press the Enter key.

Exercise XXVI. Save a configuration from remote, through a script


Difficulty: 
HINT: Commands/tools of this exercise: vi, nedit, scp, mkdir, man, info
1. On the RCMS, create a “configuration-saver.sh” script that will create a folder in home directory of your
current user (i.e. for supervisor, it’s /home/supervisor/) called “groundstation-backup”, save the configuration
of all ground stations in the system (three file per ground station) and place them in “groundstation-backup”
2. Launch “configuration-saver.sh”
3. Check the content of “/usr/local/etc/groundstation-backup”

Exercise XXVII. Starting / Stopping the ground station service


Difficulty: 
HINT: Commands/tools of this exercise: ssh, gs, man, info
1. Connect through SSH to the ground station
2. Using “gs status”, check the status of the ground station service.
3. Using “gs”, stop the ground station service.
4. Repeat step 2
5. Using “gs”, start the ground station service.
6. Repeat step 2. Log out of the ground station if all is ok.

Exercise XXVIII. Seeing the data stream on the ground station


Difficulty: 
HINT: Commands/tools of this exercise: ssh, rgs, man, info
1. Connect through SSH to the ground station
2. Type “/mnt/app/gsapp –h” to see the usage of the command
3. Type “/mnt/app/gsapp –a” to see the ADS-B data that is seen by the ground station
4. Use the keyboard and press Ctrl + C to stop the data flow
5. Type “/mnt/app/gsapp –r” to see the Raw Data that is seen by the ground station
6. Repeat step 4
7. Type “gs restart”
8. Log out of the ground station if all is ok.

32
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XXIX. Configuring the output of the GS


Difficulty: 
1. Open to GS Manager with the LCMS directly connected through the Maintenance interface
2. Go to the tab “GS → SPB3 → Output”
3. Click on the “Expand all” button
4. Depending on if you are using MLAT or ADS-B, skip to the corresponding section (caution: for MLAT use,
you can also activate ADS-B at the same time for a different destination)

For MLAT use:


5. Check that the ADS-B Data channel is correctly configured (Host & Port). These two parameters define the
target destination for ADS-B Data (see training course) necessary for the CPS unit. If you need to change the
parameters, click on the right button of the mouse and select “Configure”. Make sure that the target
destination (Host & IP) is reachable by the network.
6. Check that the Report shows “enabled” for the Raw Report
7. Check that the Channel shows “enabled” for the Raw Data
8. Go to step 9

For ADS-B use:


5. Check that the Asterix Target channel is correctly configured (Host & Port). These two parameters define the
target destination for Asterix CAT 21 data (see training course) that can be displayed on the RCMS unit. If you
need to change the parameters, click on the right button of the mouse and select “Configure”. Make sure that
the target destination (Host & IP) is reachable by the network.
6. Check that the Report shows “enabled” for the Asterix Target
7. Check that the Channel shows “enabled” for the Asterix Target
8. Go to step 9

General Check
9. Open a terminal window and connect to the GS by using the command “ssh gsmaint”
10. Type “tcpdump –i eth1 host <Host IP configured in step 5> and port <Port configured in step 5>”
11. If you see the screen outputting continuous data, then the ground station is sending data correctly. To exit this
continuous feed of information, press “Ctrl + C” simultaneously. If you do not see continuous data, this can
either mean that the GS is not receiving data (check the front panel LED) or the “GS → SPB3 → ADS-B” tab
to see if targets are seen (No. Of Targets field), or that you have wrongly configured the GS.

33
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Chapter 4: Solutions to Ground Station Exercises

Exercise XIII. Local configuration


Short Explanation

This exercise will show you how to access the local configuration and to force the system to take the changes into
account. This is however the “difficult” way since the Graphical User Interface (GUI) of the RCMS also does it
through the GS Manager.

Example of terminal output while doing exercise 13:

[supervisor@lcmsX ~]$ ssh supervisor@gsmaint


supervisor@gsmaint's password:

BusyBox v1.10.4 (2010-03-01 11:44:42 CET) built-in shell (msh)


Enter 'help' for a list of built-in commands.

==========================================================================
=
== ==
== Welcome to SPB3 RADIO ==
== ==
==========================================================================
=

root@FKORN-1# ls /
bin init mnt sbin sys usr
dev lib proc site.xml system.xml var
etc libexec root spb3.xml tmp
root@FKORN-1# more site.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ConfigSite SYSTEM "/usr/local/mags/dtd/ConfigSite.dtd">

<ConfigSite id="ConfigSitePyG0CY">
<requestedExecutionMode>1</requestedExecutionMode>
<eventStatusChangeEnabled>true</eventStatusChangeEnabled>
<heartbeatEnabled>false</heartbeatEnabled>
<heartbeatPeriod>1</heartbeatPeriod>
<ptmAvailability>true</ptmAvailability>
<txAvailability>true</txAvailability>
<rawDataChannelEnabled>true</rawDataChannelEnabled>
<rawDataChannelName>RawData</rawDataChannelName>
[… extract from the terminal cut to save space in this document…]
<RFOverallScale>0.7</RFOverallScale>
<RFPoolSize>60</RFPoolSize>
<RFPoolTime>90</RFPoolTime>
</RF>
</Sync>
</ConfigSite>
root@FKORN-1# more system.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ConfigSystem SYSTEM "/usr/local/mags/dtd/ConfigSystem.dtd">

34
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

<ConfigSystem id="ConfigSystem000">
<CentralMonitoringServers>
<CentralMonitoringServer id="CentralMonitoringServer000">
<ipAddress>10.110.56.201</ipAddress>
<name>cms1</name>
[… extract from the terminal cut to save space in this document…]
<GroundStation id="GroundStation042">
<sic>63</sic>
<sac>97</sac>
<ipAddress>10.110.56.2</ipAddress>
<posLatitude>48.8261505</posLatitude>
<posLongitude>9.1107197</posLongitude>
<posAltitude>370.33</posAltitude>
<modeSID>0x003C002B</modeSID>
<name>FKORN-1</name>
</GroundStation>
</GroundStations>
</ConfigSystem>
root@FKORN-1# more spb3.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ConfigSPB3 SYSTEM "/usr/local/mags/dtd/ConfigSPB3.dtd">

<ConfigSPB3 id="ConfigSPB3MJY7nc">
<spb3FunctionMask>0</spb3FunctionMask>
<ptmFunctionMask>0</ptmFunctionMask>
<txFunctionMask>0</txFunctionMask>
<deviceID>deviceID0</deviceID>
<name>FKORN-1</name>
<rxTaskEnabled>true</rxTaskEnabled>
<asxTgtTaskEnabled>true</asxTgtTaskEnabled>
<asxStatusTaskEnabled>true</asxStatusTaskEnabled>
<txTaskEnabled>true</txTaskEnabled>
<thresholdTemperature>60</thresholdTemperature>
<gpsMode>1</gpsMode>
<maxReceiverRange>1000000</maxReceiverRange>
<trackstoreSize>1123</trackstoreSize>
<runGsApp>true</runGsApp>
<runGsSync>true</runGsSync>
<runGsDso>false</runGsDso>
<runGsSync>true</runGsSync>
<NTP id="NTPHmm1JR">
<ntpMode>0</ntpMode>
<NtpServers>
<NtpServer id="NtpServerI8yV5w">
<ntpServer>127.0.0.1</ntpServer>
</NtpServer>
</NtpServers>
</NTP>
</ConfigSPB3>
root@FKORN-1# exit
Connection to gsmaint closed.
[supervisor@lcmsX ~]$

35
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XIV. Changing the IP configuration with LCMS


Short Explanation

This exercise will show you how to change the IP of the ground station, and to tell the system to take the changes into
account. This is however the “difficult” way since the Graphical User Interface (GUI) of the RCMS also does it
through the GS Manager.

Example of terminal output while doing exercise 14:

[supervisor@lcmsX ~]$ minicom


** Parameter rtscts is public, but is marked private in global config file

Welcome to minicom 2.1

OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n


Compiled on Jan 7 2007, 04:48:39.

Press CTRL-A Z for help on special keys

FKORN-1 login: supervisor


Password:

BusyBox v1.10.4 (2010-03-01 11:44:42 CET) built-in shell (msh)


Enter 'help' for a list of built-in commands.

==========================================================================
=
== ==
== Welcome to SPB3 RADIO ==
== ==
==========================================================================
=

root@FKORN-1# vi /etc/network
root@FKORN-1# netconfig
root@FKORN-1# ifconfig
eth0 Link encap:Ethernet HWaddr 00:09:CF:B4:05:2C
inet addr:192.168.23.1 Bcast:192.168.23.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:457 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80035 (78.1 KiB) TX bytes:80403 (78.5 KiB)
Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:09:CF:B4:05:2D


inet addr:10.110.56.2 Bcast:10.110.56.7 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:882 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:136 (136.0 B) TX bytes:48174 (47.0 KiB)
Base address:0x4000

36
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

eth2 Link encap:Ethernet HWaddr 00:09:CF:B4:05:2E


inet addr:192.168.42.120 Bcast:192.168.42.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Base address:0x6000

lo Link encap:Local Loopback


inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7999 errors:0 dropped:0 overruns:0 frame:0
TX packets:7999 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:770375 (752.3 KiB) TX bytes:770375 (752.3 KiB)

root@FKORN-1#

37
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XV. Save a configuration from remote, through a script


Short Explanation

This shows how to use a script to make a global snapshot of the system and save the data on the RCMS.
Two elements will be new to this exercise: the “IF” condition and the “FOR” loop.

The IF condition works as follows: if the testing condition is True, then execute the script after the words “then”; if the
testing condition is False, then execute the script after the words “else”.
Syntax:
if [ TEST ]
then
Command line(s) to execute only if TEST is True
else
Command line(s) to execute only if TEST is False
fi

TEST elements can be:


Test Description
-d file True if file is a directory.
-e file True if file exists.
-f file True if file exists and is a regular file.
-L file True if file is a symbolic link.
-r file True if file is a file readable by you.
-w file True if file is a file writable by you.
-x file True if file is a file executable by you.
True if file1 is newer than (according to
file1 -nt file2
modification time) file2
file1 -ot file2 True if file1 is older than file2
-z string True if string is empty.
-n string True if string is not empty.
string1 = string2 True if string1 equals string2.
string1 != string2 True if string1 does not equal string2.
num1 -eq num2 True if num1 equals num2.
num1 -ne num2 True if num1 is not equal to num2.
num1 -lt num2 True if num1 is less than num2.
num1 -gt num2 True if num1 is greater than num2.
num1 -le num2 True if num1 is less than or equal to num2.
num1 -ge num2 True if num1 is greater than or equal to num2.

The FOR loop works as follows: starting from a certain number (variable parameter), execute the content inside the
loop, increment the number, and execute again until the number has reached his limit.
Syntax:
for (( Variable = Start value ; Variable <= Limit ; Variable+
+))
do
Command line(s) to execute (Limit – Start Value) times
done

For more information on how IF conditions work (with examples), go to:


http://linuxcommand.org/wss0090.php
For more information on how FOR loops work and how other loop types work (with examples), go to:
http://linuxcommand.org/wss0120.php
http://linuxcommand.org/wss0140.php

38
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Example of script for a simple solution (but subject to error reports if repeated multiple times) to exercise 15:

#! /bin/ksh
#Date: 27/01/2012
#Filename: configuration-saver.sh

#For this example, assume that the synonyms for ground stations are gs1, gs2, gs3
directory=”/home/supervisor/groundstation-backup”

mkdir $directory
mkdir $directory/gs1 $directory/gs2 $directory/gs3

#Extracting all files and placing them in the directory


echo "Extracting gs$i files (spb3.xml, system.xml, site.xml)"
scp gs1:s*.xml $directory/gs1
scp gs2:s*.xml $directory/gs2
scp gs3:s*.xml $directory/gs3
echo “Transfer is now complete”l

Example of terminal output while doing exercise 15 [Modular solution]:

[supervisor@rcms tmp]$ more configuration-saver.sh


#! /bin/ksh
#Date: 27/01/2012
#Filename: configuration-saver.sh

#For this example, assume that the synonyms for ground stations are gs1, gs2, gs3
totalName=3
#The following line will let you choose the destination
#or will as set as backup /home/supervisor/groundstation-backup
directory=${1:-/home/supervisor/groundstation-backup}

#Creating the directory only if it does not already exist


if [ -d $directory ]
then
echo “$directory already exists, skipping creation of directory”
else
echo “$directory is being created”
mkdir $directory
fi

# Extracting all files and placing them in the directory


for (( i = 1 ; i <= $totalName; i++ ))
do
echo "Extracting gs$i files (spb3.xml, system.xml, site.xml)"
if [ -d $directory/gs$i ]
then
echo “If content was present in gs$i , it has been replaced”
else
mkdir $directory/gs$i
fi
scp -o "ConnectTimeout 3" gs$i:s*.xml $directory/gs$i
done
echo “Transfer is now complete”

[supervisor@rcms tmp]$ ./configuration-saver.sh


/home/supervisor/groundstation-backup is being created
Extracting gs1 files (spb3.xml, system.xml, site.xml)"

39
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

supervisor@gs1 password:
site.xml 100% 6793 6.6KB/s 00:00
spb3.xml 100% 885 0.9KB/s 00:00
system.xml 100% 4125 4.0KB/s 00:00
Extracting gs2 files (spb3.xml, system.xml, site.xml)"
supervisor@gs2 password:
site.xml 100% 6793 6.6KB/s 00:00
spb3.xml 100% 885 0.9KB/s 00:00
system.xml 100% 4125 4.0KB/s 00:00
Extracting gs3 files (spb3.xml, system.xml, site.xml)"
supervisor@gs3 password:
site.xml 100% 6793 6.6KB/s 00:00
spb3.xml 100% 885 0.9KB/s 00:00
system.xml 100% 4125 4.0KB/s 00:00
Transfer is now complete
[supervisor@rcms tmp]$ ls ~/groundstation-backup/
gs1 gs2 gs3
[supervisor@rcms tmp]$ ls ~/groundstation-backup/gs*
/home/supervisor/groundstation-backup/gs1
site.xml spb3.xml system.xml

/home/supervisor/groundstation-backup/gs2
site.xml spb3.xml system.xml

/home/supervisor/groundstation-backup/gs3
site.xml spb3.xml system.xml

Exercise XVI. Starting / Stopping the ground station service


Short Explanation

How to stop and start the GS application and to check it’s status.

Example of terminal output while doing exercise 13:

[supervisor@rcms ~]$ ssh 192.168.24.200


supervisor@192.168.24.200's password:

BusyBox v1.10.4 (2010-03-01 11:44:42 CET) built-in shell (msh)


Enter 'help' for a list of built-in commands.

==========================================================================
=
== ==
== Welcome to SPB3 RADIO ==
== ==
==========================================================================
=

root@GSName0# gs status
gsctrl with PID=1090 is running
root@GSName0# gs stop
Stopping gsctrl ..........
root@GSName0# gs status
gsctrl is not running
root@GSName0# gs start
gsctrl started as daemon

40
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

root@GSName0# exit
Connection to 192.168.24.200 closed.
[supervisor@rcms ~]$

Exercise XVII. Seeing the data stream on the ground station


Short Explanation

How to test the data stream on the ground station.

Example of terminal output while doing exercise 13:

[supervisor@rcms ~]$ ssh 192.168.24.200


supervisor@192.168.24.200's password:

BusyBox v1.10.4 (2010-03-01 11:44:42 CET) built-in shell (msh)


Enter 'help' for a list of built-in commands.

===========================================================================
== ==
== Welcome to SPB3 RADIO ==
== ==
===========================================================================

root@GSName0# /mnt/app/gsapp -h
usage:
/mnt/app/gsapp <options>
-h = print this help
-d = run as daemon
-r = raw data output
-R = raw data output in debug mode
-a = asterix target data output
-s = asterix status data output
-p <port> = raw data input port
-u = use UTC system time instead of TOA
-x = log TX messages
-b = don't filter duplicate
-w = log duplicates
-A = suppress ACKs in RD output
-F <file> = log FPGA write-access to file
-c <maxSignalLevelDiff> = max. signal level [db] difference for Mode A/C pattern matcher,
default = 3.0, set to -1 if signal level shall be ignored
-m <nanoSeconds> = max. TOA jitter for Mode A/C pattern matcher, default 300ns
root@GSName0# /mnt/app/gsapp -a
FPGA::alloc
FPGA mapped to 30044000
ModeACPatternMatcher: 10 pattern(s) configured
TXThread started with TOA: 55385.513736204
Starting RXThread ... with PID 1518
Starting AdsbThread ... with PID 1519
Starting BiteThread ... with PID 1520
Starting TXThread ... with PID 1521
Starting Cat23WriterThread ... with PID 1522
Starting TstMsgThread ... with PID 1523
Starting SyncMsgThread ... PID 1524

41
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

ASTERIX DATA CATEGORY 21:


I021/010: 0x0000 [DSRC SAC: 0; SIC: 0]
I021/040: 0x0028 [TRD DCR: 0; GBS: 0; SIM: 0; TST: 0; RAB: 0; SAA: 0; SPI: 0; VN: 0; ATP: 1; ARC:
1]
I021/030: 0x6C36A4 [TOD: 15:23:25.278 (55405.278 s)]
I021/130: 0x22768D07069E [WGS84 LAT: 48.46371 °; LON: 9.88009 °]
I021/080: 0x4CA803 [TADDR: 4CA803]
I021/140: 0x0DE8 [GALT: 22250.00 ft]
I021/090: 0x0006 [FOM AC: 0; MN: 0; DC: 0; PA: 6]
I021/210: 0x08 [LTI DTI: 0; MDS: 1; UAT: 0; VDL: 0; OTR: 0]
I021/145: 0x039E [FL: 231.50 FL]
I021/157: 0x0185 [GEOVR: 2432.00 ft/min]
I021/160: 0x06D7E712 [GV SP: 0.10689 NM/s (384.79 kt); TA: 324.9470 °]
I021/170: 0x4994B531A820 [TIDF: RYR5LZ ]
I021/095: 0x00 [VACC: 0]
I021/200: 0x00 [TS: 0]

[… extract from the terminal cut to save space in this document…]

root@GSName0# /mnt/app/gsapp -r
FPGA::alloc
FPGA mapped to 30044000
ModeACPatternMatcher: 10 pattern(s) configured
TXThread started with TOA: 55475.056177753
Starting RXThread ... with PID 1527
Starting AdsbThread ... with PID 1528
Starting BiteThread ... with PID 1529
Starting TXThread ... with PID 1530
Starting Cat23WriterThread ... with PID 1531
Starting TstMsgThread ... with PID 1532
Starting SyncMsgThread ... PID 1533
55475.550707|2| 0| 0|0|0|06|1|55475550024223|1|0|0|0|1|-75.0|0|0|A020078010000680A000003D257D|
55475.564687|2| 0| 0|0|0|06|1|55475563025754|1|1|0|0|1|-75.0|0|0|A020078010000680A000003D257D|
55475.577687|2| 0| 0|0|0|06|1|55475576590230|1|0|0|0|1|-75.5|0|0|A020078010000680A000003D257D|
55475.926706|2| 0| 0|0|0|05|1|55475925179621|1|0|0|0|1|-76.0|0|0|5F3D257D000000|
55475.933687|2| 0| 0|0|0|06|1|55475932386128|1|0|0|0|1|-76.0|0|0|A0001097F49A592D61D43B4CA803|
poll /dev/tx | rcv socket: Interrupted system call
user abort!
DUP: ModeS in: 13
DUP: ModeS out: 13
DUP: ModeAC in: 0
DUP: ModeAC out: 0
Pattern matched: 0
FPGA::release
FPGA::release done
root@GSName0# gs restart
root@GSName0# exit
Connection to 192.168.24.200 closed.
[supervisor@rcms ~]$

42
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Chapter 5: Remote Control & Monitoring System (RCMS) Tools

Exercise XXX. Recording Tool


Difficulty: 

Preparation:
1. Using MTSC, open a CPS Manager.
2. Under “CPS → ADS-B → Output”, press the “Expand all” button.
3. Under “Channel / Report Mapping Table”, check that the Report for ADS-B Reports is enabled.
4. Under Report, look for an internal CAT21 channel and write down IP & Port number.
5. Close the CPS Manager.

Exercise:
1. In the toolbar at the bottom of the screen, press the second icon:
2. Select the “Asterix Recorder - AC21”
3. Select the “I/O Parameters” tab
a. Fill the “Read from interface” section with the IP and Port you previously wrote down
b. Make sure “Output to” has both “screen” and “file” boxes checked
c. In the section “Screen Mode” select “Verbose”
d. Under “File:” select the destination to save your file. For example, you could use /tmp/record.txt
4. Select the “Screen Output” tab
a. Press the red button on the top left corner.
b. Wait 1 minute and make sure you see targets being recorded
c. Press the stop button (where the red button was located)
5. Using a terminal or the File Manager, check that your file exists and contains data.
6. Close the Recording tool

Exercise XXXI. Technical Situation Display (TSD)


Difficulty: 

1. In the toolbar at the bottom of the screen, press the second icon:
2. Select “Technical Situation Display – TSD”.
3. Under “Display”, select “Details”. A panel will open on the left side with information left blank.
4. Under “Display”, make sure that “Contributing Receivers” is selected.
5. Navigate on the map.
6. Under “Help → Reference”, you will find a detailed overview of different actions possible.
7. Close the Short Reference.
8. Under “Preferences → Interfaces”, you can see all selected interfaces that are displayed on the map.
9. Uncheck all enabled boxes except mlat-plots-val-int.
10. Select an aircraft.
11. Notice the yellow dotted lines signalling the contributing receivers
12. Notice the information in the Target Details panel has been added:
13. Re-enable the enabled boxes you uncheck previously
14. Under “Tracks → Plot Shape” and change the shape. Notice the difference on the map.
15. Under “Tracks → Plot Size” and change the size. Notice the difference on the map.
16. Under “Tracks → History” and change the time of display. Notice the difference on the map.
17. Under “Tracks → Speed Vector” and change the time length of the vector. Notice the difference on the map.
18. Close the Technical Situation Display

43
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XXXII. Replay Tool


Difficulty: 

1. In the toolbar at the bottom of the screen, press the second icon:
2. Select the “Asterix Replayer - AP21”
3. Select the “I/O Parameters” tab
a. Make sure that “Replay data of either:” has “ASCII” selected.
b. Make sure the “file” button is selected.
c. Make sure the target file is the file recorded in the first exercise of this chapter (ex: /tmp/record.txt ).
d. Under “Send ASTERIX data to:”, make sure that “Host:” has “localhost” and “Port:” has “1337”.
e. Make sure that the box “Log replayed data to screen output size:” is checked.
f. Make sure that “Screen mode:” has “Verbose”.
4. Select “Screen Output” tab
a. Press the play button.
b. Make sure data are being shown, and then press the Stop button.
5. Close the Replay tool.

Exercise XXXIII. Replaying data into the Technical Situation Display


Difficulty: 

1. In the toolbar at the bottom of the screen, press the second icon:
2. Select the “Technical Situation Display – Configuration”
3. On the left side panel, go to “DisplayConfig → Interface”
4. You will see on the left side panel a list of all current Interfaces listened to by the TSD. On the right side panel,
you will find an “Add a new 'ItfParameter' element”. Click on this button
a. New panel opens, and under “Interface:” check the “Enabled” box.
b. Under “Incoming interface:”, make sure that “localhost” is the target.
c. Under “Incoming port:”, make sure that “1337” is the target.
d. Using the color wheel, choose a color you wish to see on the TSD for your data replay.
e. Under “Opacity:”, select a value higher than 0 (for example: 100)
5. On the bottom right, click on the "Apply" button
6. Go to “File → Save”
7. Close the “Technical Situation Display – Configuration” window
8. Using your knowledge of previous exercises,
a. Open a new Technical Situation Display.
b. Make sure that the only Enabled interface is the one you have configured in step 4. ( HINT: for this,
you will need to consult the interface menu of the TSD)
c. Open a Replay Tool for Asterix data Category 21
d. Replay data to the IP: “localhost” with the port “1337”
9. As long as your data replay is running, you should see targets on your TSD with the color you set in step 4.

44
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XXXIV. Master Technical System Control (MTSC)


Difficulty: 

1. In the toolbar at the bottom, press the first icon:


2. A new MTSC window has opened on the secondary screen. You will find three sections:
a. The tree view on the top left
b. The map view on the top right (with multiple available tabs)
c. The event view on the bottom

Exploring the tree view


3. Press the + button in front of “Central”
4. Right click on the “Central” line and select “Open Site Manager”
5. Notice the available sites and press a “CPS Manager” button
6. Close the CPS Manager and the Site Manager
7. Achieve the same result by doing a right click on the “CPS” line (under Central) and select “Open Device
Manager”
8. Explore the CPS Manager
9. Close the CPS Manager
10. Press the + button in front of a ground station
11. Double click on a ground station
12. Explore the GS Manager
13. Close the GS Manager

Explore the map view


14. Double click on a site in the map view
15. Close the Site Manager
16. Right click on a site in the map view
17. In the “Faulty Units” tab, check for available faulty units at the moment.
18. If faulty units are present, check available Problem Codes (PC)
19. Let your mouse hover above a PC line, it should show the description of the PC for a while
20. Go to the “CMS-S” tab and check the status of the CMS-S cluster and hardware
21. Go to the “CPS” tab and check the status CPS hardware

Explore the Events view in the MTSC


22. Click on the clear button on the right
23. Open a terminal and read the content of /var/log/user.info to find the history log of the Event view
24. A similar log can be found on the active CMS also in /var/log/user.info

Exercise XXXV. MAGS Configurator


Difficulty: 

1. Practice Chapter 8.2: Configuration of a Ground station and add a new ground station to the system
2. Practice Chapter 8.4: Removal of a Ground station and remove the new ground station from the system

Exercise XXXVI. User Configuration for MTSC


Difficulty: 

1. Practice Chapter 8.6: LDAP User Configuration of the Software User Manual

45
Author: Dorian Faucon
Document Revision: Version 004
Revision Date: 24 January 2013

Training Exercise Book

Exercise XXXVII. Access Control for MTSC


Difficulty: 

1. On the MTSC, select “MAGS Control” in the top menu


2. Notice in the title bar of the MTSC “User: <monitor@rcms> Role: monitor”
3. Go to “Set User”
4. Log in as supervisor user
5. Notice the change in the title bar of the MTSC
6. Right click on a ground station site and under “Access Request”, select “Active”
7. Repeat the previous step with another site.
8. Select “MAGS Control” in the top menu and go to “Admin Dialog”
9. Select either “Apply” or “Deny” for the “Access Request” from your users. This is used when the system is in
Secure Mode, to give to a supervisor user the rights to modify a site. The procedure is similar for “Monitoring
Request” in Secure Mode.
10. Close the window
11. If a ground station has had an error since the last visit on the RCMS, it will be blinking in the tree view and the
map view. Right click on the site and click on “Acknowledge Fault Status” once the problem has been
identified.
12. Select “MAGS Control” in the top menu and go to “Logout”

Exercise XXXVIII. Log files – CPS & RCMS


Difficulty: 

1. Open a terminal on the RCMS


2. Consult the following files
a. /var/log/user.info You will find here the messages from the MTSC log amongst others
b. /var/log/user.err You will find here a log of system errors
c. Log is as root user and consult: /var/log/messages
3. Log onto the CMS
4. Consult the same files as for the RCMS
5. Log onto the CPS
6. Consult the same files as for the RCMS
7. As root user, check that data is coming into the CPS on “m-data” IP (you can use the following command:
“tcpdump –i any host m-data”)
8. Using the MTSC, check that the system is alive and running.
9. Consult also the following folder, all files present: /local/data/logs/

46

You might also like