CompTIA Linux+ (XK0-006)Services and User ManagementEasy
A system administrator is configuring a new Linux server and needs to ensure that the `firewalld` service is started automatically every time the system boots up. Which `systemctl` command should the administrator use to achieve this?
- Asudo systemctl start firewalld
- Bsudo systemctl activate firewalld
- Csudo systemctl boot firewalld
- Dsudo systemctl enable firewalld
Show answer & explanationAnswer & explanation
Correct answer: D. sudo systemctl enable firewalld
The `systemctl enable` command is used to create the necessary symbolic links to ensure a service starts automatically at boot.
Why the other options are wrong
- A. `systemctl start` only starts the service for the current session, it does not enable it for future boots.
- B. `systemctl activate` is not a standard `systemctl` subcommand for enabling services at boot.
- C. `systemctl boot` is not a valid `systemctl` subcommand.
systemctl enable
The `systemctl enable` command is used to configure a `systemd` service to start automatically upon system boot.
- Creates symbolic links to allow `systemd` to start the service.
- Does not start the service immediately, only configures auto-start.
- Opposite of `systemctl disable`.
Memory trick: Enable the engine to always start the journey.