From ArchWiki
Revision as of 14:48, 19 May 2012 by Bougyman (talk | contribs) (Init chain)
Jump to navigation Jump to search

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 – فارسی

This article links to various methods to launch scripts or applications automatically when some particular event is taking place, like system startup or shutdown, shell login or logout and so on.


You can easily start your scripts or applications as daemons, see Daemon and Writing rc.d scripts.

Init chain

/etc/rc.local and /etc/rc.local.shutdown are good places for auto-starting scripts respectively at system startup and shutdown, see also Arch Boot Process.


systemd is a replacement for initscripts which allows faster boot time as it parallelizes startup of services. The services which are started by systemd can be found in the subfolders of /etc/systemd/system/. Services can be enabled using the systemctl command. For more information about systemd see at systemd.


runit is a mature replacement for initscripts which offers process supervision, parallel startup, per-user service trees, granular cgroup manipulation, flexible dependency system, and boot times that don't incur the penalty of dbus. The root-level services are symlinks in /service with the actual service directories in /etc/sv. See the Runit page for more information.


To autostart programs in console you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. Bash or Zsh.


/etc/profile is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific (/etc/profile.d/*.sh) settings.

Each time /etc/profile is executed, it sources the following scripts if they exist:

  1. /etc/profile.d/*.sh
  2. /etc/bash.bashrc (if shell is bash)
    1. /etc/bash_completion

See also


You can autostart programs automatically when you login into your Window Manager or Desktop Environment.

X session startup

See xinitrc and xprofile.

X Desktop Group

$XDG_CONFIG_DIRS/autostart/: In this folder are .desktop files. These files determine which programs are loaded for which desktop environment. For an explanation of the desktop file standard refer to Desktop Entry Specification.


GNOME, KDE and Xfce all have a dedicated GUI for autostart settings, see the respective articles.

You can also directly put .desktop files in ~/.config/autostart/

KDE (Legacy)

KDE also has a specific folder: ~/.kde/Autostart or ~/.kde4/Autostart

Xfce (Legacy)

In the Xfce versions prior to 4.4 the programs had to be located in ~/Desktop/Autostart/


See LXDE#Autostart_Programs.


See Fluxbox#Autostarting Applications.


See Openbox#Startup programs.