Process Hunt: Stop the Right One
EasyLinux Fundamentals10-15 minEvery program running on Linux is a process, and every process has a number (its PID) and an owner. You're logged in as 'student', an ordinary user with no sudo, so your prompt ends in $.
The nightly job report-builder is stuck and needs to be stopped. The catch: report-builder-ui, a different program with almost the same name, is open in a teammate's session and must keep running. Commands like pkill take a pattern, so a careless pkill report-builder stops both.
1. Find report-builder's PID and save just that number in ~/answers/runaway.pid.
2. Stop report-builder and leave report-builder-ui running.
3. A program called metrics-agent is also running. Find out which user owns it and save the username in ~/answers/owner.txt. Try to kill it and you'll see why the owner matters.
ps aux lists every process with its owner and PID. pgrep -l report shows what a pattern would match before you act on it. kill <PID> stops exactly one process. The same notes are in ~/brief.txt.
- List processes with ps and pgrep and read their PID and owner
- Stop one process by its PID without touching a look-alike
- Learn why an ordinary user can only signal their own processes
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
