Study guide
2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)
LPIC-1 Linux Administrator — Exam 101 101-500
Track your progress as you read
Finished sections get a check mark.
1 Exam Overview & Study Strategy
1.1 LPIC-1 101-500 Exam Structure & Blueprint 1.2 Command Line & Shell Fundamentals for Exam Success 1.3 Fill-in-the-Blank Strategies & Common Traps
2 Topic 101: System Architecture
2.1 Hardware Discovery, Sysfs, Procfs & Kernel Modules (101.1) 2.2 Udev, Dbus & Device Management (101.1) 2.3 BIOS vs. UEFI & System Boot Process (101.2) 2.4 Kernel Initialization, Initramfs & System Logs (101.2) 2.5 Systemd Boot Targets & Unit Management (101.3) 2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)
3 Topic 102: Linux Installation & Boot Management
3.1 Hard Disk Layout, Partition Schemes & Swap Design (102.1) 3.2 LVM & Standard Mount Point Allocation (102.1) 3.3 GRUB 2 Configuration & Troubleshooting (102.2) 3.4 Legacy GRUB & Alternative Boot Loaders (102.2) 3.5 Managing Shared Libraries & ldconfig (102.3) 3.6 Linux as a Virtualization Guest & Cloud Instances (102.6)
4 Topic 102: Package Management Systems
4.1 Debian Low-Level Package Management with dpkg (102.4) 4.2 High-Level Debian Package Management: apt, apt-get & apt-cache (102.4) 4.3 RPM Package Management with rpm (102.5) 4.4 YUM, DNF & Zypper Package Management (102.5) 4.5 Package Repositories & Integrity Verification (102.4/102.5) 4.6 Universal Linux Packages: Snap, Flatpak & AppImage (102.4/102.5)
5 Topic 103: Command Line & Text Processing
5.1 Shell Environment, Environment Variables & Aliases (103.1) 5.2 Command History, Quoting & Expansion (103.1) 5.3 Basic Text Filters: cat, head, tail, cut, paste, nl, od (103.2) 5.4 Advanced Text Filters: sort, uniq, wc, tr, split, less & Checksums (103.2) 5.5 Stream Editing with sed (103.2) 5.6 Basic File Management: cp, mv, rm, touch, mkdir, rmdir (103.3) 5.7 Archiving and Compression: tar, gzip, bzip2, xz, cpio & dd (103.3)
6 Topic 103: Streams, Processes, Regex & Vi
6.1 Standard Streams, Redirection & File Descriptors (103.4) 6.2 Pipelines, tee & xargs (103.4) 6.3 Process Monitoring: ps, top, free, watch, pgrep, pstree & uptime (103.5) 6.4 Signals, kill, Job Control, nohup, screen & tmux (103.5) 6.5 Process Priorities: nice & renice (103.6) 6.6 Regular Expressions & grep, egrep, fgrep (103.7) 6.7 vi / vim Modes, plus nano, Emacs & EDITOR Awareness (103.8)
7 Topic 104: Devices, Partitions & Filesystems
7.1 Block Devices, fdisk & gdisk (104.1) 7.2 GNU Parted & Partition Table Management (104.1) 7.3 Creating Filesystems: mkfs, ext4, XFS, VFAT/exFAT & Btrfs (104.1) 7.4 Filesystem Integrity: fsck, e2fsck, xfs_repair, xfs_fsr & xfs_db (104.2) 7.5 Monitoring Disk Usage: df, du & tune2fs (104.2) 7.6 Managing Swap Space: mkswap, swapon & swapoff (104.1/104.2)
8 Topic 104: Mounts, Permissions, Links & FHS
8.1 Mounting and Unmounting Filesystems: mount & umount (104.3) 8.2 Persistent Mounts: /etc/fstab, UUIDs & systemd mount units (104.3) 8.3 Standard File Permissions: chmod, chown, chgrp & umask (104.5) 8.4 Special Permissions: SUID, SGID & Sticky Bit (104.5) 8.5 Hard Links vs. Symbolic Links: ln & Inodes (104.6) 8.6 Filesystem Hierarchy Standard (FHS) & File Location (104.7)
2.6 SysVinit Runlevels, Telinit & System Shutdown (101.3)
Key Takeaways Explain This Topic AI
SysVinit organizes system operating states into numeric runlevels from 0 to 6 (0=Halt, 1=Single-User, 3=Multi-User CLI, 5=Multi-User GUI, 6=Reboot).
SysVinit's master configuration file is /etc/inittab, structured as 'id:runlevels:action:process' (e.g., id:3:initdefault:); the runlevel command prints the previous and current runlevels, init and telinit switch runlevels at runtime, and 'telinit q' reloads /etc/inittab.
Init scripts in /etc/init.d/ are symlinked into /etc/rc[0-6].d/ using K<priority> (Kill/Stop) and S<priority> (Start) naming conventions.
The shutdown command safely terminates systems using relative (+m), absolute (hh:mm), or immediate (now) time formats, supporting cancellation (-c) and broadcast warnings (-k, wall).
acpid is the user-space daemon that turns kernel ACPI hardware events (power button, lid close) into policy actions using rule files in /etc/acpi/events/; on systemd hosts systemd-logind handles most of these through HandlePowerKey in /etc/systemd/logind.conf.
Last updated: August 2026
2.6 SysVinit Runlevels, Telinit & System Shutdown
Quick Summary: Classic Linux distributions utilize the SysVinit (System V Initialization) daemon as PID 1. SysVinit structures system states into discrete numeric runlevels (0 through 6) controlled by /etc/inittab and orchestrated through runlevel directories ( /etc/rc[0-6].d/ ) containing kill ( K* ) and start ( S* ) scripts. Administrators switch runlevels using telinit or init , inspect states with runlevel , and safely power off or reboot systems using shutdown , reboot , poweroff , and wall .
1. Classic SysVinit Architecture & Runlevels
Under SysVinit, when the kernel finishes initializing, it starts /sbin/init (PID 1). Init reads /etc/inittab to determine the default runlevel and executes shell scripts sequentially to bring up networking, daemons, and login consoles.
The Standard SysVinit Runlevels
Runlevel Operational Purpose & Environment
0 Halt / Poweroff : Stops all services, unmounts filesystems, and powers down system hardware.
1 , s , S , single Single-User Mode : Administrative maintenance mode. Spawns a root shell without networking or background services.
2 Multi-User Mode without Networking (Red Hat / CentOS) or Standard Multi-User with Networking (Debian / Ubuntu default).
3 Full Multi-User Mode with Networking & CLI : Standard operating mode for Linux servers (non-graphical text login).
4 Unused / User-Defined : Available for custom administrative configurations.
5 Full Multi-User Mode with Networking & GUI : Standard desktop operating mode with X11 / display manager (GDM/KDM/LightDM).
6 Reboot : Stops all services, unmounts filesystems cleanly, and reboots the machine.
2. Mapping SysVinit Runlevels to Systemd Targets
Because modern Linux systems utilize systemd, systemd provides target units that maintain full backwards compatibility with SysVinit runlevels.
- SysVinit Runlevel Equivalent Systemd Target Unit Target Description
- 0 poweroff.target Halts and shuts down hardware power
- 1 , s , S rescue.target Single-user root maintenance shell with local storage
- N/A emergency.target Minimal emergency shell with root mounted read-only
- 2 , 3 , 4 multi-user.target Non-graphical multi-user CLI environment with network
- 5 graphical.target Multi-user graphical desktop environment
- 6 reboot.target Reboots the system
3. SysVinit Configuration: /etc/inittab
The configuration file for SysVinit is /etc/inittab . Each line defines how init behaves during boot and upon switching runlevels.
Syntax Format id:runlevels:action:process
id : A unique 1 to 4 character identifier for the entry (e.g., id , si , l3 , 1 , tty1 ).
runlevels : A list of numeric runlevels for which this entry is active (e.g., 35 , 0123456 , or left empty if applicable to all).
action : Specifies how init executes the command in the process field.
process : The exact shell command or binary executable to run.
Standard /etc/inittab Actions
Action Keyword Execution Behavior & Technical Purpose
initdefault Defines the default runlevel entered after boot. The process field is ignored.; id:3:initdefault: (Boots to Runlevel 3).
sysinit Executed once during early system boot before entering any runlevel (sets clock, mounts /proc ).
wait Executed when entering the specified runlevel; init pauses and waits for process termination before continuing.
once Executed once when entering the runlevel; init does not wait for termination.
respawn If the process terminates, init automatically restarts it immediately (used for getty / mingetty virtual consoles).; 1:2345:respawn:/sbin/mingetty tty1
ctrlaltdel Executed when init receives the SIGINT signal (triggered by pressing Ctrl+Alt+Delete at the console).; ca::ctrlaltdel:/sbin/shutdown -t3 -r now
boot Executed during boot; init does not wait for completion.
bootwait Executed during boot; init waits for completion.
off Disables the entry if it was previously active.
Exam Tip — Setting Default Runlevel in /etc/inittab : To configure a SysVinit server to boot into text multi-user mode by default, set the initdefault line to: id:3:initdefault:
Never set initdefault to 0 (system immediately powers off on boot) or 6 (system enters an infinite reboot loop).
- 4. Runlevel Switching & Inspection Commands
- 1. The runlevel Command
runlevel queries the /var/run/utmp database to display the previous and current runlevels separated by a space. $ runlevel
N 3
The first character represents the previous runlevel ( N indicates "None", meaning the system booted directly into this runlevel without switching).
The second character represents the current runlevel ( 3 ).
If the administrator switched from runlevel 3 to runlevel 5, runlevel outputs: 3 5 .
2. telinit and init
telinit sends control signals to /sbin/init instructing it to transition to a new runlevel or re-examine configuration files. # Switch to full multi-user command-line mode
- sudo telinit 3
- # or
- sudo init 3
- # Switch to graphical desktop mode
- sudo telinit 5
- # Switch to single-user maintenance mode
- sudo telinit 1
- # Power off the machine immediately
- sudo telinit 0
- # Reboot the machine
- sudo telinit 6
- # Force init to re-read /etc/inittab without changing runlevel
- sudo telinit q
- # or
- sudo telinit Q
- # Re-execute the init binary (useful after library/init updates)
- sudo telinit u
5. Init Scripts & Execution Structure
SysVinit manages service startup and shutdown using standard shell scripts located in /etc/init.d/ (or /etc/rc.d/init.d/ ).
Runlevel Directory Hierarchy
For each runlevel N (0 to 6), a corresponding directory exists: /etc/rcN.d/ (e.g., /etc/rc3.d/ , /etc/rc5.d/ ). These directories contain symbolic links pointing back to master scripts in /etc/init.d/ . /etc/
- ├── init.d/ # Master service scripts (sshd, networking, apache2)
- ├── rc0.d/ -> /etc/rc.d/rc0.d/ (Halt scripts)
- ├── rc1.d/ (Single-user scripts)
- ├── rc3.d/ (Multi-user CLI scripts)
- │ ├── K10network -> ../init.d/network
- │ ├── S10network -> ../init.d/network
- │ ├── S50sshd -> ../init.d/sshd
- │ └── S80apache2 -> ../init.d/apache2
- └── rc5.d/ (Graphical scripts)
- Symlink Naming Conventions
K<priority><servicename> : Kill (Stop) script . When entering the runlevel, init executes these scripts with the stop argument to terminate services that should not run in this runlevel.
S<priority><servicename> : Start script . When entering the runlevel, init executes these scripts with the start argument.
Priority Number ( 00 – 99 ) : Two-digit integer defining execution order. Scripts are executed in ascending numerical order ( S10network runs before S50sshd ).
6. System Shutdown & Reboot Procedures
To prevent data corruption, open files must be flushed to disk ( sync ), processes must receive termination signals ( SIGTERM followed by SIGKILL ), unmount hooks must run, and filesystems must be unmounted cleanly.
- The shutdown Command
- shutdown brings the system down in a safe, controlled manner. shutdown [OPTIONS] [TIME] [WALL-MESSAGE]
- Time Argument Formats
now : Immediate shutdown (equivalent to +0 ).
+m : Relative time in m minutes from now (e.g., +15 for 15 minutes).
hh:mm : Absolute 24-hour clock time (e.g., 23:30 for 11:30 PM).
Crucial shutdown Command Options
-h : Halts or powers off the system after shutdown.
-P : Powers off the hardware (halts and turns off ACPI power).
-H : Halts the operating system without cutting hardware power.
-r : Reboots the machine after clean shutdown.
-c : Cancels a pending scheduled shutdown.
-k : Fake shutdown / warning mode . Sends broadcast warning messages to all logged-in users via wall without actually shutting down or rebooting the system. # Schedule a reboot in 10 minutes with a broadcast warning
$ sudo shutdown -r +10 "System reboot for kernel upgrade. Please save all work!"
- # Schedule a poweroff at 11:00 PM tonight
- $ sudo shutdown -h 23:00 "Nightly scheduled maintenance shutdown"
- # Cancel the pending shutdown
- $ sudo shutdown -c "Maintenance cancelled. The system will remain online."
- # Broadcast a dry-run test warning without shutting down
- $ sudo shutdown -k +5 "Testing emergency notification system"
- Direct Shutdown Utilities
reboot : Immediately signals systemd/init to reboot the machine ( reboot -f forces immediate reboot without notifying init).
poweroff : Immediately powers down the hardware.
halt : Halts the CPU instructions.
wall [message] : Broadcasts a message to standard output on all currently logged-in user terminals ( tty and pts ). echo "Emergency: Storage server offline in 2 minutes" | wall
7. acpid : Turning Hardware Power Events into Shutdowns
Objective 101.3 explicitly lists awareness of acpid , and it is the only piece of that objective that has nothing to do with a command you type. It matters because it answers a question the rest of the objective does not: what happens when somebody physically presses the power button?
ACPI (Advanced Configuration and Power Interface) is the firmware standard through which hardware reports power events — power button pressed, lid closed, AC adapter unplugged, thermal trip point crossed. The kernel receives those events, but the kernel has no policy about what they should mean . acpid (the ACPI event daemon) supplies that policy from user space.
- The event chain: Power button pressed
- → firmware raises an ACPI event
- → kernel ACPI subsystem publishes it on /proc/acpi/event (or via netlink)
- → acpid reads the event
- → acpid matches it against a rule in /etc/acpi/events/
- → acpid runs the action script, typically /etc/acpi/powerbtn.sh
- → the script calls `shutdown -h now` (or hands off to the desktop session)
- Path Purpose
- /etc/acpi/events/ Event-matching rule files (each has event= and action= lines)
- /etc/acpi/ Handler scripts invoked by those rules (e.g. powerbtn.sh )
- /proc/acpi/event Legacy kernel interface acpid reads events from
- acpi_listen Diagnostic tool that prints raw ACPI events live as you trigger them
- A typical rule file is only two lines: # /etc/acpi/events/powerbtn
- event=button/power.*
- action=/etc/acpi/powerbtn.sh "%e" # Confirm the daemon is running
- systemctl status acpid
- # Watch raw events while you press the power button or close the lid
- acpi_listen
Exam Rule: If acpid is not running (or its handler is missing), pressing the power button on a headless server may do nothing at all , or may cut power abruptly without a clean unmount — which is exactly why the objective pairs it with shutdown . On modern systemd systems systemd-logind handles button events directly through HandlePowerKey= in /etc/systemd/logind.conf , and acpid is only needed for events logind does not claim. Know the name, the daemon's role as the user-space policy layer for kernel ACPI events , and /etc/acpi/events/ as its rule directory.