How To List All Running Daemons In Linux
A daemon is a background process that runs without direct user interaction. Linux systems use different init (initialization) systems to manage daemons. The common ones are Systemd, SysVinit, and OpenRC. In this tutorial, we will explain different ways to list all running daemons for each init system in Linux.
Table of Contents
Understanding Daemons, Processes and Init Systems
Before getting into the topic, allow me to briefly explain the following key terminologies, as they are important for understanding the rest of the tutorial.
- Daemon,
- Process,
- Init system.
If you want to manage services (like starting or stopping a web server), you need to understand daemons and the init system.
If you want to monitor or troubleshoot your system, you need to understand processes.
1. What is a Daemon?
A daemon is a background process that runs continuously on a Linux system, usually without direct user interaction.
Daemons provide essential services to the system or other programs. For example:
- sshd manages SSH connections.
- cron schedules tasks.
- apache2 serves web pages.
Daemons typically start when the system boots and keep running until the system shuts down.
Example:
If you’re using a web server, the apache2 or nginx daemon runs in the background to handle web requests.
Fun fact: Daemon names often end in "d" (like sshd, crond).
2. What is a Process?
A process is any program or task that is currently running on your system.
Types of Processes:
- Foreground Processes: These are started by the user and interact directly with the user (e.g., a web browser or text editor).
- Background Processes: These run without user interaction (e.g., a file download or system update).
- Daemons: A special type of background process that provides system services.
You can list all processes using commands like ps or top.
ps aux
You can the check a specific process's (E.g. nano) PID using command:
ps aux | grep nano
Example:
When you open a terminal, a bash process starts. If you run a command like ls, a new process is created to execute that command.
Related Read:
- How To Find Parent Process ID (PPID) In Linux: A Step-by-Step Guide
- How To Display Process Information Using Procs On Linux
- How To Find Out How Long A Process Has Been Running In Linux
- How To Change The Priority Of A Process In Linux
- How To Suspend A Process And Resume It Later In Linux
- Reptyr – Move A Running Process From One Terminal To Another Without Closing It
3. What is an Init System?
The init system is the first process that starts when a Linux system boots (with Process ID 1, or PID 1). It manages all other processes and services on the system.
The init system is responsible for:
- Starting and stopping system services (daemons).
- Managing dependencies between services.
- Handling system shutdown and reboot.
Some of the Common Init Systems are:
- Systemd: The most widely used init system in modern Linux distributions (e.g., Ubuntu, Fedora, Debian). Commands to manage systemd are systemctl, and journalctl.
- SysVinit: An older init system used in traditional Linux distributions. Commands to manage SysVinit are service, /etc/init.d/.
- OpenRC: A modern, flexible, and lightweight init system, often used in Gentoo,Alpine Linux, andArtix Linux.
- Upstart: A transitional init system used in some older Ubuntu versions. Command to manage is initctl. It is now obsolete, as most recent Ubuntu distributions have moved tosystemd.
Example:
When you boot your system, the init system starts essential daemons like sshd (for SSH) and cron (for scheduled tasks).
The init system starts and manages daemons (background services). Both daemons and regular programs (like a web browser) are types of processes. You can list all processes using tools like ps, but you need init-specific commands (e.g., systemctl) to manage daemons.
To check your init system, run:
ps aux
Example Output:
ps aux | grep nano
This means the system uses Systemd.
Summary Table
2. Display All Running Daemons using SysVinit
SysVinit uses init scripts stored in /etc/init.d/. It is used in older versions of Linux distros such as Debian 7, CentOS 6.
To list running services:
ps aux
Explanation:
- service --status-all → Lists all services and their statuses.
- grep " " → Filters out only running services (services with [ ] in the output).
Example Output:
ps aux | grep nano
Here, cron and networking are running, while apache2 is stopped.
3. View Running Daemons using OpenRC
OpenRC manages services using rc-status in some linux distributions such as Alpine Linux, and Gentoo.
To list active daemons:
ps --pid 1
Example Output:
PID TTY TIME CMD 1 ? 00:00:00 systemd
Cheatsheet for Listing Running Daemons in Linux
Init System | Command to List Running Daemons | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
systemctl list-units --type=service --state=running | ||||||||
SysVinit |
service --status-all | ||||||||
OpenRC |
rc-status |
init systems, and the key differences between processes and daemons
to clarify their roles in a Linux system.We also covered how to list running daemons across different init systems, such as Systemd, SysVinit, and Upstart, along with practical examples.We hope this guide has been helpful!The above is the detailed content of How To List All Running Daemons In Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Linux is best used as server management, embedded systems and desktop environments. 1) In server management, Linux is used to host websites, databases, and applications, providing stability and reliability. 2) In embedded systems, Linux is widely used in smart home and automotive electronic systems because of its flexibility and stability. 3) In the desktop environment, Linux provides rich applications and efficient performance.

The five basic components of Linux are: 1. The kernel, managing hardware resources; 2. The system library, providing functions and services; 3. Shell, the interface for users to interact with the system; 4. The file system, storing and organizing data; 5. Applications, using system resources to implement functions.

Linux system management ensures the system stability, efficiency and security through configuration, monitoring and maintenance. 1. Master shell commands such as top and systemctl. 2. Use apt or yum to manage the software package. 3. Write automated scripts to improve efficiency. 4. Common debugging errors such as permission problems. 5. Optimize performance through monitoring tools.

The methods for basic Linux learning from scratch include: 1. Understand the file system and command line interface, 2. Master basic commands such as ls, cd, mkdir, 3. Learn file operations, such as creating and editing files, 4. Explore advanced usage such as pipelines and grep commands, 5. Master debugging skills and performance optimization, 6. Continuously improve skills through practice and exploration.

Linux is widely used in servers, embedded systems and desktop environments. 1) In the server field, Linux has become an ideal choice for hosting websites, databases and applications due to its stability and security. 2) In embedded systems, Linux is popular for its high customization and efficiency. 3) In the desktop environment, Linux provides a variety of desktop environments to meet the needs of different users.

Linux devices are hardware devices running Linux operating systems, including servers, personal computers, smartphones and embedded systems. They take advantage of the power of Linux to perform various tasks such as website hosting and big data analytics.

The disadvantages of Linux include user experience, software compatibility, hardware support, and learning curve. 1. The user experience is not as friendly as Windows or macOS, and it relies on the command line interface. 2. The software compatibility is not as good as other systems and lacks native versions of many commercial software. 3. Hardware support is not as comprehensive as Windows, and drivers may be compiled manually. 4. The learning curve is steep, and mastering command line operations requires time and patience.

Linuxisfundamentallyfree,embodying"freeasinfreedom"whichallowsuserstorun,study,share,andmodifythesoftware.However,costsmayarisefromprofessionalsupport,commercialdistributions,proprietaryhardwaredrivers,andlearningresources.Despitethesepoten
