How would you stop a service from starting at startup on SysV-style systems?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

How would you stop a service from starting at startup on SysV-style systems?

Explanation:
On SysV-style init, boot-time starting is controlled by links in the runlevel directories that point to the service scripts. To prevent a service from starting at boot, you remove or disable those links so the service won’t be started automatically. Using update-rc.d with disable does exactly that: it removes the startup links for the service across all runlevels, so it won’t auto-start on boot. This is the standard tool for SysV init systems (as opposed to systemd, where you’d use systemctl). Enabling would do the opposite and create the startup links again. The idea of “disable” with the service command isn’t a standard, universally supported option, so the SysV approach is the correct one. If the service is currently running, you’d still need to stop it separately with a stop command.

On SysV-style init, boot-time starting is controlled by links in the runlevel directories that point to the service scripts. To prevent a service from starting at boot, you remove or disable those links so the service won’t be started automatically.

Using update-rc.d with disable does exactly that: it removes the startup links for the service across all runlevels, so it won’t auto-start on boot. This is the standard tool for SysV init systems (as opposed to systemd, where you’d use systemctl). Enabling would do the opposite and create the startup links again. The idea of “disable” with the service command isn’t a standard, universally supported option, so the SysV approach is the correct one. If the service is currently running, you’d still need to stop it separately with a stop command.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy