Linux Systemd

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 14:16, 22 September 2024 by Littleguy (Talk | contribs)

Jump to: navigation, search

systemd provides an array of system components for Linux operating systems. Its main aim is to unify service configuration and behavior across Linux distributions. It is the controlling interface and inspection tool for the init system and service manager systemd.

systemd replaces [Linux Sys V]] - We used to control system services with commands like "service httpd restart" and now we use instead the awkwardly syntaxed systemctl such as "systemctl restart httpd" or "systemctl restart apache2"

systemd uses the systemctl command

systemctl command

Command	Description
systemctl start [service]		Start a service.
systemctl stop [service]		Stop a service.
systemctl enable [service]		Enable a service to start automatically at system boot.
systemctl disable [service]		Disable a service from starting automatically at system boot.
systemctl status [service]		View the status of a service.
systemctl restart [service]		Restart a service.
systemctl reload [service]		Reload a service's configuration without restarting it.
systemctl mask [service]		Prevent a service from being started.
systemctl unmask [service]		Allow a previously masked service to be started.
systemctl set-default [target]		Change the default system target (runlevel).
systemctl list-unit-files		List all installed unit files and their states.
systemctl list-dependencies [unit]	List the dependencies of a specific unit.
systemctl list-sockets			List all active sockets.
systemctl list-jobs			List all active systemd jobs.
systemctl list-units			Show the status of all loaded and active systemd units.

To start the service, all you have to do is use the start flag with the systemctl command

sudo systemctl start <service_name>

To stop the service, you use the stop flag with the systemctl command

sudo systemctl stop <service_name>

Enabling service referes to start the service automatically at the system boot.

sudo systemctl enable <service_name>

Prevent the service from auto starting at boot

sudo systemctl disable <service_name>

Check the status of the service

sudo systemctl status <service_name>