Systemd

daemon is a background process that runs continuously on a computer system, often without direct interaction with users. Daemons are typically started during the system boot process and perform various tasks, such as handling system events, providing services, or performing periodic maintenance

Init System:

Service Management:

Dependency Management:

Logging:

Device Management:

Timers:

Security Features:

User Sessions:

Socket Activation:


Few important commands

To check the status of a running service
sudo systemctl status
sudo systemctl status nginx
To start a service
sudo systemctl start
sudo systemctl start nginx
To restart a running service
sudo systemctl restart
sudo systemctl restart nginx
To reload a service running:
sudo systemctl reload
sudo systemctl reload nginx
To stop a service:
sudo systemctl stop
sudo systemctl stop nginx
To auto-start a service on boot:
sudo systemctl enable
sudo systemctl enable nginx
To not auto-start a service on boot:
sudo systemctl disable
sudo systemctl disable nginx

Where is systemd's unit files?
1- /etc/systemd/system
2- /run/systemd/system
3- /lib/systemd/system

To edit a systemd configuration file
sudo systemctl edit
sudo systemctl edit nginx

This creates a override.conf file, which takes priority over your root service file.

To edit a systemd configuration file fully:
sudo systemctl edit --full
sudo systemd edit --full nginx

This opens the actual service file and you can edit it, and it creates a file in /etc/systemd/system, which is the highest priority directory. And you can override the current configurations.