Difference between revisions of "Initscripts/rc.conf"

From ArchWiki
Jump to: navigation, search
m (added turkish wiki link)
(netcfg doesn't use rc.conf anymore)
Line 87: Line 87:
 
; {{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.  Should also be put in {{ic|/etc/hosts}}. The contents of {{ic|/etc/hostname}} (if not empty) takes precedence.
 
; {{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.  Should also be put in {{ic|/etc/hosts}}. The contents of {{ic|/etc/hostname}} (if not empty) takes precedence.
  
=== Single Interface ===
+
=== Interface configuration ===
 +
{{ic|rc.conf}} only supports the configuration of a single interface. For the configuration of multiple interfaces or other advanced network configurations like bridging, use [[netcfg]].
 +
 
 
; {{ic|interface}}: name of device (required)
 
; {{ic|interface}}: name of device (required)
 
; {{ic|address}}: IP address (leave blank for DHCP)
 
; {{ic|address}}: IP address (leave blank for DHCP)
Line 104: Line 106:
 
gateway=</nowiki>}}
 
gateway=</nowiki>}}
 
{{Note|Make sure to add {{ic|network}} to {{ic|DAEMONS}}  {{bc|<nowiki>DAEMONS=(... network sshd)</nowiki>}}}}
 
{{Note|Make sure to add {{ic|network}} to {{ic|DAEMONS}}  {{bc|<nowiki>DAEMONS=(... network sshd)</nowiki>}}}}
 
=== Multiple Interface ===
 
The [[netcfg|Netcfg]] package is used to configure multiple interfaces by creating a network profile for each interface.  See [[Netcfg#Configuration|Netcfg Configuration]] for setup and configuration.
 
# For each interface create a net-profile file at {{ic|/etc/network.d/profilename}}
 
## Static Example: {{ic|/etc/network.d/eth0-static}} {{bc|<nowiki>CONNECTION='ethernet'
 
DESCRIPTION='A static ethernet connection for interface eth0'
 
INTERFACE='eth0'
 
IP='static'
 
ADDR='192.168.1.24'
 
NETMASK='255.255.255.0'
 
BROADCAST='192.168.1.255'
 
GATEWAY='192.168.1.1'</nowiki>}}
 
## DHCP Example: {{ic|/etc/network.d/eth1-dhcp}} {{bc|<nowiki>CONNECTION='ethernet'
 
DESCRIPTION='A basic dhcp ethernet connection on eth1'
 
INTERFACE='eth1'
 
IP='dhcp'</nowiki>}}
 
# Add each net-profile to the {{ic|NETWORKS}} array.{{bc|<nowiki>NETWORKS=(eth0-static eth1-dhcp)</nowiki>}}
 
# Add {{ic|net-profiles}} to the list of {{ic|DAEMONS}}{{bc|<nowiki>DAEMONS=(... net-profiles sshd)</nowiki>}}
 
 
 
=== Network Persist ===
 
=== Network Persist ===
 
The {{ic|NETWORK_PERSIST}} variable tells the system whether or not to skip network shutdown. This is required if your root device is on NFS. The default setting is "no".
 
The {{ic|NETWORK_PERSIST}} variable tells the system whether or not to skip network shutdown. This is required if your root device is on NFS. The default setting is "no".

Revision as of 20:43, 13 May 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 – فارسی

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary end

/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. (current version):

/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

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. See Time for more information.
  1. UTC makes sense because it greatly simplifies changing timezones and daylight savings time. Linux will change to-and-from DST, regardless of whether Linux was running at the time DST is entered or left.
  2. localtime is necessary if you dual boot with an operating system that only stores localtime, such as Windows. 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.
  3. empty: fall back to the value in /var/lib/hwclock/adjtime, which defaults to UTC. This is recommended as other users of hwclock might change the adjtime file and hence cause rc.conf and adjtime to be out of sync
  4. any other value will result in the hardware clock being left untouched (useful for virtualization)
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.
Tip: 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.
Note: 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 (only needed for non-US). FONT in /etc/vconsole.conf takes precedence. For more info see: 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. FONT_MAP in /etc/vconsole.conf takes precedence.
Note: 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

MODULES
Modules to load at boot-up in addition to auto-loaded ones. To blacklist modules, see Kernel modules#Blacklisting.
Note: MOD_AUTOLOAD is deprecated as of initscripts 2011.06.1-1, you can use udev rules to achieve the same effect.
Tip: Some modules may not be loaded in the order they are listed, as they might also be loaded on-demand by udev. For consistent network interface names between boots, create the appropriate udev rules.
USEDMRAID
Scan for FakeRAID (dmraid) Volumes at startup (runs dmraid -i -ay).
USEBTRFS
Scan for BTRFS volumes at startup. Runs btrfs device scan from /etc/rc.sysinit.
USELVM
Scan for LVM volume groups at start-up, which is required if you use LVM. Setting to YES runs vgchange --sysinit -a y (handled by activate_vgs() function) 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. Should also be put in /etc/hosts. The contents of /etc/hostname (if not empty) takes precedence.

Interface configuration

rc.conf only supports the configuration of a single interface. For the configuration of multiple interfaces or other advanced network configurations like bridging, use netcfg.

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

Network Persist

The NETWORK_PERSIST variable tells the system whether or not to skip network shutdown. This is required if your root device is on NFS. The default setting is "no".

# default
NETWORK_PERSIST="no"

# NFS-based root device
# NETWORK_PERSIST="yes"

Daemons

DAEMONS
A space-separated list of scripts located in /etc/rc.d/ which are started during the boot process. 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
  1. If a script name is prefixed with a bang (!), it is not executed.
  2. 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.
Example:
DAEMONS=(@syslog-ng !network net-profiles crond sshd)
Note: The order in which the daemons are listed is important as they are loaded in that order.