Linux: Starting Programs On Boot
IntroductionThere are many flavors of Linux today. In some scenarios it isn't possible to know all of the features of each flavor and while knowing the basis of Linux helps, it can be helpful and sometimes more convenient to know what each flavor of Linux offers. In this short article we will go over how to start programs on boot weather you are running these programs on Ubuntu, CentOS, Fedora, etc.
Whether it was an attempt at securing a sort of brand or just sheer programming bliss that motivated each developer to write extra code into these operating systems, the result is a more convenient way of getting programs to start when the machine comes up. The question is, " Which startup program am I using for my operating system and how do I use it?"
Implement a startup script in the init.d directoryFirst copy a script that follows the LSB rules (Linux Standards Base) to the /etc/init.d directory so the startup programs have something to reference. Then execute the startup program syntax. Here is a list of those startup programs and some simple syntax for each to get program to start on boot:
Startup Programs on Ubuntu and DebianUbuntu & Debian: updated-rc.d
What happens when Update-rc.d is calledThis usage calls update-rc.d, then the name of the startup script (usually the name of the software with no extension) and then the word 'defaults.' The defaults stands for run levels and those defaults are 2-5. There are 7 total run levels but 0,1,6 are used when the machine shuts down and so these are not included in the startup process.
In the background of Update-rc.dWhat actually happens in the background is that the core startup procedure of Linux is called to include the program you have just specified. Normally, Linux has entries in one file that list all of the programs that need to start on boot including their priorities and locations on the disk. Then links are placed into the appropriate run level directories and called when the machine boots. These directories are named appropriately per run level i.e rcX.d where X is between 0 and 6, inclusive.
Some other startup programs based on operating system are as follows:
Cent OS 6 And BelowCentOS 6 and below use a startup program called
You can specify the run levels on which the program will startup at boot. You'll see that in most references on how to use
How to use
|Created on:||9/17/13 2:20 PM|
|Last updated on:||12/3/19 6:07 PM|