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

update-rc.d apache2 disable

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.

systemctl disable apache2

update-rc.d apache2 enable

service apache2 disable

Want more questions?

All options are one-time payments.

$25.99

30 day pass for new members

All the basics to get you started

  • Ad-free experience
  • View your previous attempt history
  • Mobile app access
  • In-depth explanations
  • 30 day premium pass access
$59.99$171.99 usd

6 month DELUXE pass (most popular)

Full access FOR 6 MONTHS! & the ultimate digital PDF study guide (BONUS)

  • $171.99 usd value for $59.99! You save $106!
  • Ad-free experience
  • View your previous attempt history
  • Mobile app access
  • In-depth explanations
  • 6 months of full access
  • Ultimate digital PDF study guide included
  • Priority support
$15.99 $24.99

Ultimate digital PDF study guide

For those that prefer a more traditional form of learning

  • Available for instant download
  • Available offline
  • Hundreds of practice multiple choice questions
  • Comprehensive content
  • Detailed explanations
Image Description
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy