{ "id": "linux-process-management", "title": "Find and Stop a Runaway Process", "category": "Linux Fundamentals", "isolation_type": "shared_namespace", "difficulty": "Easy", "type": "task", "weight": 4, "description": "## Find and Stop a Runaway Process\n\nA background process has been started for you and its PID recorded at `/srv/proc-lab/target.pid`. Every process in Kubernetes and Docker is, underneath, exactly this: a PID the kernel is tracking.\n\n**Your task:**\n\n1. Confirm the process is currently running (`kill -0 ` succeeds silently if a process exists)\n2. Send it a termination signal: `kill ` (using the PID recorded in the file, not a hardcoded number — it will be different every time)\n3. Confirm it is actually gone afterward", "hints": [ { "title": "Reading the PID and checking it's alive", "body": "`kill -0` sends no real signal — it only checks whether the process exists, which is why it's the standard way to test \"is this PID still running\" without side effects.", "command": "cat /srv/proc-lab/target.pid\nkill -0 $(cat /srv/proc-lab/target.pid) && echo RUNNING" }, { "title": "Terminating it", "body": "A plain `kill ` sends SIGTERM, the polite \"please shut down\" signal — the correct first choice before ever reaching for `kill -9`.", "command": "kill $(cat /srv/proc-lab/target.pid)" } ], "setup_commands": [ { "command": "mkdir -p /srv/proc-lab && (sleep 900 & echo $! > /srv/proc-lab/target.pid)" } ], "validation": { "commands": [ { "description": "the target process has actually been terminated", "command": "kill -0 $(cat /srv/proc-lab/target.pid) 2>/dev/null && echo RUNNING || echo GONE", "expected_output": "GONE", "match": "exact" } ] }, "default_namespace": "default", "teardown_commands": [ { "command": "kill -9 $(cat /srv/proc-lab/target.pid) 2>/dev/null; rm -rf /srv/proc-lab" } ] }