nerdexam
CompTIA

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.

System Management

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)
  • A
    92% (60)
  • B
    2% (1)
  • C
    2% (1)
  • D
    5% (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.

Asystemctl start httpd;chkconfig httpd onCorrect

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.

Bsystemctl status httpd;chkconfig httpd on

`systemctl status httpd` only shows the current status of the service; it does not start it.

Csystemctl.start httpd;chkconfig httpd on

`systemctl.start` is a syntax error; the correct command is `systemctl start`.

Dsystemctl start httpd;chkconfig httpd on 6

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

#Linux Services#systemd#chkconfig#Service Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice