What is init.d in Linux Service Management?

In Linux there are several services that can be started and stopped manually in the system, some of there services are ssh, HTTP, tor, apache, etc. To start and run these services we used to simply type

service "service name" start/stop/status/restart


Service ssh start

And to check if this service is running we type the command

service ssh status

In this simple manner, we are using service management in Linux but what actually happens and how it actually works in the background.

What is init.d?

All these service works on several scripts and these scripts are stored in /etc/init.d location, this init.d is deamon which is the first process of the Linux system. Then other processes, services, daemons, and threats are started by init. So init.d is a configuration database for the init process. Now let’s check some daemon scripts by printing some processes, a daemon script holds functions like start, stop, status and restart. Let’s check ssh as an example.

cat /etc/init.d/ssh


daemon script of ssh command

Now to you know about daemon script lets also check what is inside of init.d directory, to do this we will simply list out all the fines inside the location

ls /etc/init.d/


inside of directory of location

How to Use init.d in Service Management?

We used to type simple command service ssh start. But now, in this case, we will do it the other way which is also simple.

/etc/init.d/ssh start

and the same way you can stop

/etc/init.d/ssh stop

stopping ssh process management

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.