nerdexam
CompTIA

XK0-005 · Question #323

A user wants to configure the application "myapp" to start on runlevels 2, 3, 4, and 5 every time the system starts. Which of the following commands will accomplish this task?

The correct answer is A. chkconfig --level 2345 myapp on. The chkconfig command is used on systems employing SysV init or a hybrid system to manage services across different runlevels. The --level option specifies which runlevels a service should be enabled or disabled for.

System Management

Question

A user wants to configure the application “myapp” to start on runlevels 2, 3, 4, and 5 every time the system starts. Which of the following commands will accomplish this task?

Options

  • Achkconfig --level 2345 myapp on
  • Bsystemctl myapp on 2345
  • Cchkcinfig myapp --levels 2-5
  • Dsystemctl --levels 2345 on

How the community answered

(68 responses)
  • A
    88% (60)
  • B
    7% (5)
  • C
    3% (2)
  • D
    1% (1)

Why each option

The `chkconfig` command is used on systems employing SysV init or a hybrid system to manage services across different runlevels. The `--level` option specifies which runlevels a service should be enabled or disabled for.

Achkconfig --level 2345 myapp onCorrect

The `chkconfig --level 2345 myapp on` command correctly uses `chkconfig` to enable the `myapp` service for specific runlevels (2, 3, 4, and 5). The `--level` option followed by the runlevel numbers is the standard syntax to specify the desired runlevels for a service.

Bsystemctl myapp on 2345

`systemctl` is the command for managing services under systemd, not `chkconfig`, and its syntax for enabling services is `systemctl enable <service-name>`, not using `on 2345` for runlevels.

Cchkcinfig myapp --levels 2-5

The correct option is `--level`, not `--levels`, and the runlevels are typically listed consecutively without hyphens like `2345` when using `chkconfig` for multiple levels.

Dsystemctl --levels 2345 on

`systemctl` is for systemd, and its syntax is incorrect for specifying runlevels in this manner; systemd uses targets (like `multi-user.target`) rather than traditional runlevels.

Concept tested: Linux service management (chkconfig/runlevels)

Source: https://man7.org/linux/man-pages/man8/chkconfig.8.html

Topics

#chkconfig#Service Management#Runlevels#System Startup

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice