What Is init.d and How To Use For Service Management In Linux – POFTUT

What Is init.d and How To Use For Service Management In Linux


Linux operating systems generally uses boot loader like grub and lilo and than uses init process to start operating system and other services.init is the most important process which forks or creates other process in a Linux system. init.d is init  configuration directory which holds information about the services or daemons.

init.d Location

init.d is located under /etc which is configuration directory for most of the Linux distributions. We can chech the existence of the init.d with the file command like below. It is a directory of course.

$ file /etc/init.d
init.d Location
init.d Location

Init Daemon

init daemon is the first process of Linux system. Then other processes, services, daemons and threats are started by init . So init.d is a configuration database for init process.

Daemon Script

Now we will print an example daemon process. A daemon script will hold functions like start , stop , restart ,status etc. We will use cron daemon script in this example.

$ cat /etc/init.d/cron
Daemon Script
Daemon Script

List Init.d Contents

There are a lot of different daemon and service scripts in init.d directory. We can list these scripts with the ls command like below.

$ ls /etc/init.d/
List Init.d Contents
List Init.d Contents

Init.d Script Usage

We can use these daemon scripts just by calling the like a regular bash script. Lets print some help information by calling script but not providing any option.

$ /etc/init.d/cron

and then list the status of the cron daemon which is used for scheduled jobs.

$ /etc/init.d/cron status
Init.d Script Usage
Init.d Script Usage

LEARN MORE  What is Dell Service Tag and How To Find and Use It?

Leave a Comment