Debug a Broken Linux Service #
A web service stopped responding. Find out why and fix it.
The Scenario #
Your team deployed a simple Python web app yesterday. It was working fine. Now users can’t access it. You need to troubleshoot and get it running.
Start the Lab #
docker run -it --name debug-lab ghcr.io/kkch/debug-broken-service:latest bash
Your Task #
Get the web service running and responding on port 8080.
Test it works:
curl localhost:8080
# Should return: "Service is running!"
Validation #
Run the validation script to check your solution:
curl -o validate.sh https://raw.githubusercontent.com/kkch/kkch.dev/main/content/labs/debug-broken-service/validate.sh
chmod +x validate.sh
./validate.sh
Hints #
Need help? Click for hints
Check service status:
systemctl status webapp
View logs:
journalctl -u webapp -n 50
Common issues to check:
- Is the service enabled?
- Are file permissions correct?
- Is it listening on the right port?
- Any errors in the logs?
What You’ll Practice #
- Checking systemd service status
- Reading system logs with journalctl
- Debugging permission issues
- Testing services locally