Which of the following is a valid command to start a service using systemd?

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 is a valid command to start a service using systemd?

Explanation:
Starting a service with systemd is done through systemctl using the service’s unit name. systemctl start ssh tells systemd to launch the SSH service immediately, leveraging systemd’s unit management, dependencies, and correct startup behavior. This is the native method on systemd-based systems and works consistently across distros. The other commands either use older init methods or wrappers. service ssh start is a compatibility wrapper that may delegate to systemctl behind the scenes but is not the native systemd command. /etc/init.d/ssh start invokes a SysVinit script directly, bypassing systemd’s unit management. update-rc.d ssh enable adjusts boot-time startup for SysVinit-style init, not the immediate start of the service via systemd.

Starting a service with systemd is done through systemctl using the service’s unit name. systemctl start ssh tells systemd to launch the SSH service immediately, leveraging systemd’s unit management, dependencies, and correct startup behavior. This is the native method on systemd-based systems and works consistently across distros.

The other commands either use older init methods or wrappers. service ssh start is a compatibility wrapper that may delegate to systemctl behind the scenes but is not the native systemd command. /etc/init.d/ssh start invokes a SysVinit script directly, bypassing systemd’s unit management. update-rc.d ssh enable adjusts boot-time startup for SysVinit-style init, not the immediate start of the service via systemd.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy