Your Linux PC Has Daemons. Here’s Everything You Need to Know About Them

https://www.profitableratecpm.com/f4ffsdxe?key=39b1ebce72f3758345b2155c98e6709c

Summary

  • Demons are essential Linux programs performing tasks. Systemd’s; Systemctl provides procedures to manage, start or stop them effectively.

  • The demons were inspired by the concept of Maxwell demon in physics. Systemd manages the tasks of the modern Linux system. Knowing the functions of demons is crucial.

  • Use commands such as Systemctl to display the current demons, activate / deactivate demons and start / stop services on a Linux system. Understanding demons can make systems management effortlessly.

You may have heard the term “demon” about Linux. What are they? Do they have something to be afraid? These small aid programs are an important part of Linux and will help take care of your systems and manage essential services.

What are demons?

In Linux, demons are programs that run independently to perform various tasks on the system. These are things like CRON execution to perform tasks at specific times, listen to the incoming network connections and clean the file system, among others. They usually have names ending with “-d”.

The concept appeared in the 1960s with the Multic project, an ambitious attempt to create what would now be called “Cloud Computing”. The computer scientist of MIT Fernando Carbató is recognized to invent the term in a computer context, inspired by the thought experience of physicist James Clark Maxwell on an imaginary demon sorting molecule, known as “Maxwell Demon”.

Corbató later wrote the inspiration of the term:

Maxwell’s demon was an imaginary agent who helped sort the molecules with different speeds and worked tirelessly in the background. We started using the word demon to describe the background processes that worked tirelessly to perform system tasks.

On other multitasking operating systems, these types of programs are often called “services”. It may be the best way to think them.

A good example is Crond (pronounced “Cron-D”), which performs specific tasks in Crontab files. On the main modern distros, tasks that would have been managed by a separate demon are presented more and more under the Systemd umbrella. If you look at the in progress, this would include things like Systemd-Networkd, Systemd-Journald and Systemd-Timesyncd.

Related

Why the Linux Systemd is still in the division after all these years

A decade after its first introduction, Systemd is still the target of wild opposition – but why? Is indignation justified?

Modern linux systems will have many demons in the background, especially on servers. Even on office systems, there may be dozens, even hundreds, in the background. This is one of the reasons why you have to engrave your system elegantly instead of simply pressing the power button when you can.

Display of demons in progress

You can see which demons work on your system with a few simple commands.

The simplest way on most modern distros is to use the Systemctl command provided by Systemd. You can display all your system services by simply using Systemctl alone. A “unit” is a small text file which indicates to Systemd how to load a program, and other units of which a unit could have, called “dependencies”, postponing the management of packages.

        
systemctl list-units
Release of the Linux Systemctl - List units in the terminal.

You can also display Systemd units which are in fact demons by listing services, which is the term that Systemd has adopted:

        systemctl list-units --type=service
    
Exit from Systemctl-List-Nunits-Netty = Service in the Linux Terminal

This lists all the service units installed on your system. To see which ones are actually running, you can use this command:

        systemctl list-units --type-service state=active
    
Listing of execution services in Linux using Systemctl.

This will give you a list of services in progress. On this Debian virtual machine, we have a number of active services, including Avei, which allows the system to automatically connect to other devices such as printers on the local network, NetworkManager, which manages the network connection. I like the way he is carefully placed in a table. The “Description” section tells you what these services really do.

The Windows task manager simply lets you look for what these mysterious services do for yourself, but they have at least a quick link to search for it.

The other classic way of visualizing demons in progress is to use the PS command. We can use the “to” options to display all the system processes, no matter to whom they belong, because most of the processes belong to the superutilizer, and you are probably not the superupotator. If you are, you should probably change this quickly by configuring your own user account.

To see all the processes on the system with PS:

ps aux
List of processes being executed from "PS" on Linux.

You will not have as much information about it is demons, but a good clue is that if the name ends with “-d” as I mentioned earlier. The “Tty” field will also generally have a “?”? ” (question mark), which indicates that they were started without controlling terminal.

Operating process in HTop in the Linux terminal.

You can also display all the running processes, including demons, with the top or the HTOP, which offers a more colorful output.

Activate and deactivate demons

You can activate and deactivate demons at will. Linux is traditionally a system of experts and puts few barriers on your way to manage your system as you wish.

The most common way to add a new demon to your system is to install it from your package manager. For example, if you wanted to install the Nginx web server on a Debian or Ubuntu system, assuming that you have administrative privileges:

        
sudo apt install nginx

What is happening later depends on the distribution you use. Some distros, such as Debian and Ubuntu, will allow a Boot service. Others, like Arch, will generally leave you this work. It’s easy to do with Systemctl. Y

To activate a demon:

        sudo systemctl enable daemon.service
    

For example, to activate Nginx:

        sudo systemctl enable nginx.service
    
Nginx activation with Systemctl.

Deactivation of demons using systemctl is similar

sudo systemctl disable nginx.service
Deactivation nginx with systemctl.

Make sure to know what a demon does before deactivating it, especially those that have been installed with your system. If in doubt, leave it alone.

Start and stop demons

You don’t have to wait for the restarts to make changes to the execution demons. You can start and stop demons at will as long as you have administrative authorizations. On most Linux systems, this would mean that you have access via the root or sudo password. We will use the latter.

You may want to start a demon when you have installed one. Depending on the distribution, it can be started automatically when you install a demon from the package manager in your distribution. Debian and Ubuntu are good examples. On other distros, you may be responsible for starting it yourself. Arch Linux is a good example of the latter.

Or you may want to start a demon again after stopping it earlier.

Suppose you want to start the Nginx web server. To do this using Systemctl:

        systemctl start nginx.service
    

You can also stop the executing services. Again, you can use Systemctl to stop the process

        sudo systemctl stop nginx.service
    

Starting and stopping processes in this way will only affect current start. To make more permanent changes, you will have to activate or deactivate the services using the methods mentioned in the “Activation and deactivation of demons” section.

Often you will want to restart a demon. You may have updated the version of the demon running or make a modification to its configuration order. One way to do it would be to stop, then start the demon again:

        sudo systemctl stop daemon.service
sudo systemctl start daemon.service

You can do it in a command line and save a little wear on your fingers with the Systemctl Restart command. Suppose you have made changes to your Nginx server and want to test them. You can use this command:

        sudo systemctl restart nginx.service
    

Related

Why I stick to Linux Distros based on Systemd

How I learned to stop worrying and like systemd.

It is how easy it is on a modern Linux system. Even with the complaints concerning the supposed bloating of Systemd, it facilitated the starting and stopping processes without having to dig through symbolic links as I had with the old Sysvinit system. I assume that many other developers and Sysadmin systems feel the same thing, given the speed with which Systemd was accepted in the Linux ecosystem


Demons may seem frightening if you are not used to them, but some orders are everything you need to tame them on your Linux system. You may not notice them, but they are still there on your Linux system, which makes your life easier.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button