Systemctl - System and Service manager for linux systems
Basics about systemd:
Features:
1.Parallel startup of system service at boot time
2.On demand activation of daemons
3.Dependecy based service control logic
* limited support at runlevel
* panic is not support panic command(systemctl no custom commands)
* systemctl can only communicate with services which are started by systemd
* sysd stop only running services
* system services don't inherit any context like HOME or PATH variable
* All services subject to default timeout of 5 minutes can be configured.These prevents from system to freeze in case of some application stop to respond.
Systemd units: service , path, mount, snapshot, swap, timer, device etc
Unit Type
File Extension
Description
Service unit
.service
A system service.
Target unit
.target
A group of systemd units.
Automount unit
.automount
A file system automount point.
Device unit
.device
A device file recognized by the kernel.
Mount unit
.mount
A file system mount point.
Path unit
.path
A file or directory in a file system.
Scope unit
.scope
An externally created process.
Slice unit
.slice
A group of hierarchically organized units that manage system processes.
Snapshot unit
.snapshot
A saved state of the systemd manager.
Socket unit
.socket
An inter-process communication socket.
Swap unit
.swap
A swap device or a swap file.
Timer unit
.timer
A systemd timer.
unit file's Filelocation: /etc/systemd/system
Conf file: /etc/systemd/system.conf
Systemd provides a lot of functionallity basically you can control all the resouces of linux system that gives you give a lot of functionality.We are focussing on managing system service in this article.
for more details: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-managing_services_with_systemd
MANAGING SYSTEM SERVICES:
systemctl
Description
systemctl start name.service
Starts a service.
systemctl stop name.service
Stops a service.
systemctl restart name.service
Restarts a service.
systemctl try-restart name.service
Restarts a service only if it is running.
systemctl reload name.service
Reloads configuration.
systemctl status name.service
systemctl is-active name.service
Checks if a service is running.
systemctl list-units --type service --all
Displays the status of all services.
systemctl
Description
systemctl enable name.service
Enables a service.
systemctl disable name.service
Disables a service.
systemctl status name.service
systemctl is-enabled name.service
Checks if a service is enabled.
systemctl list-unit-files --type service
Lists all services and checks if they are enabled.
systemctl list-dependencies --after
Lists services that are ordered to start before the specified unit.
systemctl list-dependencies --before
Lists services that are ordered to start after the specified unit.