Mathan Kumar

Solution Engineer

System Engineer

DevOps ENgineer

Ethical Hacker

Cyber Security

Mathan Kumar

Solution Engineer

System Engineer

DevOps ENgineer

Ethical Hacker

Cyber Security

Blog Post

Understanding init.d Directory In LinuxFilesystem.

December 19, 2023 Linux

init.d is the sub-directory of /etc directory in Linux file system. init.d basically contains the bunch of start/stop scripts which are used to control (start,stop,reload,restart) the daemon while the system is running or during boot. If you look at /etc/init.d then you will notice all the scripts for different services of your system.

The scripts within the directory varies as per the applications installed in your system. In server system you’ll find many network related scripts while in desktop there will be the only basic ones like ‘networking’.

There are two types of scripts : K scripts & S scripts.

  • K scripts are known ‘kill’ scripts while S scripts are known as ‘startup’ scripts.
  • Kill scripts always run before startup scripts.
  • The configuration file (.conf) of these scripts are located under /etc/init & the scripts that are used as defaults are located under /etc/default.

Within /etc/init.d we can find the script rc.local ,this script is automatically executed after all primarily scripts are executed. Which means first K scripts are executed, following by S scripts, then all other remaining init level scripts (if there’s any) & finally rc.local script.

Now to control any script, you’ll need the superuser (sudo/su) permission. You can manually control the scripts using terminal.

The syntax for controlling the script is like :

# /etc/init.d/<script> <option>

EXAMPLE:

# sudo /etc/init.d/cron reload
S.noSrcipt in init.dPurpose
1acpidThe acpid daemon supports the Advanced Configuration and Power Interface (ACPI) to allow intelligent power management on your system and to query battery and configuration status.
2alsa-utilsThe ALSA Utilities package contains various utilities which are useful for controlling your sound card.
3AnacronSimilar to the cron service, the anacron service runs applications or scripts at specific times and dates.Unlike the cron service, anacron will not miss the execution of a scheduled job, even if the system is powered off. The activity will be performed when the system is next available. This makes anacron the preferred choice to initiate essential system administration tasks such as backup or disk space recovery.
4apache2This script is used to control the apache server.
5bluetoothThis script controll the bluetooth at the system startup
6checkfs.shThis script Checks all filesystems in the startup and log the message in fsck.log file.
7CronIt makes to run cron in the system startup. Cron will execute a sheduled command ath that given time.
8CupsManage the CUPS Printing spooler and server; make it’s web interface accessible on http://localhost:
9Grub-commonGRUB displays the boot menu at the next boot if it believes that the previous boot failed. This script informs it that the system booted successfully.
10Isc-dhcp-serverIt makes the DHCP(Dynamic Host Control Protocol) server to start. Which gives Dynamic ip address to the client.
11KillprocsKill all the process before starting the init.d.
12LightdmLightDM is the display manager running in Ubuntu up to version 16.04 LTS. While it has been replaced by GDM in later Ubuntu releases. The display manager will be started by this scripts.
13mountall.shThis script is used to mount all the file system listed in fstab.
14mysqlThis script is used to control the mysql server.
15networkingIt is used to start and configure neywork interface.
16NetworkManagerIf using DHCP, NetworkManager is intended to replace default routes, obtain IP addresses from a DHCP server and change nameservers whenever it sees fit. In effect, the goal of NetworkManager is to make networking Just Work.This script will controll Network manager.
17Nfs-kernel-serverNFS is a popular protocol for file sharing across TCP/IP networks. This service provides NFS server functionality, which is configured via the /etc/exports file.
18x11-commonIt makes the X server (graphics) files to start in the system startup.
19rc.localIt contains scripts to be used to control the starting, stopping and restarting of user defined  daemons.
20resolvconfIt is nameserver information manager. This service manages the list of nameserver addresses used by the libc resolver and name service caches
21RsyncIt is fast remote file copy program daemon that allows files to be copied to and from remote machines in much the same way as rcp. This provides rsyncd daemon functionality.
22rsyslogIt makes to store log message of rsync daemon at the system startup.
23sambaSamba is linux server application and this script starts the samba.conf at the system startup.
24UfwIt is Ubuntu firewall. It makes the firewall to enable at the system startup.
25umountfsThis script is used to unmount the hard disk that are assigned in the fstab.
Related Posts
Write a comment