Linux boot process
- When we start linux machine , the firmware which is stored on EPROM chip in the motherboard initializes the POST (Power-On self test) to check the state of system hardware
- After success, the firmware searches and loads 1st stage boot loader in the MBR or the EFI Partition and gives control
- From here the System startup manager gets called
- Systemd
- SysVinit
SysVinit
- This will have a concept or runlevels which specifies different ways to use a system by controlling which service is running.
- Now execute ls -l /etc | grep rc[0-6].d
- RunLevels
- 0: Halt the system.
- 1: aliased to s or S. this runlevel is called as maintenance mode.
- 2: Multiuser, this is default runlevel
- 3: This was default multiuser mode on Redhat systems, This runs everything apart from graphical environment
- 4: Used for customization
- 5: Used on RedHat systems for GUI login
- 6: Reboot the system
- Now navigate to /etc/init.d and you should be seeing scripts, so these scripts will be executed when the start/stop/reload the service.
Lets switch back to systemd and look at Logging daemon
- Linux distributions traditionally used syslogd to provide the logging services.
- Now modern linux distributions have standardized on the rsyslog package as well as the logging component of systemd referred as journald
- rsyslogd provides standard means of performing logging.
- rsyslogd cand send its output to various destinations
- straight text files in /var/log directory
- SQL databases
- Other hosts
- Each log entry consists of single line containing the date, time, hostname, process name, PID & the message.
- rsyslogd configuration file (/etc/rsyslog.conf)