CompTIA Linux+ (XK0-006)TroubleshootingEasy
A system administrator has configured a new service `mydaemon.service` to start automatically on boot. After a reboot, `systemctl status mydaemon.service` shows `Active: inactive (dead)`. Upon checking `journalctl -u mydaemon.service`, the logs indicate `Failed to start My Custom Daemon: No such file or directory`. The `ExecStart` line in the service file is `ExecStart=/usr/local/bin/mydaemon`. What is the most likely issue?
- AThe permissions on `/usr/local/bin/mydaemon` are incorrect.
- BThe `mydaemon` executable is missing or incorrectly located at `/usr/local/bin/mydaemon`.
- CThe service `mydaemon.service` is not enabled to start on boot.
- DThe `Type` parameter in the service file is misconfigured.
Show answer & explanationAnswer & explanation
Correct answer: B. The `mydaemon` executable is missing or incorrectly located at `/usr/local/bin/mydaemon`.
The `journalctl` error message `Failed to start My Custom Daemon: No such file or directory` is a direct indication that the systemd service cannot find the executable specified in its `ExecStart` line. This means the `mydaemon` binary is either not present at `/usr/local/bin/mydaemon` or the path is misspelled.
Why the other options are wrong
- A. Incorrect permissions would typically result in an 'Permission denied' error, not 'No such file or directory'.
- C. If the service were not enabled, its status would be `disabled`, not `inactive (dead)` with a `Failed to start` message indicating a missing executable.
- D. A misconfigured `Type` parameter might cause other start-up issues, but not specifically a 'No such file or directory' error for the executable itself.
Systemd ExecStart 'No such file'
When a systemd service fails to start with the error `No such file or directory` for its `ExecStart` command, it means the specified executable path is invalid. The binary might be missing, misspelled, or located elsewhere than declared in the service unit file.
- Indicates executable not found.
- Check `ExecStart` path in service file.
- Verify actual file existence and path.
Memory trick: ExecStart's path must be perfectly paved.