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.
/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.
/etc/profile is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific (
/etc/profile is executed, it sources the following scripts if they exist:
/etc/bash.bashrc(if shell is bash)
STARTUP/SHUTDOWN FILESsection of
- Unix shells configuration files - Wikipedia
X session startup
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
You can also directly put .desktop files in
KDE also has a specific folder:
In the Xfce versions prior to 4.4 the programs had to be located in