On Centos Linux (in this case version 8), the command systemctl allows administration of services on Linux. The version of systemctl in use is displayed with command
systemctl --version
systemd 239 (239-58.el8)
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=legacy
Check status of services
systemctl status httpd
systemctl status containerd
systemctl status kubelet
systemctl list-unit-files
Background services is list with
systemctl list-jobs
View service information
systemctl show httpd
systemctl show containerd
Start and stop a service
systemctl start httpd
systemctl stop httpd
On some services, there is the command to restart or reload. Reload, reads the updated configuration for a service without stopping the service.
systemctl start httpd
systemctl reload httpd
Boot target
Troubleshooting
List dependencies of the service
systemctl list-dependencies httpd
Unit files are list as
systemctl list-unit files
When a service is mask, it cannot be started until it is unmask. This can be done with
systemctl unmask httpd
No comments:
Post a Comment