Autostarting (简体中文) - ArchWiki

# Autostarting (简体中文)

翻译状态： 本文是英文页面 Autostarting 的翻译，最后翻译时间：2017-01-09，点击这里可以查看翻译后英文页面的改动。

本页面需要更新翻译，内容可能已经与英文脱节。要贡献翻译，请访问简体中文翻译组。

附注: 请完善翻译

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.

Categories:

- 简体中文
- Boot process (简体中文)