πDay 2: Users, Processes, systemctl & journald

Series: 30 Days DevOps Interview Preparation
Author: Tathagat Gaikwad
π Introduction
Welcome to Day 2 of the 30 Days DevOps Interview Preparation Challenge!
Today, we go beyond file systems and permissions and explore how Linux handles users, processes, service management (systemctl), and logging (journald).
These are key skills in troubleshooting, monitoring, and managing systems as a DevOps or Cloud Engineer.
π Linux Users & Groups
π§ Types of Users
Root: The superuser with full access
System Users: Created by the OS or services (like
nginx
,mysql
)Normal Users: Created for real human logins
π Important Files
/etc/passwd
β User account information (username, UID, shell)/etc/shadow
β Password hashes and password expiration/etc/group
β Group information
π§ Common User Commands
# Add a new user
sudo useradd devops_user
# Set password for a user
sudo passwd devops_user
# Modify user (add to group)
sudo usermod -aG docker devops_user
# Show user groups
groups devops_user
# Get user info
id devops_user
βοΈ Linux Processes
A process is any running instance of a program.
π§© Process Attributes
PID (Process ID): Unique identifier
PPID (Parent PID): ID of parent process
Nice Value: Priority of a process
State: Running, Sleeping, Zombie, etc.
π Useful Process Commands
ps aux # Show all running processes
top # Live system view
htop # Interactive process viewer (must install)
kill -9 <pid> # Force kill process
nice -n 10 <cmd> # Start a process with priority
renice -n -5 <pid> # Change priority of existing process
π§ͺ Practice
Find top CPU-consuming process using
top
Kill a hanging process using
kill -9
Launch a background process:
sleep 300 &
π systemctl (Systemd Service Manager)
systemctl is the command-line tool to control services in SystemD-based Linux distributions.
π§ Common Commands
# Check status of a service
sudo systemctl status sshd
# Start / Stop / Restart a service
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
# Enable/disable service to run at boot
sudo systemctl enable docker
sudo systemctl disable docker
# Reload systemd manager config
sudo systemctl daemon-reexec
β Tip:
Use systemctl is-enabled <service>
to verify startup behavior.
π journald β SystemD Logging
SystemD includes journald, a logging service that replaces traditional syslog
.
π Use journalctl to View Logs
# All logs
journalctl
# Logs for a specific unit/service
journalctl -u docker
# Logs since last boot
journalctl -b
# Follow live logs like tail
journalctl -f
# Show logs for specific time
journalctl --since "2 hours ago"
π§ͺ Practice
Stop a service and view its failure log with
journalctl -xe
Monitor system logs live while restarting a service
π― Interview Preparation
π§ Sample Questions:
Whatβs the difference between
/etc/passwd
and/etc/shadow
?How can you check which groups a user belongs to?
What is the difference between
ps
,top
, andhtop
?How would you troubleshoot a service that fails to start?
How do you inspect logs of a service started via systemd?
β Wrap-Up
Understanding how Linux handles users, processes, and system services is critical in debugging, managing workloads, and automating infrastructure in a DevOps role.
#DevOps #Linux #Systemctl #ProcessManagement #Journalctl #30DaysOfDevOps #InterviewPrep #ShellScripting #CloudEngineer
Subscribe to my newsletter
Read articles from Tathagat Gaikwad directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
