FreeBSD 101 : Starting services (restart and onestart) - sshd_enable, /etc/rc.conf, ... -

The /etc/rc.conf configuration file:

The "/etc/rc.conf" file contains variables that services in "/etc/rc.d" use to tailor the way they start and the way they run.
"/etc/rc" script reads the "/etc/rc.conf" file to know which services 
(in the "/etc/rc.d" directory) to start at boot-time.

Enabling services:

If services are enabled in "/etc/rc.conf", for example the ssh service below, then the service "sshd" will start at boot time:

When a service is enabled in "rc.conf", we could also start it using the below command:

Non-enabled services:

If we try to start a service that is not enabled in "rc.conf" through the "service service_name start" command, we will get the below warning from the system:

To avoid that, we need to either enable the service in "rc.conf", then run the same command, or we need to use the below command that skips the "rc.conf" configuration file :


Leave as a comment: