Professional Documents
Culture Documents
NETLAB Academy Edition, NETLAB Professional Edition, and NETLAB+ are registered trademarks of Network Development Group, Inc.
“Red Hat,” Red Hat Linux, and the Red Hat “Shadowman” logo are trademarks or registered trademarks of Red Hat, Inc. in the US
and other countries.
7.6. Practice: Killing Processes
Contents
Introduction ........................................................................................................................ 3
Outcomes ............................................................................................................................ 3
Lab Topology ....................................................................................................................... 4
Lab Settings ......................................................................................................................... 5
1 Guided Exercise........................................................................................................... 6
Introduction
In this lab, students will use keyboard sequences and signals to manage and stop
processes.
Outcomes
This practice exercise will provide experience with observing the results of starting and
stopping multiple shell processes.
Lab Topology
Lab Settings
The information in the table below will be needed in order to complete the lab. The
task sections below provide details on the use of this information.
1 Guided Exercise
Access the graphical login screen of the Server virtual machine and log in as student.
The topology includes two virtual machines that are accessible to users. Take care to
perform the tasks as instructed, including using the appropriate virtual machine as
directed.
1. Open two terminal windows, side by side, to be referred to as left and right.
2. In the left window, start three processes that append text to an output file at
one-second intervals. To properly background each process, the complete
command set must be contained in parentheses and ended with an ampersand.
[student@server1 ~]$ (while true; do echo -n "game " >> ~/outfile; sleep 1;
done) &
[student@server1 ~]$ (while true; do echo -n "set " >> ~/outfile; sleep 1;
done) &
[student@server1 ~]$ (while true; do echo -n "match " >> ~/outfile; sleep 1;
done) &
3. In the right window, use tail to confirm that all three processes are appending
to the file. In the left window, view jobs to see all three processes "Running".
4. Suspend the "game" process using signals. Confirm that the "game" process is
"Stopped". In the right window, confirm that "game" output is no longer active.
5. Terminate the "set" process using signals. Confirm that the "set" process has
disappeared. In the right window, confirm that "set" output is no longer active.
6. Resume the "game" process using signals. Confirm that the "game" process is
"Running". In the right window, confirm that "game" output is again active.
7. Terminate the remaining two jobs. Confirm that no jobs remain and that output
has stopped. From the left window, terminate the right window's tail
command.