Today’s Learning Log – Processes, Signals, and Services in Linux

Today I dove deep into Linux process management, signals, and system services. Here’s the breakdown of what I learned and practiced.
Processes and Their States
Foreground – process runs in direct interaction with the terminal; you can’t use the terminal until it finishes.
Background – process runs without blocking the terminal; you can continue typing other commands.
You can suspend a foreground process with
Ctrl+Z
and bring it back withfg
.Parent process – the process that spawned another process. On most modern Linux systems,
systemd
is the ultimate parent for many processes.
Checking Processes
Command | Purpose |
ps | Shows running processes for the current shell. |
ps aux | Lists all processes from all users, with more detail. |
top | Real-time process viewer, showing CPU/memory usage and other stats. |
pid | Process ID – unique number given to each process. |
Signals and Killing Processes
Signals are messages sent to processes by the OS or other processes.
Common ones:
SIGTERM (15) – Politely asks a process to terminate (default for
kill
).SIGKILL (9) – Immediately kills a process; can’t be caught or ignored.
SIGSTOP – Suspends a process (similar to what Ctrl+Z triggers)
SIGCONT – Resumes a stopped process.
kill <PID>
– Sends a signal (default SIGTERM) to a process.kill -l
– Lists all available signals.man 7 signal
– Detailed info on all signals.
The Kernel
The kernel is the core of the OS, managing hardware, processes, memory, and devices.
All processes ultimately run under the kernel’s control.
Namespaces
Namespaces are a way Linux isolates processes, network interfaces, mount points, etc., so different processes can have their own separate “view” of the system.
Used heavily in containers like Docker.
Managing Services with systemctl
Command | Purpose |
systemctl start <service> | Starts a service immediately. |
systemctl stop <service> | Stops a running service. |
systemctl enable <service> | Enables a service to start on boot. |
systemctl enable --now <service> | Enables and starts a service immediately. |
Example: systemctl stop apache2 | Stops the Apache HTTP server. |
Why sudo
can still matter even for root:
Even if you’re in a root shell, sudo
may still be recommended because:
It ensures the correct environment variables are set for system commands.
It logs the command for auditing and traceability.
It avoids running an entire shell as root, reducing risk.
On some systems, it’s required to interact with certain privileged sockets (like systemd’s control interface).
Quick Script Example for Foreground/Background Practice
#!/bin/bash
echo "Running..."
sleep 100
Closing Thoughts
Today’s session gave me a clearer picture of how Linux handles processes and services. I now understand the difference between foreground and background tasks, how to view and manage processes with tools like ps
and top
, and how signals control what happens to them. I also learned that system services are managed with systemctl
and why sudo
can still matter even when you’re root. These basics feel like the foundation I’ll keep building on as I explore more advanced Linux topics.
Subscribe to my newsletter
Read articles from Andrii R directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
