Fedora - The Boot Process

Fedora 2 boots is the usual Red Hat way. Its initscripts are more or less similar in the various RedHat versions, as it often happens when a process is tested and mature enought to not need particular changes.

Boot Loader
Fedora's default boot loader is Grub, the directory /boot/grub/ contains all the configuration files and the binaries, grub.conf contains all the configuration data (/boot/grub/menu.lst and /etc/grub.conf are both symlinks to it), /boot/grub/splash.xpm.gz is the default splash images shown under the text in Grub.

The core binary is placed in /boot/vmlinuz-version, System Map is /boot/System.map-version and the boot initialized ram disk data in /boot/initrd-version. A nice plus, introduced with Fedora is the presence of /boot/config-version (installed by a kernel rpm) with the complete configuration of the current kernel (a .config file which can be used as starting point for a new kernel configuration or for historycal reasons).
Modules are placed in /lib/modules/version.

/etc/inittab has a standard logic, with mingetty started at runlevels superior to 1 (so in single user mode no password is asked and a root shell is directly invoked). The first initialization script, executed at every runlevel is /etc/rc.d/rc.sysinit, then are executed the various services according to the SysV logic of the /etc/rc#runlevel.d directories.
Many system configuration files are placed in /etc/sysconfig/ and are loaded (sourced) in the boot phase.
/etc/rc.d/rc.sysinit takes care of various setup activities, according to the following order:
- Uses initlog to log it activities according do what is configured in /etc/initlog.conf and /etc/syslog.conf
- If DEVFS is used, starts devfsd
- Sets up hostname, hosttype and sources /etc/sysconfig/network
- Mounts the procfs and the sysfs in /proc and /sys
- Checks SeLinux status (disable by default)
- Sources /etc/init.d/functions with various common shell functions used by other init scripts: daemon() ,  killproc() , pidofproc() , status() , echo_success() (the green OK) , confirm() ...
The script also sources some important configuration files:  /etc/sysconfig/i18n (the system default language, in UTF format (ex: LANG="en_US.UTF-8"), which can create problems with some older software, particularly in Perl, either export LANG="en_US" before launching a troubled application or set it directly in /etc/sysconfig/i18n), /etc/sysconfig/init (the various color codes used in the booting output).
- Sets the system default font
- Prints the well known "Welcome to ..." banner
- Starts the graphical boot screen with the rhgb program which uses graphics from /usr/share/rhgb (change to customize)
- Configures kernel according to /etc/sysctl.conf settings
- Sets system clock accoring to /etc/sysconfig/clock parameters
- Sets the keyboard layout according to /etc/sysconfig/keyboard (change here to manage the keyboard settings in text mode)
- Initializes ACPI settings
- Initializes USB controller and HID devices
- Checks the files /fastboot, /fsckoptions, /forcefsck and /.autofsck and sources /etc/sysconfig/autofsck in order to determine if and how launch a file system check.
- Checks quota settings if any
- Sets up ISA PNP devices according to the configuration file /etc/isapnp.conf
- Mounts the Root filesystem in read/write mode
- If configured sets up the Logical Volume Management (LVM)
- Activates swap space
- Loads kernel modules with the parameters specified in /etc/modules.conf
- Starts raid (MD) devices
- If there is the /.unconfigured flag files, starts the first boot configuration procedure
- Removes various flag files in / , /var/lock , /var/run , removes the rpm database (/var/lib/rpm/__db*, it's rebuilt when a new rpm command is issued) and various files in the /tmp directory.
- Inizializes serial ports, SCSI tapes, USB storage, Firewire
- Turns on hard disk optimization with hdparm according to the settings in /etc/sysconfig/harddisks*
- If profiles are configured, it activates the default network profile

It's now time to switch to the default runlevel and activate the services (whose initialization scripts are in /etc/init.d/ according to the symlinks in /etc/rc#.d/ in typical SysV fashion.
The last script to be executed is /etc/rc.local where the user can place custom commands.

To manage services (start|stop|restart|reload...) it's possibile to invoke directly the relative script or use the service command. For example:
[[email protected] al]# service httpd start
does the same (starting the Apache Web server) of:
[[email protected] al]# /etc/init.d/httpd start
which, since /etc/init.d is actually a symlink to /etc/rc.d/init.d, is exactly equivalent to:
[[email protected] al]# /etc/rc.d/init.d/httpd start  

Privacy Policy