From 6ee4eea5929066f67cea324e7ed7557a9b3c2f81 Mon Sep 17 00:00:00 2001 From: Anuragtiwari56 <159649200+Anuragtiwari56@users.noreply.github.com> Date: Sun, 5 Apr 2026 00:24:19 +0530 Subject: [PATCH] Create linux-architecture-notes.md Added notes for Day 02 of #90DaysOfDevOps: - Explained Linux core components (kernel, user space, systemd) - Covered process creation and management - Documented process states (running, sleeping, zombie, stopped) - Summarized systemd role in service management and logging - Listed 5 daily commands (ps, top, systemctl, journalctl) This file is under 1 page and serves as a practical reference for Linux troubleshooting. --- 2026/day-02/linux-architecture-notes.md | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 2026/day-02/linux-architecture-notes.md diff --git a/2026/day-02/linux-architecture-notes.md b/2026/day-02/linux-architecture-notes.md new file mode 100644 index 0000000000..36b71c1eec --- /dev/null +++ b/2026/day-02/linux-architecture-notes.md @@ -0,0 +1,39 @@ +# Linux Architecture, Processes, and systemd + +## Core Components +- **Kernel**: The core of Linux. Manages hardware, memory, CPU scheduling, and system calls. +- **User Space**: Where applications, shells, and user processes run. Communicates with the kernel via system calls. +- **Init/systemd**: The very first process started by the kernel. Initializes the system, starts services, and manages dependencies. + +--- + +## Process Management +- Processes are created using `fork()` (to duplicate) and `exec()` (to replace with new program). +- Each process has a **PID (Process ID)**. +- Parent and child processes are linked. +- The kernel schedules processes based on priority and resources. + +### Process States +- **Running** → Actively using CPU. +- **Sleeping** → Waiting for an event or resource. +- **Zombie** → Finished execution but not cleaned up by parent. +- **Stopped** → Suspended, waiting to be resumed. + +--- + +## systemd +- Default init system in most modern Linux distributions. +- Manages services, sockets, devices, and timers. +- Provides **parallel startup** → faster boot times. +- Unified commands (`systemctl`) for starting, stopping, enabling, and checking services. +- Centralized logging via `journalctl`. +- Critical for troubleshooting and service management in production. + +--- + +## Daily Commands +1. `ps aux` → List all processes with details. +2. `top` → Monitor CPU/memory usage in real time. +3. `systemctl status ` → Check service health. +4. `systemctl restart ` → Restart a service. +5. `journalctl -xe` → View detailed logs for debugging.