LPI-1 Linux Certification – SysV Startup Sequence

SysV startup sequence

OS startup sequence (SysV) Debian Red Hat
At startup /sbin/init executes all instructions on /etc/inittab . This script at first switches to the default runlevel… id:2:initdefault: id:5:initdefault:
… then it runs the following script (same for all runlevels) which configures peripheral hardware, applies kernel parameters, sets hostname, and provides disks initialization… /etc/init.d/rcS /etc/rc.d/rc.sysinit or/etc/rc.sysinit
… and then, for runlevel N, it calls the script/etc/init.d/rc N (i.e. with the runlevel number as parameter) which launches all services and daemons specified in the following startup directories: /etc/rcN.d/ /etc/rc.d/rcN.d/

The startup directories contain symlinks to the init scripts in /etc/init.d/ which are executed in numerical order. Links starting with K are called with argument stop, links starting with S are called with argument start.

lrwxrwxrwx. 1 root root   14 Feb 11 22:32 K88sssd -> ../init.d/sssd
lrwxrwxrwx. 1 root root   15 Nov 28 14:50 K89rdisc -> ../init.d/rdisc
lrwxrwxrwx. 1 root root   17 Nov 28 15:01 S01sysstat -> ../init.d/sysstat
lrwxrwxrwx. 1 root root   18 Nov 28 14:54 S05cgconfig -> ../init.d/cgconfig
lrwxrwxrwx. 1 root root   16 Nov 28 14:52 S07iscsid -> ../init.d/iscsid
lrwxrwxrwx. 1 root root   18 Nov 28 14:42 S08iptables -> ../init.d/iptables


The last script to be run is S99local -> ../init.d/rc.local ; therefore, an easy way to run a specific program on boot is to add it to this script file.

/etc/init.d/boot.local   runs only at boot time, not when switching runlevel.

/etc/init.d/before.local (SUSE) runs only at boot time, before the scripts in the startup directories.

/etc/init.d/after.local     (SUSE) runs only at boot time, after the scripts in the startup directories.


Debian Red Hat
To add or remove services at boot sequence: update-rc.d service defaults update-rc.d -f service remove chkconfig –add service chkconfig –del service
Parameters supported by the init scripts
start Start the service Mandatory
stop Stop the service
restart Restart the service (stop, then start)
status Display daemon PID and execution status
force-reload Reload configuration if the service supports this option, otherwise restart the service
condrestart try-restart Restart the service only if already running Optional
reload Reload service configuration

/etc/init.d/service start

service service start    (Red Hat)                Start a service

rcservice start              (SUSE)

LPI-1 Linux Certification – Runlevels

Runlevel Debian Red Hat
0 Shutdown
1 Single user / maintenance mode
2 Multi-user mode (default) Multi-user mode without network
3 Multi-user mode Multi-user mode with network
4 Multi-user mode Unused, for custom use
5 Multi-user mode Multi-user mode with network and X(default)
6 Reboot
S Single user / maintenance mode (usually accessed through runlevel 1)

The default runlevels are 2 3 4 5


who -r


Display the previous and the current runlevel
telinit runlevel

init runlevel

init 0

telinit 0

Change runlevel
shutdown -h now



init 6

telinit 6

Halt the system
shutdown -r now


Reboot the system
shutdown Shut down the system in a secure way: all logged in users are notified via a message to their terminal, and login is disabled.

This command can be run only by the root user and by those users (if any) listed in


shutdown -h 16:00 message Schedule a shutdown for 4 PM and send a warning message to all logged in users
shutdown -a Non-root users that are listed in /etc/shutdown.allow can use this command to shut down the system
shutdown -f Skip fsck on reboot
shutdown -F Force fsck on reboot
shutdown -c Cancel an already running shutdown


LPI-1 Linux Certification – Boot sequence

POST (Power-On Self Test) Low-level check of PC hardware.
BIOS(Basic I/O System) Detection of disks and hardware.
Chain loaderGRUB
(GRand Unified Bootloader)
GRUB stage 1 is loaded from the MBR and executes GRUB stage 2 from filesystem.GRUB chooses which OS to boot on.The chain loader hands over to the boot sector of the partition on which resides the OS.

The chain loader also mounts initrd, an initial ramdisk (typically a compressed ext2 filesystem) to be used as the initial root device during kernel boot; this make possible to load kernel modules that recognize hard drives hardware and that are hence needed to mount the real root filesystem. Afterwards, the system runs /linuxrc with PID 1. (From Linux 2.6.13 onwards, the system instead loads into memory initramfs, a cpiocompressed image, and unpacks it into an instance of tmpfs in RAM. The kernel then executes /init from within the image.)

inux kernel Kernel decompression into memory.Kernel execution.Detection of devices.

The real root filesystem is mounted on / in place of the initial ramdisk.

init Execution of init, the first process (PID 1).The system tries to execute in the following order:/sbin/init




If none of these succeeds, the kernel will panic.

Startup The system loads startup scripts and runlevel scripts.
X Server (Optional) The X Display Manager starts the X Server.

Some newer systems use UEFI (Unified Extensible Firmware Interface). UEFI does not use the MBR boot code; it has knowledge of partition table and filesystems, and stores its application files required for launch in a EFI System Partition, mostly formatted as FAT32.

After the POST, the system loads the UEFI firmware which initializes the hardware required for booting, then reads its Boot Manager data to determine which UEFI application to launch. The launched UEFI application may then launch another application, e.g. the kernel and initramfs in case of a boot loader like the GRUB.

LPI-1 Linux Certification – Study Materials

Linux Server Professional Certification Guide

Exam Objectives:



Study Materials:

  1. IBM DeveloperWorks study guide
  2. WikiBooks – LPI Certification Guide
  3. Professor Messer – CompTIA LX0-101 Linux+ and LPIC-1 Training Videos
  4. Cybrary.it Linux+ video training