Tame the Runaway Job

Linux lab Intermediate 5 tasks 20 points

A botched deployment left this server in a mess. A nightly export-job is stuck and keeps running, and worse, a job-supervisor was set to restart it the moment it stops, so killing it does nothing. Sort it out without taking down the webserver, and ease the load of the backup-job instead of killing it. Your password is student.

How it works: the terminal below is a real Linux machine running in your browser. Click it and type. Tasks tick themselves off as you complete them; questions are answered in the box under each task. Press Reset any time for a fresh machine. Your password on this machine (for sudo) is student.

student@vulntech:~ Starting…
Getting your Linux machine ready…
The first start downloads about 20 MB. After that your browser keeps it, and labs start in a moment.

Hints

Kill the jobs, wait five seconds, then look again with ps aux to see what restarts them.

A process that shrugs off pkill needs pkill -KILL; one owned by root needs sudo.

Solution explanation

Killing export-job first doesn't last: a few seconds later job-supervisor starts three fresh ones. The supervisor ignores TERM, so it needs KILL, and it runs as root, so that needs sudo. With the supervisor gone, sudo pkill export-job finally clears them. renice -n 19 gives backup-job the lowest priority, so it only gets the CPU when nothing else wants it.

Show solution
pgrep -cx export-job
pkill export-job
ps aux
sudo pkill -KILL job-supervisor
sudo pkill export-job
pgrep -a webserver
sudo renice -n 19 -p $(pgrep backup-job)
HOME LEARN COMMUNITY DASHBOARD