Difference between revisions of "Initscripts/rc.conf"

From ArchWiki
Jump to: navigation, search
m (ul to dl, minor whitespace fixes)
(move to dl from ul, rearrange, add descriptions and examples)
Line 86: Line 86:
  
 
==Networking==
 
==Networking==
* {{ic|[[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.
+
; {{ic|[[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.
* There are now 2 ways to configure networking in {{ic|/etc/rc.conf}}.  The "Single Interface" (interface,address,netmask,gateway) way and the {{ic|NETWORKS}}/[[netcfg]] way.  The {{ic|DAEMONS}} variable must reflect which method you are using.
+
 
** Single {{ic|interface}}:
+
=== Single Interface ===
*# Edit the four variables: {{ic|interface}}, {{ic|address}}, {{ic|netmask}}, and {{ic|gateway}} in {{ic|/etc/rc.conf}}.
+
; {{ic|interface}}: name of device (required)
*# USE THE {{ic|network}} DAEMON in {{ic|DAEMONS}}.
+
: {{bc|1=interface="eth0"}}
** {{ic|NETWORKS}}/[[netcfg]]:
+
; {{ic|address}}: IP address (leave blank for DHCP)
*#Configure [[netcfg]] profiles in {{ic|/etc/network.d}}.
+
: {{bc|1=address="192.168.1.1"}}
*#list them in {{ic|NETWORKS}} in {{ic|/etc/rc.conf}}.
+
; {{ic|netmask}}: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
*# USE THE {{ic|net-profiles}} DAEMON IN {{ic|DAEMONS}}.
+
: {{bc|1=netmask="255.255.255.0"}}
 +
; {{ic|broadcast}}:  broadcast address (ignored for DHCP) (optional)
 +
: {{bc|1=broadcast="255.255.255.0"}}
 +
; {{ic|gateway}}: default route (ignored for DHCP)
 +
: {{bc|1=gateway="192.168.1.1"}}
 +
{{Note|Make sure to add {{ic|network}} to {{ic|DAEMONS}} {{bc|<nowiki>DAEMONS=(... network sshd)</nowiki>}}}}
 +
 
 +
=== Multiple Interface ===
 +
# For each interface create a net-profile in /etc/network.d/profilename
 +
# Add each net-profile to the {{ic|NETWORKS}} array.  {{bc|<nowiki>NETWORKS=( eth0-static eth1-static firewire0-static )</nowiki>}}
 +
# Add {{ic|net-profiles}} to the list of {{ic|DAEMONS}} {{bc|<nowiki>DAEMONS=(... net-profiles sshd)</nowiki>}}
  
 
==Daemons==
 
==Daemons==
 
* {{ic|[[DAEMONS]]}}: This array simply lists the names of those scripts contained in {{ic|/etc/rc.d/}} which are supposed to be started during the boot process. Entries to this list are separated with a space. If a script name is prefixed with a bang ({{ic|!}}), it is not executed. If a script is prefixed with an "at" symbol ({{ic|@}}), 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 {{ic|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 {{ic|init.d}} directory.  For more info see: [[Writing rc.d scripts]]
 
* {{ic|[[DAEMONS]]}}: This array simply lists the names of those scripts contained in {{ic|/etc/rc.d/}} which are supposed to be started during the boot process. Entries to this list are separated with a space. If a script name is prefixed with a bang ({{ic|!}}), it is not executed. If a script is prefixed with an "at" symbol ({{ic|@}}), 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 {{ic|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 {{ic|init.d}} directory.  For more info see: [[Writing rc.d scripts]]
 
: {{Note|The order in which the daemons are listed is important as they are loaded in that order.}}
 
: {{Note|The order in which the daemons are listed is important as they are loaded in that order.}}

Revision as of 09:20, 26 February 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Details the core system configuration file used in Arch Linux.
Related
Arch Boot Process

/etc/rc.conf is the system configuration file for Arch-specific settings. It contains several commonly-edited settings such as timezone; keymap; kernel modules; daemons to load at start-up; etc.

Overview

The overall look of the rc.conf file has recently (Jan 2012) changed. Many of the comments have been moved and expanded into a manpage. This is what a typical rc.conf file looks like on an up-to-date Arch install. (source):

/etc/rc.conf
#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# See 'man 5 rc.conf' for more details
#

# LOCALIZATION
# ------------
HARDWARECLOCK="UTC"
TIMEZONE=
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
LOCALE="en_US.UTF-8"
DAEMON_LOCALE="yes"
USECOLOR="yes"

# HARDWARE
# --------
MODULES=()
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"

# NETWORKING
# ----------
HOSTNAME="myhost"

interface=
address=
netmask=
broadcast=
gateway=

NETWORK_PERSIST="no"

# DAEMONS
# -------
#
DAEMONS=(syslog-ng network crond)

Localization

Localization

HARDWARECLOCK
Specifies whether the hardware clock, which is synchronized from on bootup and to on shutdown, stores UTC time, or the localtime. If this value is not set, then the value stored by hwclock in /var/lib/hwclock/adjtime is used instead. 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: Linux will change to-and-from DST when the HARDWARECLOCK setting is set to UTC, regardless of whether Linux was running at the time DST is entered or left. When the HARDWARECLOCK setting is set to localtime, 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. If this value is not set, the timezone is left as it is and it can be reset by manually changing /etc/localtime.
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 (ter-v14b for example). 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 (8859-1_to_uni for example). 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.
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. The LANG variable in /etc/locale.conf takes precedence if it is set, and users of login shells that cannot source /etc/rc.conf, should set that value instead.
DAEMON_LOCALE
If set to yes, use $LOCALE as the locale during daemon startup and during the boot process. If set to no, the C locale is used. Default value is yes.
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.
Note: MOD_AUTOLOAD is deprecated as of initscripts 2011.06.1-1 and has no effect. You can use udev rules to achieve the same effect.
MODULES
In this array you can list the names of modules you want to load during boot in addition to the auto-loaded ones.
Note: Blacklisting modules in /etc/rc.conf has been obsoleted and no longer works as of initscripts 2011.06.1-1. All blacklisting instructions need to be included in /etc/modprobe.d/.
Note: It is not guaranteed that the modules listed here are loaded in the order in which they are listed, as they might also be loaded on-demand by udev. In order to ensure that e.g. network interfaces are named consistently between boots, the best way is to create the appropriate udev rules.
USELVM
Scan for LVM volume groups at start-up, which is required if you use LVM. Setting 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.

Single Interface

interface
name of device (required)
interface="eth0"
address
IP address (leave blank for DHCP)
address="192.168.1.1"
netmask
subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
netmask="255.255.255.0"
broadcast
broadcast address (ignored for DHCP) (optional)
broadcast="255.255.255.0"
gateway
default route (ignored for DHCP)
gateway="192.168.1.1"
Note: Make sure to add network to DAEMONS
DAEMONS=(... network sshd)

Multiple Interface

  1. For each interface create a net-profile in /etc/network.d/profilename
  2. Add each net-profile to the NETWORKS array.
    NETWORKS=( eth0-static eth1-static firewire0-static )
  3. Add net-profiles to the list of DAEMONS
    DAEMONS=(... net-profiles sshd)

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. Entries to this list are separated with a space. 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. For more info see: Writing rc.d scripts
Note: The order in which the daemons are listed is important as they are loaded in that order.