How would you make a SysV-compatible service run at startup?

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 make a SysV-compatible service run at startup?

Explanation:
SysV init starts services based on the links in /etc/rc*.d that point to /etc/init.d scripts. To make a SysV-compatible service run at startup, you create those startup links for the default runlevels. The command that does this is update-rc.d with enable, which registers the Apache init script so that S… links appear in the boot runlevels (and corresponding K links for shutdown). This means the service will be started automatically when the system enters those runlevels. The other options don’t fit: systemctl enable is for systemd units, not SysV scripts; disabling would prevent startup; and service enable isn’t a valid boot-time enabling command for SysV init.

SysV init starts services based on the links in /etc/rc*.d that point to /etc/init.d scripts. To make a SysV-compatible service run at startup, you create those startup links for the default runlevels. The command that does this is update-rc.d with enable, which registers the Apache init script so that S… links appear in the boot runlevels (and corresponding K links for shutdown). This means the service will be started automatically when the system enters those runlevels. The other options don’t fit: systemctl enable is for systemd units, not SysV scripts; disabling would prevent startup; and service enable isn’t a valid boot-time enabling command for SysV init.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy