rc.conf
From ArchWiki
Article summary |
---|
Details the core system configuration file used in Arch Linux. |
Available in languages |
English |
Italiano |
Русский |
简体中文 |
Nederlands |
Türkçe |
Contents |
Overview
The rc.conf file (/etc/rc.conf) is the core system configuration file used in Arch Linux. It contains several commonly-edited settings such as timezone; keymap; kernel modules; daemons to load at start-up; etc. in one convenient text file to streamline system administration.
This is what a typical rc.conf file looks like after a fresh installation:
File: /etc/rc.conf
# # /etc/rc.conf - Main Configuration for Arch Linux # # ----------------------------------------------------------------------- # LOCALIZATION # ----------------------------------------------------------------------- # # LOCALE: available languages can be listed with the 'locale -a' command # HARDWARECLOCK: set to "UTC" or "localtime" # # TIMEZONE: timezones are found in /usr/share/zoneinfo # KEYMAP: keymaps are found in /usr/share/kbd/keymaps # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US) # CONSOLEMAP: found in /usr/share/kbd/consoletrans # USECOLOR: use ANSI color sequences in startup messages # LOCALE="en_US.UTF-8" HARDWARECLOCK="localtime" TIMEZONE="Canada/Pacific" KEYMAP="us" CONSOLEFONT= CONSOLEMAP= USECOLOR="yes" # ----------------------------------------------------------------------- # HARDWARE # ----------------------------------------------------------------------- # # MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed # MOD_BLACKLIST: Prevent udev from loading these modules # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist. # # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array. # MOD_AUTOLOAD="yes" #MOD_BLACKLIST=() #deprecated MODULES=() # Scan for LVM volume groups at startup, required if you use LVM USELVM="no" # ----------------------------------------------------------------------- # NETWORKING # ----------------------------------------------------------------------- # # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts # HOSTNAME="myhost" # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces. # # Interfaces to start at boot-up (in this order) # Declare each interface then list in INTERFACES # - prefix an entry in INTERFACES with a ! to disable it # - no hyphens in your interface names - Bash doesn't like it # # DHCP: Set your interface to "dhcp" (eth0="dhcp") # Wireless: See network profiles below # eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" INTERFACES=(eth0) # Routes to start at boot-up (in this order) # Declare each route then list in ROUTES # - prefix an entry in ROUTES with a ! to disable it # gateway="default gw 192.168.0.1" ROUTES=(!gateway) # Enable these network profiles at boot-up. These are only useful # if you happen to need multiple network configurations (ie, laptop users) # - set to 'menu' to present a menu during boot-up (dialog package required) # - prefix an entry with a ! to disable it # # Network profiles are found in /etc/network.d # # This now requires the netcfg package # #NET_PROFILES=(main) # ----------------------------------------------------------------------- # DAEMONS # ----------------------------------------------------------------------- # # Daemons to start at boot-up (in this order) # - prefix a daemon with a ! to disable it # - prefix a daemon with a @ to start it up in the background # DAEMONS=(syslog-ng network netfs crond)
Localization
- LOCALE: This sets your system language, which will be used by all i18n-friendly applications and utilities. You can get a list of the available locales by running locale -a from the command line. This setting's default is fine for US English users.
- HARDWARECLOCK: Specifies whether the hardware clock, which is synchronized from on bootup and to on shutdown, stores UTC time, or the localtime. UTC makes sense because it greatly simplifies changing timezones and daylight savings time. localtime is necessary if you dual boot with an operating system that only stores localtime to the hardware clock, such as Windows.
- Note: GNU/Linux will change to-and-from DST when the HARDWARECLOCK setting is set to UTC, regardless of whether GNU/Linux was running at the time DST is entered or left. When the HARDWARECLOCK setting is set to localtime, GNU/Linux will not adjust the time, operating under the assumption that your system may be a dual-boot system at that time and that the other OS takes care of the DST switch. If that was not the case, the DST change needs to be made manually.
- TIMEZONE: Specifies your time zone. Possible time zones are the relative path to a zoneinfo file starting from the directory /usr/share/zoneinfo. For example, a German timezone would be Europe/Berlin, which refers to the file /usr/share/zoneinfo/Europe/Berlin.
- KEYMAP: The keyboard layout you want to use. If you live in the US, you probably use qwerty, which is referred using us (default). The available keymaps are in /usr/share/kbd/keymaps. Please note that this setting is only valid for your TTYs, not any graphical window managers or X!
- CONSOLEFONT: Defines the console font to load with the setfont program on boot-up. Possible fonts are found in /usr/share/kbd/consolefonts. For more info see: Fonts#Console fonts
- CONSOLEMAP: Defines the console map to load with the setfont program on boot-up. Possible maps are found in /usr/share/kbd/consoletrans. You will want to set this to a map suitable for your locale (8859-1 for Latin1, for example) if you use an utf8 locale above and use programs that generate 8-bit output. If using X11 for everyday work, note that this only affects the output of console applications.
- USECOLOR: Enable (or disable) colorized status messages during boot-up.
Hardware
- MOD_AUTOLOAD: If set to "yes", Arch will scan your hardware at boot-up and attempt to automatically load the proper modules for your system. This is done with udev.
- MOD_BLACKLIST: Deprecated. Prefix modules with a bang (!) in the MODULES array to blacklist them.
- MODULES: In this array you can list the names of modules you want to load during boot-up without the need to bind them to a hardware device as in modprobe.conf. Simply add the name of the module here, and put any options into modprobe.conf if need be. Prepending a module with a bang (!) will blacklist the module during boot-up.
- Tip: A benefit of specifying networking modules here is that Ethernet cards covered by the listed modules will always be detected in the order the modules are listed. This prevents the dreaded interface confusion where your Ethernet hardware is assigned to seemingly random interfaces after each boot. An even better way to handle this is using static interface labels by configuring udev appropriately, though.
- USELVM: Scan for LVM volume groups at startup, required if you use LVM. Set to "YES" runs a vgchange during sysinit.
Networking
- HOSTNAME: Set this to the hostname of the machine, without the domain part. This is totally your choice, as long as you stick to letters, digits and a few common special characters like the dash. Don't be too creative here, though, and when in doubt, use the default.
- INTERFACES: Here you define the settings for your networking interfaces. The default lines and the included comments explain the setup well enough. If you do not use DHCP to configure a device, just keep in mind that the value of the variable (whose name must be equal to the name of the device which is supposed to be configured) equals the line which would be appended to the ifconfig command if you were to configure the device manually in the shell.
- ROUTES: You can define your own static network routes with arbitrary names here. Look at the example for a default gateway to get the idea. Basically the quoted part is identical to what you'd pass to a manual route add command, therefore reading man route is recommended if you don't know what to write here, or simply leave this alone.
- NETWORKS: This enables certain network profiles at boot-up. Network profiles provide a convenient way of managing multiple network configurations, and are intended to replace the standard INTERFACES/ROUTES setup that is still recommended for systems with only one network configuration. If your computer will be participating in various networks at various times (e.g., a laptop) then you can configure profiles in the /etc/network.d/ directory. There are template files included there (/etc/network.d/examples/) that can be used to create new profiles.
- Note: Since the introduction of netcfg v2.0 NET_PROFILES has been changed to this. This new version also contains many revisions, including the path to the stored profiles. Please see Network Profiles for more info. In general, the NETWORKS line should work the same way as the NET_PROFILES line, assuming you have the profiles in the new path (/etc/network.d/), and have changed any syntax necessary to accommodate for the new version.
Daemons
- DAEMONS: This array simply lists the names of those scripts contained in /etc/rc.d/ which are supposed to be started during the boot process. If a script name is prefixed with a bang (!), it is not executed. If a script is prefixed with an "at" symbol (@), then it will be executed in the background, i.e. the startup sequence will not wait for successful completion before continuing. Usually you do not need to change the defaults to get a running system, but you are going to edit this array whenever you install system services like sshd, and want to start these automatically during boot-up. This is basically Arch's way of handling what others handle with various symlinks to an init.d directory.
- Note: The order in which the daemons are listed is important as they are loaded in that order.