rc.conf

From NetBSD Wiki

Jump to: navigation, search

rc.conf(5) is the central file that handles system startup configuration. It specifies which daemons and other scripts from /etc/rc.d you want to run when the system is booted. It's basically a simple list of lines which look like this:

sshd=YES
sshd_flags="-p 8080"
dhclient=NO

which means the service called "sshd" must be started and the service called "dhclient" should not be started. It is also specified that some extra flags should be added to the commandline of the actual sshd binary, in this particular example it's told that it should listen on port 8080 instead of the default port 22 (to bypass a typical corporate firewall, for example).

You can find the default settings for all programs in /etc/defaults/rc.conf. It's only necessary to list those entries in your own /etc/rc.conf if they are different from the defaults. Generally speaking, the defaults are "no services running on external interfaces".

pkgsrc and rc.conf

Some pkgsrc programs can add rc files too, if you set

PKG_RCD_SCRIPTS=YES

when installing packages, they will install scripts in /etc/rc.d which you can control in the same way as scripts in /etc/rc.d which control service from the base system.

See also

Personal tools