Difference between revisions of "Autostarting"

From ArchWiki
Jump to: navigation, search
(Remove rc.d info. Not supported by Arch anymore.)
Line 1: Line 1:
 
[[Category:Boot process]]
 
[[Category:Boot process]]
 
[[es:Autostarting]]
 
[[es: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.
+
{{Note: The following informatin is not complete.}}
 +
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. Programs can be started at differnt levels (time points):
 +
# System startup -- [[Daemons]], [[Systemd]], [[Runit]]
 +
# Bash Shell-- [[Shell]]
 +
** Login: (1){{ic|/etc/profile}} (2){{ic|~/.bash_profile}} OR {{ic|~/.bash_login}} OR {{ic|~/.profile}}
 +
** Non-login shell: {{ic|~/.bashrc}}
 +
# X window system
 +
** System wide: /etc/xdg/autostart
 +
** User specific: ~/.config/autostart
 +
# Graphical environment
 +
** Openbox: ~/.config/openbox/autostart
 +
** LXDE (openbox included): [[LXDE#Autostart_Programs]]
 +
# Others
 +
** Network
 +
** Hibernation & Resume
  
 
== Daemons ==
 
== Daemons ==
Line 13: Line 27:
  
 
== 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 you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. [[Bash]] or [[Zsh]].
  

Revision as of 16:12, 30 June 2013

Template:Note: The following informatin is not complete. 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. Programs can be started at differnt levels (time points):

  1. System startup -- Daemons, Systemd, Runit
  2. Bash Shell-- Shell
    • Login: (1)/etc/profile (2)~/.bash_profile OR ~/.bash_login OR ~/.profile
    • Non-login shell: ~/.bashrc
  1. X window system
    • System wide: /etc/xdg/autostart
    • User specific: ~/.config/autostart
  1. Graphical environment
  1. Others
    • Network
    • Hibernation & Resume

Daemons

You can easily 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.

Runit

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 /service with the actual service directories in /etc/sv. See the Runit page for more information.

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.

/etc/profile

/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:

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

See also

Graphical

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, Xfce

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

LXDE

See LXDE#Autostart_Programs.

Fluxbox

See Fluxbox#Autostarting Applications.

Openbox

See Openbox#Startup programs.