Difference between revisions of "Autostarting"

From ArchWiki
Jump to: navigation, search
m (Fixed headers)
m (LXDE: link fix)
 
(59 intermediate revisions by 20 users not shown)
Line 1: Line 1:
 
[[Category:Boot process]]
 
[[Category:Boot process]]
 
[[es:Autostarting]]
 
[[es:Autostarting]]
 +
[[ja:自動起動]]
 +
[[ru:Autostarting]]
 
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.
 
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.
  
 
== Daemons ==
 
== Daemons ==
You can easily start your scripts or applications as daemons, see [[Daemon]] and [[Writing rc.d scripts]].
+
 
 +
You can start your scripts or applications as daemons, see [[Daemon]].
  
 
=== Systemd ===
 
=== Systemd ===
''systemd'' is the default init framework, replacing initscripts. The services which are started by ''systemd'' can be found in the subfolders of {{ic|/etc/systemd/system/}}. Services can be enabled using the {{ic|systemctl}} command. For more information about ''systemd'' and how to write autostart scripts for it, see at [[systemd]].
 
  
=== Legacy Init Chain ===
+
''systemd'' is the default init framework, replacing initscripts. The services which are started by ''systemd'' can be found in the subfolders of {{ic|/etc/systemd/system/}}. Services can be enabled using the {{ic|systemctl}} command. For more information about ''systemd'' and how to write autostart scripts for it, see at [[systemd]]. To autostart scripts for specific users, see [[systemd/User]].
{{ic|/etc/rc.local}} and {{ic|/etc/rc.local.shutdown}} are where the traditional init framework would read from for user generated startup actions. You can write rc.local as a shell script that will be run every boot under the legacy initscripts framework.
+
  
=== Runit ===
+
== Cron ==
''runit'' is a mature init system 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 {{ic|/service}} with the actual service directories in {{ic|/etc/sv}}. See the [[Runit]] page for more information.
+
 
 +
[[Cron]] can be used to autostart non-GUI system setup tasks.
  
 
== Shells ==
 
== Shells ==
  
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]].
+
To autostart programs in console or upon login, you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. [[Bash#Configuration files]] or [[Zsh#Startup/Shutdown files]].
 +
 
 +
See also [[Wikipedia:Unix shell#Configuration files for shells]].
  
 
=== /etc/profile ===
 
=== /etc/profile ===
  
{{ic|/etc/profile}} is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific ({{ic|/etc/profile.d/*.sh}}) settings.
+
Upon login, all Bourne-compatible shells source {{ic|/etc/profile}}, which in turn sources any readable {{ic|*.sh}} files in {{ic|/etc/profile.d/}}: these scripts do not require an interpreter directive, nor do they need to be executable. They are used to set up an environment and define application-specific settings.
 
+
Each time {{ic|/etc/profile}} is executed, it sources the following scripts if they exist:
+
* {{ic|/etc/profile.d/*.sh}}
+
* {{ic|/etc/bash.bashrc}} (if shell is bash)
+
* {{ic|/etc/bash_completion}}
+
 
+
===See also===
+
*{{ic|INVOCATION}} section of {{ic|man bash}}
+
*{{ic|STARTUP/SHUTDOWN FILES}} section of {{ic|man zsh}}
+
*[[Wikipedia:Unix_shell#Configuration files for shells]]
+
  
 
== Graphical ==
 
== Graphical ==
You can autostart programs automatically when you login into your [[Window Manager]] or [[Desktop Environment]].
+
 
 +
You can autostart programs automatically when you login into your [[Window manager]] or [[Desktop environment]].
  
 
=== X session startup ===
 
=== X session startup ===
Line 40: Line 35:
 
See [[xinitrc]] and [[xprofile]].
 
See [[xinitrc]] and [[xprofile]].
  
=== X Desktop Group ===
+
=== Desktop entries ===
  
{{ic|$XDG_CONFIG_DIRS/autostart/}}: In this folder are {{ic|.desktop}} files. These files determine which programs are loaded for which desktop environment. For an explanation of the desktop file standard refer to [http://standards.freedesktop.org/desktop-entry-spec/latest/ Desktop Entry Specification].
+
See [[Desktop entries#Autostart]].
  
=== GNOME, KDE, Xfce ===
+
=== GNOME ===
  
[[GNOME]], [[KDE]] and [[Xfce]] all have a dedicated GUI for autostart settings, see the respective articles.
+
See [[GNOME#Startup applications]].
  
You can also directly put [[Creating desktop entries and menus|.desktop]] files in {{ic|~/.config/autostart/}}
+
=== KDE Plasma ===
  
==== KDE (Legacy) ====
+
See [[KDE#Autostarting applications]].
  
KDE also has a specific folder: {{ic|~/.kde/Autostart}} or {{ic|~/.kde4/Autostart}}
+
=== Xfce ===
 +
 
 +
See [[Xfce#Startup applications]].
  
 
=== LXDE ===
 
=== LXDE ===
  
See [[LXDE#Autostart_Programs]].
+
See [[LXDE#Autostart]].
 +
 
 +
=== LXQt ===
 +
 
 +
See [[LXQt#Autostarting applications]].
  
 
=== Fluxbox ===
 
=== Fluxbox ===
  
See [[Fluxbox#Autostarting Applications]].
+
See [[Fluxbox#Autostart programs]].
  
 
=== Openbox ===
 
=== Openbox ===
  
See [[Openbox#Startup programs]].
+
See [[Openbox#autostart]].

Latest revision as of 18:51, 8 August 2016

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.

Daemons

You can start your scripts or applications as daemons, see Daemon.

Systemd

systemd is the default init framework, replacing initscripts. 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 and how to write autostart scripts for it, see at systemd. To autostart scripts for specific users, see systemd/User.

Cron

Cron can be used to autostart non-GUI system setup tasks.

Shells

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

See also Wikipedia:Unix shell#Configuration files for shells.

/etc/profile

Upon login, all Bourne-compatible shells source /etc/profile, which in turn sources any readable *.sh files in /etc/profile.d/: these scripts do not require an interpreter directive, nor do they need to be executable. They are used to set up an environment and define application-specific settings.

Graphical

You can autostart programs automatically when you login into your Window manager or Desktop environment.

X session startup

See xinitrc and xprofile.

Desktop entries

See Desktop entries#Autostart.

GNOME

See GNOME#Startup applications.

KDE Plasma

See KDE#Autostarting applications.

Xfce

See Xfce#Startup applications.

LXDE

See LXDE#Autostart.

LXQt

See LXQt#Autostarting applications.

Fluxbox

See Fluxbox#Autostart programs.

Openbox

See Openbox#autostart.