|
| 1 | ++++ |
| 2 | +date = 2024-01-22T20:17:30-05:00 |
| 3 | +title = "Basics" |
| 4 | +weight = 2 |
| 5 | ++++ |
| 6 | + |
| 7 | +## Boot Process |
| 8 | + |
| 9 | +1. POST |
| 10 | +2. Bootloader |
| 11 | + 1. GRUB: |
| 12 | + 1. Stage 1 # Loads stage 1.5 |
| 13 | + 2. Stage 1.5 # Provides filesystem support, loads stage 2 |
| 14 | + 3. Stage 2 # Contains the bulk of the bootloader, allows users to select kernel and kernel boot options. Loads kernel into RAM |
| 15 | + 2. Solaris (pre-10 1/06) |
| 16 | + 1. mboot |
| 17 | + 2. pboot |
| 18 | + 3. bootblk |
| 19 | +3. Kernel Init |
| 20 | + 1. initrd or initramfs |
| 21 | + 1. Provides temp filesystem required to load kernel modules and drivers |
| 22 | +4. User Space Init |
| 23 | + 1. SysV |
| 24 | + 1. Serial, starts processes one after the other |
| 25 | + 2. When first booting up, kill scripts will generally not be ran |
| 26 | + 3. init (PID 1) # Ancestor of all other processes |
| 27 | + 4. /etc/inittab |
| 28 | + 1. Defines default run level |
| 29 | + 2. Tells the system what to do when rebooted or run level is changed |
| 30 | + 5. Red Hat: |
| 31 | + 1. /etc/rc.d/ |
| 32 | + * Startup scripts |
| 33 | + 2. /etc/rc.d/init.d/ |
| 34 | + * Contains actual service control scripts |
| 35 | + 3. /etc/rc.d/rc.sysinit |
| 36 | + * Config to be run before other services. Time zone, hostname, etc |
| 37 | + 4. /etc/rc.d/rc.local |
| 38 | + * Config to be run after services are up. Typically system specific such as VPNs |
| 39 | + 6. Debian: |
| 40 | + 1. /etc/rc<#>.d/ |
| 41 | + 2. /etc/init.d/rcS |
| 42 | + * equivalent to rc.sysinit |
| 43 | + 2. upstart |
| 44 | + 1. Can run steps in parallel |
| 45 | + 2. Init reads .conf files in /etc/init |
| 46 | + 3. One of those scripts runs /etc/rc.d/rc script for desired runlevel. This provides the SysV backwards compatiability |
| 47 | + 3. systemd |
| 48 | + 1. Can run steps in parallel |
| 49 | + 2. /usr/lib/systemd/systemd (PID 1) # May also be /sbin/init (symbolic link to systemd) |
| 50 | + 3. Units |
| 51 | + * Service # Daemons |
| 52 | + * Socket # IPC and network |
| 53 | + * Target # Similar to runlevel, groups units together during boot up |
| 54 | + * Located in /etc/systemd/system and /usr/lib/systemd/system |
| 55 | + * Units in /etc take precedence |
| 56 | + 4. States |
| 57 | + * Load |
| 58 | + * Did it successfully read the unit's configuration file? |
| 59 | + * Active |
| 60 | + * Is it running? |
| 61 | + * Sub |
| 62 | + * Low-level unit activation state |
| 63 | + 5. /etc/systemd/system/default.target |
| 64 | + * Symbolic link to default target |
| 65 | + 4. SMF # Solaris 10+ |
| 66 | + 1. Can run steps in parallel |
| 67 | + 2. Milestones |
| 68 | + * Replaces runlevels |
| 69 | + 3. /etc/svc/repository.db |
| 70 | + * Config database |
| 71 | + |
| 72 | +## Shells |
| 73 | +### Types |
| 74 | + |
| 75 | +https://phoenixnap.com/kb/linux-shells |
| 76 | + |
| 77 | +https://www.freecodecamp.org/news/linux-shells-explained/ |
| 78 | + |
| 79 | +### Profile Loading |
| 80 | + |
| 81 | +https://youngstone89.medium.com/unix-introduction-bash-startup-files-loading-order-562543ac12e9 |
| 82 | + |
| 83 | +https://access.redhat.com/solutions/452073 |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +## Login |
| 88 | + |
| 89 | + |
0 commit comments