View Single Post
  #6   (View Single Post)  
Old 20th July 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

During a normal boot, the kernel probes your hardware (white text on blue background appears), then starts init(8). Init runs the rc(8) script -- it's a script you should look at some time, when you're bored -- the file is /etc/rc. When output switches from white-on-blue to white-on-black, you are seeing output from rc.

The rc script mounts partitions, configures and starts your network, starts daemons (background services, such as Apache), enables the console for log in, makes configuration settings .... and any other tasks need to prepare the OS for use.

rc uses a bunch of variables, which it reads from /etc/rc.conf, which describes settings that control what rc does. One example is the "httpd_flags" variable. By default, this is set to "NO", which tells rc not to start the Apache webserver.

After reading /etc/rc.conf, and setting variables, rc will then look for and read in /etc/rc.conf.local, if the file exists, and reset any variables accoring to the value(s) found in that file. So /etc/rc.conf.local settings *override* settings in /etc/rc.conf.

For 3rd party applications that have daemons, the rc.conf and rc.conf.local files are not used, as these only contain variables which rc knows about -- settings associated with built-in daemons, primarily.

After rc has completed running, it launches /etc/rc.local. The rc.local script is where you put 3rd party daemon startup commands, since rc.conf or rc.conf.local are not used.
Reply With Quote