A system administrator notices that a service named 'myapp' fails to start on a Linux server. The command 'systemctl status myapp' shows 'Active: failed (Result: exit-code)'. Which of the following is the BEST first step to diagnose the issue?
Trap 1: Run 'dmesg' to view kernel messages.
dmesg shows kernel messages, not service-specific errors.
Trap 2: Run 'ps aux | grep myapp' to check if the process is running.
This only checks if the process is present, not why it failed to start.
Trap 3: Edit the service file with 'systemctl edit myapp' and increase…
Modifying configuration without knowing the cause can introduce new issues.
- A
Run 'journalctl -u myapp.service' to inspect the service logs.
journalctl with the unit flag shows logs for that specific service, revealing startup errors.
- B
Run 'dmesg' to view kernel messages.
Why wrong: dmesg shows kernel messages, not service-specific errors.
- C
Run 'ps aux | grep myapp' to check if the process is running.
Why wrong: This only checks if the process is present, not why it failed to start.
- D
Edit the service file with 'systemctl edit myapp' and increase timeout values.
Why wrong: Modifying configuration without knowing the cause can introduce new issues.