How to make a certain application start at system startup? I know how to start the application when a user logs in (via .bashrc). But how to make it start for all users, and when you turn on the PC?
1 answer
The question is quite voluminous, so I will only describe in general terms.
- Create a script to start | stop the application in the
/etc/init.d/folder (you can use/etc/init.d/skeletonas a basis) - Making it executable
sudo chmod +x /etc/init.d/local
sudo update-rc.d <ΠΈΠΌΡ_ΡΠΊΡΠΈΠΏΡΠ°> start 40 2 3 4 5 . stop 30 0 1 6sudo update-rc.d <ΠΈΠΌΡ_ΡΠΊΡΠΈΠΏΡΠ°> start 40 2 3 4 5 . stop 30 0 1 6(the order of start and stop is set here. In this case, the script will execute last when loaded and stop first when it is turned off)To remove the script from startup, you need to run
sudo update-rc.d -f <ΠΈΠΌΡ_ΡΠΊΡΠΈΠΏΡΠ°> remove
PS To understand the above, you need to read the manual pages for update-rc.d ( man update-rc.d ). And also get acquainted with the levels of loading (see folders /etc/rc0.d, /etc/rc5.d, etc.). You can read about download levels here .