A system administrator configures a web server using systemd. After creating a custom service unit file, the administrator runs `systemctl daemon-reload` but the service still fails to start with a 'Unit not found' error. What is the most likely cause?
Trap 1: The administrator forgot to run `systemctl enable` before starting…
Running `systemctl enable` creates symlinks for automatic startup but is not required to start a service. The 'Unit not found' error is unrelated to enabling.
Trap 2: The unit file is placed in /usr/lib/systemd/system/ instead of…
While placing custom units in /etc/systemd/system/ is best practice, systemd also scans /usr/lib/systemd/system/ after a daemon-reload. Therefore, this location would not cause a 'Unit not found' error.
Trap 3: The administrator is not in the 'systemd' group.
The 'systemd' group is for accessing the systemd journal, not for starting services. Group membership does not affect unit discovery.
- A
The administrator forgot to run `systemctl enable` before starting the service.
Why wrong: Running `systemctl enable` creates symlinks for automatic startup but is not required to start a service. The 'Unit not found' error is unrelated to enabling.
- B
The unit file is placed in /usr/lib/systemd/system/ instead of /etc/systemd/system/.
Why wrong: While placing custom units in /etc/systemd/system/ is best practice, systemd also scans /usr/lib/systemd/system/ after a daemon-reload. Therefore, this location would not cause a 'Unit not found' error.
- C
The administrator is not in the 'systemd' group.
Why wrong: The 'systemd' group is for accessing the systemd journal, not for starting services. Group membership does not affect unit discovery.
- D
The service name was misspelled in the `systemctl start` command.
If the service name is misspelled in `systemctl start`, systemd cannot find the unit and returns 'Unit not found'. This is the most likely cause after a daemon-reload has been performed.