What Is /etc/rc
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
- Created in 1979 as part of Unix Version 7, /etc/rc has been the primary system startup mechanism for nearly 50 years
- /etc/rc.local allows administrators to append custom startup commands, providing site-specific configuration flexibility
- System V init organizes startup scripts in /etc/rc.d directories with 7 runlevels (0-6) controlling which services run at different operational states
- systemd (introduced 2010, adopted 2015+) replaced /etc/rc on 90%+ of modern Linux distributions but maintains backward compatibility
- Traditional /etc/rc executes services sequentially, while systemd enables parallel service startup, reducing boot time by 20-40% on average
Overview
/etc/rc is a critical initialization script found in Unix and Linux systems that executes automatically during the system startup process. This script is responsible for performing essential configuration tasks and launching core system services before the operating system reaches its fully operational state. The name "rc" stands for "run commands," reflecting its primary function of executing a series of predetermined commands in sequential order.
The /etc/rc file system has been a fundamental component of Unix since the 1970s, originating in Unix Version 7 released in 1979. While its role has evolved significantly over the decades, with modern Linux distributions increasingly adopting systemd as an alternative, understanding /etc/rc remains important for system administrators and developers working with Unix-like systems. Many organizations still maintain systems using traditional /etc/rc scripts, and knowledge of these files is essential for troubleshooting boot issues and customizing system startup behavior.
How It Works
The /etc/rc startup process follows a structured sequence of operations that initialize the system in a controlled manner.
- Sequential Execution: When the kernel finishes loading and initializes, the init process (PID 1) executes the /etc/rc script with root privileges. The script processes commands line by line in the exact order they appear in the file, ensuring that dependencies are resolved properly before subsequent operations commence.
- Environment Configuration: Early portions of /etc/rc typically set environment variables, configure the filesystem by checking and mounting partitions, and establish basic network parameters. This phase ensures that the system has access to necessary resources before attempting to start services that depend on them.
- Service Initialization: The script then launches essential services and daemons required for normal system operation, such as syslog, cron, and network services. Each service is typically started by sourcing shell scripts located in /etc/rc.d/init.d/ directory, which contain standardized startup and shutdown logic.
- Runlevel Management: In System V init systems, different /etc/rc.d directories (rc0.d through rc6.d) correspond to different runlevels, determining which services run at each operational state. Runlevel 0 is shutdown, runlevel 1 is single-user mode, runlevels 2-5 are multi-user modes, and runlevel 6 is reboot.
- Custom Startup Commands: The /etc/rc.local file allows system administrators to append custom initialization commands that run after standard system startup procedures. This provides flexibility for site-specific configurations without modifying the core /etc/rc script.
Key Comparisons
| Aspect | /etc/rc (Traditional) | systemd (Modern) |
|---|---|---|
| Inception | 1979 (Unix Version 7) | 2010 (systemd project inception) |
| Configuration Format | Shell scripts with executable permissions | Declarative unit files (.service, .socket, .timer) |
| Execution Method | Sequential execution only | Parallel service startup with dependency management |
| Modern Adoption | Legacy systems, embedded Linux, specialized distributions | 90%+ of Linux distributions as of 2024 |
| Maintainability | Requires bash scripting knowledge | Simpler configuration syntax, enhanced debugging |
| Backward Compatibility | N/A (being phased out) | Maintains compatibility with /etc/rc.local and legacy scripts |
Why It Matters
- Legacy System Administration: Understanding /etc/rc is essential for managing older Unix and Linux systems still in production, particularly in financial institutions and enterprise environments where systems may operate for 10+ years without major updates.
- Boot Troubleshooting: When systems fail to boot properly or services don't start automatically, knowledge of /etc/rc scripts enables administrators to diagnose issues by reviewing startup logs and tracing the execution sequence.
- Security Configuration: The /etc/rc.local file can implement security measures such as firewall rule initialization, security daemon startup, and filesystem permission checks that execute before multi-user access begins.
- Embedded Systems: Many embedded Linux systems and lightweight distributions still rely on /etc/rc scripts rather than systemd, making this knowledge valuable for IoT device management and minimal installations.
While systemd has become the standard init system for modern Linux distributions, /etc/rc remains an important historical and practical component of Unix-like systems. System administrators should maintain familiarity with both traditional and modern approaches to effectively manage diverse environments and handle legacy systems running in production.
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
- Wikipedia - InitCC-BY-SA-4.0
- Wikipedia - systemdCC-BY-SA-4.0
- Wikipedia - Unix System VCC-BY-SA-4.0
Missing an answer?
Suggest a question and we'll generate an answer for it.