Chapter 8. Linux Process Management

This chapter covers key concepts of processes on Linux and how to manage those processes. In this chapter, we demonstrate case examples using SSH remote login. If you haven't done SSH remote login setup yet, check the following topic pages.
Once you confirm the above settings are performed, connect with the server using your terminal or VS Code.
To connect to the remote server using the terminal:
Run the command below.
ssh ssh_test
To connect to the remote server using VS Code:
Use GUI (Graphic User Interface). Open the Remote SSH extension and select the SSH host connected with the Lightsail instance.

Once the SSH remote login is established, the terminal will look like shown below.
What We Cover in This Chapter
The following topics are covered in this chapter:
Process and Job
In this section, we'll explore the distinction between processes and jobs in Linux. Jobs are processes initiated by the terminal, whereas processes are any programs running on the system. We’ll cover how job IDs and process IDs are used for management and differentiation in Linux.
Foreground and Background Jobs
In this section, we’ll cover the difference between foreground and background jobs. We'll also look at how to run jobs in the background, as well as how to suspend and resume them, which is essential for multitasking in Linux.
jobs and ps (Display Jobs and Processes)
Here, we'll introduce two important commands: jobs
and ps
. The jobs
command lists the jobs running in the background, while ps
helps display the active processes. We’ll cover how to use these commands effectively to manage your system's processes.
Signals
In this section, we'll explain how Linux uses signals to interact with processes. You’ll learn how to send signals like SIGTERM
and SIGKILL
to stop, suspend, or kill processes. We’ll also demonstrate using keyboard shortcuts like Ctrl+C
and Ctrl+Z
.
Create, Stop and Switch Jobs
We’ll show you how to create, stop, and switch jobs between the foreground and background. By the end of this section, you'll be comfortable managing multiple processes at once using Linux job control techniques.
Daemon Processes
In this section, we’ll explain daemon processes—background services that start when the system boots and run continuously. We’ll cover their roles, such as handling network requests and managing services like sshd and apache2.
What Is Service on Linux?
In this topic, we'll clarify the concept of services in Linux. We'll explore how services are typically implemented as daemon processes, with examples like SSH and Apache services that run without direct user interaction.
Systemd
This section will introduce systemd
, the system and service manager for Linux. We’ll explain how it initializes system services, manages processes, and interacts with other services during boot and runtime.
Unit File
In this section, we’ll explore unit files
, which define services, targets, and other system components in systemd
. We'll explain the structure of a unit file and how it manages system resources.
Systemctl Sub-Commands
We’ll cover the systemctl
command, a powerful tool for controlling systemd
services. We'll walk you through common systemctl
sub-commands such as start, stop, enable, and disable, and how they are used to manage services in Linux.
Create Custom Unit and Start at Boot
This section will guide you through creating a custom unit file to run a service automatically at boot time. You'll learn how to enable a service and set up automatic startup for your custom services.
Firewall
In this topic, we’ll introduce firewalls in Linux and their role in securing network traffic. We'll show you how to use firewalls to block malicious traffic while allowing legitimate connections.
UFW (Uncomplicated Firewall)
We’ll demonstrate how to use UFW, a simple frontend for iptables. This section covers setting up basic firewall rules like allowing or blocking specific ports or IP addresses, as well as enabling and disabling UFW.
Web Server
In this section, we'll introduce web servers, specifically focusing on Apache and Nginx. You'll learn how to install, configure, and launch these servers to host websites on your Linux system.
Launch Apache Web Server
Finally, we’ll demonstrate how to launch an Apache web server on your Linux system. You’ll learn the steps to install, configure, and serve a simple webpage using Apache, and ensure the server is running securely.
Learn offline for better focus!
A book for this course is available on Amazon.
Linux Visual Guide
Step-By-Step Manual for Complete Beginners to Mastering Linux Basics, Vim Editor, Command Management, Remote Server Operation, and More.
Get the Book Now