Difference between revisions of "Initscripts/rc.conf"

From ArchWiki
Jump to: navigation, search
m (New configuration file: link directly to sytemd configuration files)
(deprecated configuration, redirect)
 
(32 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:About Arch]]
+
#REDIRECT: [[SysVinit]]
[[Category:Boot process]]
+
[[cs:Rc.conf]]
+
[[de:rc.conf]]
+
[[es:Rc.conf]]
+
[[fr:rc.conf]]
+
[[it:Rc.conf]]
+
[[nl:Rc.conf]]
+
[[ro:rc.conf]]
+
[[ru:Rc.conf]]
+
[[sr:Rc.conf]]
+
[[tr:rc.conf]]
+
[[uk:Rc.conf]]
+
[[zh-CN:Rc.conf]]
+
{{Lowercase title}}
+
{{Article summary start}}
+
{{Article summary text|Details the core system configuration file used in Arch Linux.}}
+
{{Article summary heading|Related}}
+
{{Article summary wiki|Arch Boot Process}}
+
{{Article summary end}}
+
{{ic|/etc/rc.conf}} is the configuration file for Arch's initscripts. It configures what daemons to start at boot, the basic network daemon, and certain aspects of hardware discovery.
+
 
+
==Overview==
+
 
+
This is what a typical {{ic|rc.conf}} file looks like on an up-to-date Arch install. ([https://projects.archlinux.org/initscripts.git/tree/rc.conf current version]):
+
 
+
{{hc|/etc/rc.conf|<nowiki>
+
#
+
# /etc/rc.conf - configuration file for initscripts
+
#
+
# Most of rc.conf has been replaced by various other configuration
+
# files. See archlinux(7) for details.
+
#
+
# For more details on rc.conf see rc.conf(5).
+
#
+
 
+
DAEMONS=(syslog-ng network crond)
+
 
+
# Storage
+
#
+
# USEDMRAID="no"
+
# USELVM="no"
+
 
+
# Network
+
#
+
# interface=
+
# address=
+
# netmask=
+
# gateway=
+
</nowiki>}}
+
 
+
== New configuration file ==
+
In the past used to also contain configurations for other parts of the system. Unless you are using an alternate init system like [[systemd]], {{ic|/etc/rc.conf}} configures which daemons to start during boot-up and some networking and storage information.
+
 
+
{{Note|Using the legacy configuration options in {{ic|/etc/rc.conf}} for system configuring still works (for now) with the default init system, but the new configuration files take precedence and using them is recommended. The new files will also work for configuring [[systemd]]. See [[Systemd#Native_systemd_configuration_files]]}}
+
 
+
{| class="wikitable"
+
|-
+
! scope="col"| Configuration
+
! scope="col"| Configuration file(s)
+
! scope="col"| Legacy [https://projects.archlinux.org/initscripts.git/tree/rc.conf?id=97f0cd6751e8d22c14d7492cdc2186cf41157ba6 rc.conf] section
+
|-
+
| align="center"|Hostname
+
| align="left"|{{ic|/etc/hostname}}
+
{{ic|/etc/hosts}}
+
| align="center"|{{ic|NETWORKING}}
+
|-
+
| align="center"|Console fonts and keymap
+
| align="left"|{{ic|/etc/vconsole.conf}}
+
| align="center"|{{ic|LOCALIZATION}}
+
|-
+
| align="center"|Locale
+
| align="left"|{{ic|/etc/locale.conf}}
+
{{ic|/etc/locale.gen}}
+
| align="center"|{{ic|LOCALIZATION}}
+
|-
+
| align="center"|Timezone
+
| align="left"|{{ic|/etc/localtime}}
+
| align="center"|{{ic|LOCALIZATION}}
+
|-
+
| align="center"|Hardware clock
+
| align="left"|{{ic|/etc/adjtime}}
+
| align="center"|{{ic|LOCALIZATION}}
+
|-
+
| align="center"|Kernel modules
+
| align="left"|{{ic|/etc/modules-load.d/}}
+
| align="center"|{{ic|HARDWARE}}
+
|-
+
| align="center"|Daemons
+
| align="left"|{{ic|/etc/rc.conf}}
+
| align="center"|{{ic|DAEMONS}}
+
|-
+
| align="center"|Wired network
+
| align="left"|{{ic|/etc/rc.conf}}
+
| align="center"|{{ic|NETWORKING}}
+
|}
+
 
+
Configuration files can simply be created if they do not exist already and you wish to change the defaults.
+
 
+
==Daemons==
+
; [[DAEMONS]]: A space-separated list of scripts located in {{ic|/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 {{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]]
+
:# 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.
+
: Example:
+
: {{bc|<nowiki>DAEMONS=(@syslog-ng !network net-profiles crond sshd)</nowiki>}}
+
: {{Note|The order in which the daemons are listed is important as they are loaded in that order.}}
+
 
+
==Hardware==
+
; USEDMRAID: Scan for FakeRAID (dmraid) Volumes at startup (runs {{ic|dmraid -i -ay}}).
+
; USELVM: Scan for [[LVM]] volume groups at start-up, which is required if you use LVM. Setting to {{ic|YES}} runs {{ic|vgchange --sysinit -a y}} (handled by activate_vgs() function) during sysinit.
+
; {{Note|USEBTRFS is no longer needed, as it is taken care of by udev.}}
+
 
+
=== 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]].
+
 
+
; 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)
+
 
+
{{hc|Static IP Example|<nowiki>interface=eth0
+
address=192.168.0.2
+
netmask=255.255.255.0
+
broadcast=192.168.0.255
+
gateway=192.168.0.1</nowiki>}}
+
{{hc|DHCP example|<nowiki>interface=eth0
+
address=
+
netmask=
+
gateway=</nowiki>}}
+
{{Note|Make sure to add {{ic|network}} to {{ic|DAEMONS}}  {{bc|<nowiki>DAEMONS=(... network sshd)</nowiki>}}
+
or, if using [[netcfg]], add {{ic|net-profiles}}  {{bc|<nowiki>DAEMONS=(... !network net-profiles sshd)</nowiki>}}
+
}}
+
 
+
==Modules==
+
; MODULES: {{Warning|Modules to be autoloaded at boot are now specified in {{ic|/etc/modules-load.d/}}, and modules to be blacklisted are now specified in {{ic|/etc/modprobe.d/}}.}}
+
Modules to load at boot-up in addition to auto-loaded ones, to do this see [[Kernel modules#Loading]], and to blacklist modules, see [[Kernel modules#Blacklisting]].
+
: {{Note|{{ic|MOD_AUTOLOAD}} is deprecated as of {{Pkg|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 [[Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot|appropriate udev rules]].}}
+
 
+
==Localization==
+
; HARDWARECLOCK: {{Warning|This setting is now configured in {{ic|/etc/adjtime}}.}} Specifies whether the hardware clock, which is synchronized from on bootup and to on shutdown, stores {{ic|UTC}} time, or the {{ic|localtime}}. If this value is not set, then the value stored by hwclock in {{ic|/var/lib/hwclock/adjtime}} is used instead. See [[Time]] for more information.
+
:# {{ic|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.
+
:# {{ic|localtime}} is necessary if you dual boot with an operating system that only stores {{ic|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.
+
:# empty: fall back to the value in {{ic|/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
+
:# any other value will result in the hardware clock being left untouched (useful for virtualization)
+
; [[TIMEZONE]]: {{Warning|This setting is now configured by the {{ic|/etc/localtime}} symlink.}} Specifies your time zone. Possible time zones are the relative path to a zoneinfo file starting from the directory {{ic|/usr/share/zoneinfo}}. For example, a German timezone would be {{ic|Europe/Berlin}}, which refers to the file {{ic|/usr/share/zoneinfo/Europe/Berlin}}.
+
; [[KEYMAP]]: {{Warning|This setting is now configured in {{ic|/etc/vconsole.conf}}.}} 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 {{ic|/usr/share/kbd/keymaps}}. {{Note|Please note that this setting is only valid for your TTYs, not any graphical window managers or X!}}
+
 
+
; [[Fonts#Console_fonts|CONSOLEFONT]]: {{Warning|This setting is now configured in {{ic|/etc/vconsole.conf}}.}} Defines the console font to load with the {{ic|setfont}} program on boot-up (ter-v14b for example). Possible fonts are found in {{ic|/usr/share/kbd/consolefonts}} (only needed for non-US). {{ic|FONT}} in {{ic|/etc/vconsole.conf}} takes precedence. For more info see: [[Fonts#Console_fonts|Console fonts]]
+
; [[Fonts#Console_fonts|CONSOLEMAP]]: {{Warning|This setting is now configured in {{ic|/etc/vconsole.conf}}.}} Defines the console map to load with the {{ic|setfont}} program on boot-up (8859-1_to_uni for example). Possible maps are found in {{ic|/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. {{ic|FONT_MAP}} in {{ic|/etc/vconsole.conf}} takes precedence. {{Note|If using X11 for everyday work, note that this only affects the output of console applications.}}
+
; [[LOCALE]]: {{Warning|This setting is now configured in {{ic|/etc/locale.gen}}. Run {{ic|locale-gen}} to update changes. The system-wide locale can be set in {{ic|/etc/locale.conf}}.}} 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 {{ic|locale -a}} from the command line. This setting's default is fine for US English users. The {{ic|LANG}} variable in {{ic|[[locale.conf|/etc/locale.conf]]}} takes precedence if it is set, and users of login shells that cannot source {{ic|/etc/rc.conf}}, should set that value instead.
+
; DAEMON_LOCALE: {{Warning|This setting is obsolete.}} If set to yes, use {{ic|$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: {{Warning|This setting is obsolete.}} Enable (or disable) colorized status messages during boot-up.
+
 
+
==Networking==
+
; [[HOSTNAME]]: {{Warning|Unless {{ic|nss-$HOSTNAME}} is used, this setting is now configured in {{ic|/etc/hostname}}. Remember to modify {{ic|/etc/hosts}} to match.}} 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.
+
 
+
When using {{ic|/etc/hostname}}, no need to use "HOSTNAME" variable. [[HOSTNAME#Set_the_hostname|Read more]].
+
 
+
=== 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".
+
# default
+
NETWORK_PERSIST="no"
+
+
# NFS-based root device
+
# NETWORK_PERSIST="yes"
+

Latest revision as of 13:56, 26 December 2014

Redirect to: