nerdexam
CompTIA

XK0-004 · 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 the correct SysV-init tool for enabling a service on specific runlevels, and its syntax requires --level followed by concatenated runlevel digits.

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
  • Cchkcinfig myapp --levels 2-5
  • Dsystemctl --levels 2345 on

How the community answered

(31 responses)
  • A
    87% (27)
  • C
    3% (1)
  • D
    10% (3)

Why each option

The chkconfig command is the correct SysV-init tool for enabling a service on specific runlevels, and its syntax requires --level followed by concatenated runlevel digits.

Achkconfig --level 2345 myapp onCorrect

The command 'chkconfig --level 2345 myapp on' correctly uses the chkconfig utility to enable 'myapp' at runlevels 2, 3, 4, and 5. The --level flag accepts a concatenated string of runlevel digits, and specifying 'on' sets the service to start automatically at those runlevels, persisting the configuration across reboots via the /etc/rc.d symlinks.

Cchkcinfig myapp --levels 2-5

'chkcinfig' is a misspelling of chkconfig, and '--levels 2-5' is not valid syntax - the correct flag is '--level' (singular) and runlevels must be listed as concatenated digits, not a hyphenated range.

Dsystemctl --levels 2345 on

systemctl does not accept a --levels flag; on systemd-based systems services are enabled with 'systemctl enable', and systemd uses targets rather than numeric runlevel notation.

Concept tested: chkconfig service runlevel management on Linux

Source: https://linux.die.net/man/8/chkconfig

Topics

#chkconfig#runlevels#service management#system startup

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice