rc.conf - Configuring your System Startup


rc.conf contains the majority of configuration options for initialising/starting your OpenBSD system.

Although many texts specify you can make your changes in this file (/etc/rc.conf) it is also recommended by the man pages that you leave this file pristine (as is) and make your system specific changes in a new file /etc/rc.conf.local

Changes you make in the /etc/rc.conf.local file will override settings in /etc/rc.conf.

rc.conf.local - A localised version of rc.conf

The file, reflecting the rc.conf file, should be divided into THREE sections.

1. Section 1: Setting Programs that require Features turned on or off

2. Section 2: Start/Stop Programs that do not need parameters

3. Section 3: Configuring information for programs started above. Ignored if servers are not started.

File: /etc/rc.conf.local

# ##
# SECTION 1 - Turn Features on/off
# ##

# ##
# SECTION 2 - Switch Programs On/Off
# ##

# ##
# SECTION 3 - Configuration Options
# ##

shlib_dirs = ""
Diagram - Sample of /etc/rc.conf.local

Section 1 - Turn Features On

This section is where you set parameters for programs that need to be started with different types of options.

For example, sendmail is usually started with different options depending on whether you wish to process queues only, or also set up smtp processing.

# ##
# SECTION 1 - Turn Features on/off
# ##
xdm_flags = ""                # use two double-quotes
sendmail  = "-bd –q30m"       # for normal use: "-bd -q30m" 
ftpd_flags= "-DllUSA"         # for non-inetd use: ftpd_flags="-D"
Diagram - Sample of Section 1

The above settings override the default /etc/rc.conf settings.

xdm_flags now specifies to start xdm (previously it was xdm=NO.) The sendmail directive now specifies the use of '-bd' whereas the default specification is without '-bd'

The ftpd_flags are read by the start up scripts and specify parameters for the ftpd daemon.

Section 2 - Switch Programs On

This section is for programs that merely need to be turned on or off. For example this is a good place for programs that get their configuration information from configuration files and not from command-line arguments.

# ##
# SECTION 2 - Start/Stop Programs that do not require parameters
# ##
Diagram - Sample of Section 2

The above modifications tells rc.local to start the mysql services, but not to start the Samba services (smbd, and nmbd.)

Section 3 - Configuration Options

In this section we specify directives for programs started in either Section 1 or Section 2. These directives will either be read when programs are activated or ignored when programs are not activated.

We can also place in here other directives that may be reviewed by the scripts in /etc/rc

# ##
# ##
shlib_dirs="$shlib_dirs /new/path1 /new/path2"
Diagram - Sample of Section 3

The above changes to shlib_dirs expands the existing shlib_dirs read from /etc/rc.conf ($shlib_dirs) and adds two new paths to shlib_dirs. Note that a space is used as the separator. You can also use multiple lines of shlib_dirs. Refer: rc.conf(8), ldconfig(8). Because the script reading /etc/rc.conf{.loca,} is Bourne Shell you can also use settings like shlib_dirs="/usr/local/lib/{path1,path2,path3,}

WARNING: There are no spaces between shlib_dirs, the "=" sign, and the first quote "


Author and Copyright

Copyright (c) 2000/1/2 Samiuela LV Taufa. All Rights Reserved.

I reserve the right to be totally incorrect even at the best advice of betters. In other words, I'm probably wrong in enough places for you to call me an idiot, but don't 'cause you'll hurt my sensibilities, just tell me where I went wrong and I'll try again.

You are permitted and encouraged to use this guide for fun or for profit as you see fit. If you republish this work in what-ever form, it would be nice (though not enforceable) to be credited.

rc.conf - Configuring OpenBSD's startup

Copyright  © 2000/1/2 NoMoa.COM All rights reserved.