Which of the following represents a valid set of SysV init commands to control the 'apache2' service?

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

Which of the following represents a valid set of SysV init commands to control the 'apache2' service?

Explanation:
SysV init controls services by calling the init script for the service from /etc/init.d and passing a runtime action like start, stop, status, or restart. This is the classic way to manage services in SysVinit: you invoke /etc/init.d/apache2 and tell it what to do. The command that does exactly that—calling the script in /etc/init.d with the actions start, stop, status, and restart in sequence—embodies the SysVinit approach. The other options relate to different init systems or wrappers. systemctl is for systemd, not SysVinit. The wrapper via service can manage services on many distros but isn’t the direct SysVinit path. update-rc.d is for configuring boot-time runlevels and enabling/disabling services, not for issuing runtime control commands like status or restart. That’s why the direct SysVinit style command set is the correct representation.

SysV init controls services by calling the init script for the service from /etc/init.d and passing a runtime action like start, stop, status, or restart. This is the classic way to manage services in SysVinit: you invoke /etc/init.d/apache2 and tell it what to do. The command that does exactly that—calling the script in /etc/init.d with the actions start, stop, status, and restart in sequence—embodies the SysVinit approach.

The other options relate to different init systems or wrappers. systemctl is for systemd, not SysVinit. The wrapper via service can manage services on many distros but isn’t the direct SysVinit path. update-rc.d is for configuring boot-time runlevels and enabling/disabling services, not for issuing runtime control commands like status or restart. That’s why the direct SysVinit style command set is the correct representation.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy