Lect07 - Linux System Startup Flashcards
1
Q
What are the basic steps when a computer boots with Linux?
A
-
Computer Boot (EFI / BIOS POST)
- Power Cycle or software runlevel -
Boot Loader initiated
- LILO, loads from MBR -
Kernel initialized
- Brain of the OS are started. -
System start (systemd vs BSD style init)
- Initialize the runlevel and startup scripts
- Terminal process control -
User is passed to the shell (bash)
- login shells start based on the user’s entry in /etc/passwd
2
Q
Name the six runlevels?
A
0 = Halt the system
1 = Single user mode
2 = Local multiuser with / without network service
3 = Full multiuser with networking
4 = Not used / X11 with KDM/GDM/XDM
5 = Full multiuser with network and GUI
6 = Reboot
3
Q
Explain the Slackware boot process:
A
- Power On
- MBR
- LILO (/etc/lilo.conf)
- Kernel (/boot)
- /sbin/init (/etc/inittab)
- Runlevel Scripts (/etc/rc.d [rc.S -> rc.M])
- Bash (/etc/profile)
4
Q
Explain the following run scripts:
- /etc/rc.d/rc.S
- /etc/rc.d/rc.X
- /etc/rc.d/rc.local
- /etc/rc.d/rc.local_shutdown
A
-
/etc/rc.d/rc.S
handles system initialization, file system mount and check, encrypted volumes, swap initialization, devices, etc -
/etc/rc.d/rc.X
where X is the run level passed as an argument by init. In the case of multi-user (non GUI) logins (run level 2 or 3), this is rc.M. This script then calls other startup scripts (various services, etc.) by checking to see if they are “executable”. -
/etc/rc.d/rc.local
called from within the specific run level scripts, rc.local is a general purpose script that can be edited to include commands that you want started at boot up. -
/etc/rc.d/rc.local_shutdown
This file should be used to stop any services that were started in rc.local. Create the file and make it executable to have it run.
5
Q
Explain the following custom files of the bash:
- /etc/profile
- /home/$USER/.bash_profile
- /home/$USER/.bash_history
- /home/$USER/.bashrc
A
-
/etc/profile
This is the global bash initialization file for interactive login shells. Edits made to this file will be applied to all bash shell users. This file sets the standard system path, the format of the command prompt and other environment variables. -
/home/$USER/.bash_profile
Can be edited by the user, allowing him or her to customize their own environment. It is in this file that you can add aliases to change the way commands respond. -
/home/$USER/.bash_history
It stores a set number of commands that have already been typed at the command line (default is 500). -
/home/$USER/.bashrc
.bashrc is a shell script that Bash runs whenever it is started interactively. It initializes an interactive shell session. You can put any command in that file that you could type at the command prompt.