312-38 practice question 9 of 35

Which of the following commands can be used to disable unwanted services on Debian, Ubuntu and other Debian-based Linux distributions?

Full set: 363 questions
Answer options
A: # chkconfig [service name]off
B: # chkconfig [service name] –del
C: # service [service name] stop
D: # update-rc.d -f [service name] remove Correct answer
Correct Answer:
D. # update-rc.d -f [service name] remove
Explanation

On Debian-based Linux distributions like Ubuntu, the update-rc.d command is a utility to manage System V-style init script links. These links, located in /etc/rc.d/, control which services start or stop at different runlevels. Using the remove action with update-rc.d deletes these symbolic links, which effectively prevents the service from starting automatically upon system boot. The service command only affects the current session, and chkconfig is used on Red Hat-based systems.

Why Incorrect

A. # chkconfig [service name]off: The chkconfig command is the standard tool for managing services on Red Hat-based distributions (e.g., RHEL, CentOS), not Debian-based ones.
B. # chkconfig [service name] –del: This is also a chkconfig command for Red Hat systems, used to remove a service entirely from its management.
C. # service [service name] stop: This command stops a service for the current session only; it does not prevent the service from starting again on the next reboot.

References

The Debian Administrator's Handbook. (2022). Chapter 9. Unix Services. Retrieved from https://debian-handbook.info/browse/stable/sect.unix-services.html. (Section 9.5.1, "Starting and Stopping Services," describes the use of update-rc.d for enabling and disabling services at boot).

Ubuntu Community Help Wiki. (n.d.). Services. Retrieved from https://help.ubuntu.com/community/Services. (This page explains the use of update-rc.d for managing startup scripts in older versions and its relationship with newer tools like systemctl).

Scroll to Top