XK0-005 · Question #296
A Linux administrator has downloaded and installed the httpd package. Which of the following commands will start the service immediately and allow the service to start on system boot?
The correct answer is A. systemctl start httpd;chkconfig httpd on. To manage services on modern Linux systems, systemctl is used to start services immediately, and chkconfig (or more commonly systemctl enable) is used to configure them to start on boot.
Question
A Linux administrator has downloaded and installed the httpd package. Which of the following commands will start the service immediately and allow the service to start on system boot?
Options
- Asystemctl start httpd;chkconfig httpd on
- Bsystemctl status httpd;chkconfig httpd on
- Csystemctl.start httpd;chkconfig httpd on
- Dsystemctl start httpd;chkconfig httpd on 6
How the community answered
(65 responses)- A92% (60)
- B2% (1)
- C2% (1)
- D5% (3)
Why each option
To manage services on modern Linux systems, `systemctl` is used to start services immediately, and `chkconfig` (or more commonly `systemctl enable`) is used to configure them to start on boot.
The command `systemctl start httpd` immediately starts the `httpd` service. The command `chkconfig httpd on` configures the service to start automatically during the boot process across different runlevels, though `systemctl enable httpd` is the more modern and preferred method for persistent enablement.
`systemctl status httpd` only shows the current status of the service; it does not start it.
`systemctl.start` is a syntax error; the correct command is `systemctl start`.
Adding `6` to `chkconfig httpd on` is incorrect syntax; `chkconfig` manages runlevels implicitly or with specific options, not as a bare number at the end of `on`.
Concept tested: Starting and enabling systemd services
Source: https://man7.org/linux/man-pages/man1/systemctl.1.html
Topics
Community Discussion
No community discussion yet for this question.