{ "id": "linux-service-inspection", "title": "Inspect a Real Running Service", "category": "Linux Administration", "isolation_type": "shared_namespace", "difficulty": "Easy", "type": "task", "weight": 4, "description": "## Inspect a Real Running Service\n\nThis Lab environment is itself served by a real running service: nginx, reverse-proxying the very terminal you're using right now. Answer the four questions every service-administration task starts with, using ONLY inspection commands (do not stop or restart it).\n\n**Your task:**\n\nCreate `/srv/service-lab/report.txt` with exactly three lines:\n\n```\nLISTENING_PORT=\nCONFIG_PATH=\nLOG_DIR=\n```", "hints": [ { "title": "Finding the listening port", "body": "`ss -lnt` lists every TCP socket in LISTEN state and the port it's bound to.", "command": "ss -lnt" }, { "title": "Finding the config and logs", "body": "nginx's config path and log directives are visible right in its own config file.", "command": "cat /etc/nginx/nginx.conf | head -10" } ], "setup_commands": [ { "command": "mkdir -p /srv/service-lab" } ], "validation": { "commands": [ { "description": "correctly identified the listening port (80)", "command": "cat /srv/service-lab/report.txt | grep '^LISTENING_PORT='", "expected_output": "LISTENING_PORT=80", "match": "exact" }, { "description": "correctly identified the config path", "command": "cat /srv/service-lab/report.txt | grep '^CONFIG_PATH='", "expected_output": "CONFIG_PATH=/etc/nginx/nginx.conf", "match": "exact" }, { "description": "correctly identified the log directory", "command": "cat /srv/service-lab/report.txt | grep '^LOG_DIR='", "expected_output": "LOG_DIR=/var/log/nginx", "match": "exact" }, { "description": "nginx itself was never stopped during this exercise", "command": "pgrep -x nginx >/dev/null && echo still-running || echo stopped", "expected_output": "still-running", "match": "exact" } ] }, "default_namespace": "default", "teardown_commands": [ { "command": "rm -rf /srv/service-lab" } ] }