Enter your search text in the box above
Select a result to preview
A 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:
- systemd replaces the traditional init system as the first process (PID 1) that gets executed on Linux systems during the boot process. It initializes the system and manages the execution of user and system processes.
Service Management:
- systemd provides a sophisticated service management framework. It can start, stop, restart, enable, and disable services. Services are defined using unit files with a
.service extension.
Dependency Management:
- systemd handles dependencies between services, ensuring that services start in the correct order based on their dependencies.
Logging:
- systemd includes its own logging system called
journalctl, which collects and manages system logs. It allows for centralized logging and querying of log data.
Device Management:
- systemd manages device events, automounting and hot-plugging devices as needed. This includes udev integration for dynamic device management.
Timers:
- systemd includes a timer unit for scheduling tasks. Timer units can trigger services or other actions at specified intervals.
Security Features:
- systemd includes various security features, such as cgroups (control groups) for process isolation, and the ability to run services in their own user and group namespaces.
User Sessions:
- systemd supports user sessions, allowing users to start and manage their own services within their login sessions.
Socket Activation:
- systemd supports socket activation, where services are only started when a connection is received on a specified socket. This can improve resource utilization and reduce startup times.
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.