Ensure Service Startup on System Boot | XK0-004 CompTIA Linux+ Exam

How to Ensure a Service Starts on System Boot | XK0-004 CompTIA Linux+ Exam

Question

A junior Linux administrator needs to ensure a service will start on system boot.

Which of the following commands should be used to accomplish this task?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

https://geekflare.com/how-to-auto-start-services-on-boot-in-linux/

The correct answer is C. service <service> enable.

To ensure that a service will start on system boot in Linux, you need to enable the service. This can be accomplished using the "service" command with the "enable" option.

Here's how you can use the "service" command to enable a service:

bash
service <service> enable

Replace <service> with the name of the service that you want to enable.

For example, if you want to enable the Apache web server to start on system boot, you would use the following command:

bash
service httpd enable

The "chkconfig" command (Option A) is another way to configure system services, but it is not available on all Linux distributions. It is mainly used for legacy compatibility with older versions of Linux.

The "systemctl" command (Option B) is used to manage services in Systemd-based Linux distributions. However, the correct syntax to enable a service on boot is "systemctl enable <service>", not "systemctl <service> bootup".

The "crontab" command (Option D) is used to schedule periodic tasks and is not used to configure system services.