Linux Autostart

From wikinotes

There are various ways of running jobs that run "on startup" on linux.

On Boot (before login)

Write a service for your job. You can manage it with your init system (ex: systemd, sysV, bsdinit, ...).

On Shell Login

Put it in your shell's rcfile, or .profile.

sh:   ~/.shrc     ~/.profile
bash: ~/.bashrc   ~/.bash_profile
zsh:  ~/.zshrc    ~/.zprofile

On Graphical Login

The method of running a script following user login depends on the Window-Manager you are using, and what method you are using to launch your window manager. I found it most useful to write a login shellscript, and call it in a method that is most appropriate to my environment.

  • put it in ~/.xinitrc
  • call it from your WM's configfile
  • create a .Desktop file and set it to autorun on login
  • other...