What Is init.d and How To Use For Service Management In Linux
Linux operating systems generally uses boot loader like
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 configuration directory which holds information about the services or daemons.
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 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
Now we will print an example daemon process. A daemon script will hold functions like
status etc. We will use
cron daemon script in this example.
$ cat /etc/init.d/cron
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/
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.
and then list the status of the
cron daemon which is used for scheduled jobs.
$ /etc/init.d/cron status