A service called 'myapp' fails to start automatically after a system reboot. The administrator wants to ensure the service starts at boot. Which systemctl command should be used?
`systemctl enable myapp` creates the symlinks that pull the unit into the boot target's dependency tree, so systemd starts it automatically at each reboot. This directly satisfies the requirement that the service start at boot, unlike `start`, which only launches it for the current session.
Why this answer
The `systemctl enable myapp` command creates the necessary symlinks in the systemd unit configuration directories (typically `/etc/systemd/system/multi-user.target.wants/`) so that the `myapp` service is automatically started at boot. This is the correct approach because the question specifically asks to ensure the service starts after a reboot, not to start it immediately.
Exam trap
The trap here is that candidates often confuse `systemctl start` (immediate start) with `systemctl enable` (boot-time start), or they mistakenly think `systemctl reenable` is a valid command for re-enabling a service.
How to eliminate wrong answers
Option A is wrong because `systemctl daemon-reload` reloads the systemd manager configuration and unit files, but it does not enable a service to start at boot. Option B is wrong because `systemctl start myapp` starts the service immediately in the current session but does not configure it to start automatically after a reboot. Option D is wrong because `systemctl reenable myapp` is not a valid systemctl command; the correct command to re-enable a service is `systemctl enable myapp` (which can be run again to recreate symlinks), and `reenable` is a common misconception or typo.