LAB-PROC-03 - Signals and Controlled Stopping
Understand basic process signals and practice stopping harmless processes with a preference for gentler signals first.
Signals and Controlled Stopping
Understand basic process signals and practice stopping harmless processes with a preference for gentler signals first.
- Understand basic process signals and practice stopping harmless processes with a preference for gentler signals first.
- Repeat the workflow without copy-paste or step-by-step prompting.
- Double-check process IDs and commands before stopping anything outside the lab scenario.
Part A: The Field Guide
The kill command sends a signal. It does not magically mean "destroy this process" every time.
For this lab, the most important signals are:
SIGTERMfor a normal stop requestSIGKILLfor force when normal stopping failsSIGINTas the signal behindCtrl+C
Good Default
Try a normal stop first. Force is a later step, not the first habit.
Part B: The Drill Deck
Terminal required: create only harmless targets and stop only those.
G Guided Step by step - type exactly this and compare the result >
Exercise G1: Create a harmless target
- Run
sleep 300 & - Run
pgrep sleep - Note the PID
Exercise G2: Send a normal stop request
- Run
kill <PID> - Wait a moment
- Run
pgrep sleep - Confirm the process is gone
Exercise G3: Use Ctrl+C on a foreground process
- Run
ping localhost - Let it run briefly
- Press
Ctrl+C - Explain how that differs from killing a background process by PID
S Solo Task described, hints available - figure it out >
Exercise S1: Compare term versus kill
Create another harmless sleep process and answer in words:
- what a polite stop is trying to allow
- why a forced stop is more abrupt
- why you would avoid the forced route unless needed
Exercise S2: Optional name-based stop
- create two harmless
sleepprocesses - verify them with
pgrep sleep - stop them with
pkill sleeporkillall sleep - confirm they are gone
M Mission Real scenario - no hints, combine multiple skills >
Mission M1: Build a safe stop sequence
Describe the sequence you would follow before stopping a process on a real machine:
- identify the exact process
- verify the PID or name
- decide whether a normal stop is appropriate
- confirm the result afterward
If that sequence is clear in your head, you are building the right operational habit.
What to do next
Best next step LearningReturn to the related lesson if you want the concept explained more deeply.