What Is /etc/init
Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.
Last updated: April 11, 2026
Key Facts
- SysVinit scripts use 'S' and 'K' prefixes with two-digit numbers (00-99) to determine startup order and dependencies
- SysVinit was the standard Linux init system for over 20 years before systemd's introduction in 2011
- /etc/init uses runlevels 0-6 to represent different system states: 0=halt, 1=single-user, 6=reboot
- systemd-based systems boot 2-3x faster than SysVinit systems due to parallel service startup capabilities
- Major Linux distributions including Ubuntu, Debian, CentOS, and Fedora have transitioned to systemd since 2015
Overview
/etc/init is a critical directory in Linux and Unix systems that contains initialization scripts responsible for managing system services during the boot and shutdown processes. These scripts are part of the SysVinit system, which has been the standard init mechanism in Unix-like operating systems for decades. The /etc/init directory structure allows system administrators to define which services start automatically at system startup and in what order they should be initialized.
The directory works in conjunction with runlevels, which represent different system states such as single-user mode, multi-user mode, and graphical mode. Each runlevel has an associated /etc/init.d directory containing scripts that control service startup and shutdown. While SysVinit and /etc/init have been gradually replaced by the more modern systemd init system in many Linux distributions since 2011, understanding /etc/init remains essential for system administrators working with legacy systems and traditional Unix environments.
How It Works
The /etc/init directory structure operates through a combination of runlevels and service scripts that follow a specific naming convention:
- Runlevel Organization: The /etc/init directory contains subdirectories for each runlevel (rc0.d through rc6.d), where rc stands for "run commands." Each directory contains symbolic links to the actual service scripts stored in /etc/init.d/. Runlevel 0 halts the system, runlevels 1-5 represent different operational modes, and runlevel 6 reboots the system.
- Script Naming Convention: Service scripts follow a standardized naming pattern with 'S' (start) or 'K' (kill) prefixes followed by a two-digit number (00-99) and the service name. For example, S10network starts the network service early in the boot process, while K90network stops it during shutdown. The numbers determine the execution order, ensuring services start and stop in the correct sequence.
- Symbolic Linking System: Rather than storing actual scripts in each runlevel directory, /etc/init uses symbolic links pointing to actual service scripts stored in /etc/init.d/. This approach reduces redundancy and makes service management more efficient, as administrators only need to modify one script even if it's referenced by multiple runlevels.
- Service Control Commands: System administrators use commands like "service servicename start," "service servicename stop," and "service servicename restart" to control services. These commands execute the corresponding scripts in the /etc/init.d/ directory, which in turn update the appropriate runlevel directories with the necessary symbolic links.
- Boot Sequence Execution: During system startup, the init process reads the /etc/inittab file to determine the default runlevel, then executes all 'S' scripts in the corresponding /etc/init.d/ directory in numerical order. During shutdown, 'K' scripts are executed in reverse numerical order to gracefully stop services.
Key Comparisons
| Feature | /etc/init (SysVinit) | systemd |
|---|---|---|
| Introduction Date | Established as Unix standard in the 1980s | Released in 2011, became Linux standard by 2015 |
| Configuration Structure | Uses /etc/init.d/ scripts and runlevel directories (/etc/rc*.d/) | Uses unit files in /etc/systemd/system/ and /lib/systemd/system/ |
| Service Startup Speed | Sequential startup, typically 30-60 seconds boot time | Parallel startup with dependency management, typically 10-20 seconds boot time |
| Service Dependencies | Limited dependency management, relies on script naming numbers | Explicit service dependency declarations with Before/After directives |
| Current Usage | Legacy systems, traditional Unix, some embedded systems | Ubuntu, Fedora, CentOS 7+, Debian 8+, and most modern Linux distributions |
Why It Matters
- System Administration Fundamentals: Understanding /etc/init is essential for system administrators managing legacy systems or working in environments that haven't migrated to systemd. Knowledge of runlevels and service scripts remains important for troubleshooting boot issues and managing services effectively.
- Legacy System Maintenance: Many production systems in enterprise environments still rely on SysVinit and /etc/init structures, particularly in financial institutions and organizations with strict change management policies. Administrators must maintain expertise in these systems to ensure reliability and security.
- Cross-Platform Compatibility: Understanding /etc/init provides insight into Unix system design principles that extend beyond Linux, including BSD and other Unix-like operating systems that continue to use init-based system management.
- Educational Value: Learning about /etc/init helps developers and system administrators understand the evolution of Linux systems and provides context for why systemd was designed as it was, improving overall understanding of modern system architecture.
While systemd has become the dominant init system across major Linux distributions, /etc/init remains relevant for system administrators working with legacy infrastructure, embedded systems, and Unix-like operating systems. The transition from SysVinit to systemd represents a significant evolution in system initialization, reflecting advances in parallel processing and dependency management capabilities. Understanding both systems provides comprehensive knowledge of Linux system administration across different eras and environments.
More What Is in Daily Life
Also in Daily Life
More "What Is" Questions
Trending on WhatAnswers
Browse by Topic
Browse by Question Type
Sources
- Init - WikipediaCC-BY-SA-4.0
- Linux man pages - inittab(5)GPL-2.0
- Systemd - WikipediaCC-BY-SA-4.0
Missing an answer?
Suggest a question and we'll generate an answer for it.