{ "id": "linux-service-state-mcq", "title": "Verifying a Service Is Actually Running", "category": "Linux Administration", "isolation_type": "shared_namespace", "difficulty": "Easy", "type": "mcq", "weight": 3, "description": "## Verifying a Service Is Actually Running\n\nA colleague says \"I restarted the service, it should be fine now.\" What's the single most reliable way to actually confirm the service is both running AND reachable on its expected port, without asking them?", "options": [ { "id": "a", "text": "Trust their statement — restarting almost always works" }, { "id": "b", "text": "Check that its process exists (e.g. via ps/pgrep) AND that its expected port is in LISTEN state (e.g. via ss) — a running process alone doesn't guarantee it bound its port successfully" }, { "id": "c", "text": "Check the service's source code for bugs" }, { "id": "d", "text": "Wait 24 hours and see if anyone complains" } ], "correct_option": "b", "explanation": "A process can be running (visible in ps) while having failed to bind its expected port (e.g. it's already in use, or it crashed after startup logging but before binding) — checking both facts independently is what actually confirms \"running and reachable,\" not either one alone.", "hints": [], "setup_commands": [], "default_namespace": "default", "teardown_commands": [] }