Configure Services

[1] It's possible to display services' status like follows.

[[email protected] ~]# systemctl -t service
UNIT                           LOAD   ACTIVE SUB     DESCRIPTION
auditd.service                 loaded active running Security Auditing Service
crond.service                  loaded active running Command Scheduler
dbus-daemon.service            loaded active running D-Bus System Message Bus
dovecot.service                loaded active running Dovecot IMAP/POP3 email server
dracut-shutdown.service        loaded active exited  Restore /run/initramfs on shutdown
firewalld.service              loaded active running firewalld - dynamic firewall daemon
[email protected]             loaded active running Getty on tty1           
httpd.service                  loaded active running The Apache HTTP Server
import-state.service           loaded active exited  Import network configuration from initramfs

[2] List of all services.

[[email protected] ~]# systemctl list-unit-files -t service
UNIT FILE                                  STATE
arp-ethers.service                         disabled
auditd.service                             enabled
[email protected]                            enabled
blk-availability.service                   disabled
bluetooth.service                          enabled
brltty.service                             disabled
[email protected]                      static
canberra-system-bootup.service             disabled
canberra-system-shutdown-reboot.service    disabled
canberra-system-shutdown.service           disabled
[email protected]                 static
console-getty.service                      disabled
[email protected]                   static
cpupower.service                           disabled
crond.service                              enabled

[3] Stop and turn OFF auto-start setting for a service if you don'd need it. (it's bluetooth as an example below)

[[email protected] ~]# systemctl stop bluetooth
[[email protected] ~]# systemctl disable bluetooth

[4] View the status of a service.

[[email protected] ~]# systemctl status crond
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-09-24 03:30:06 +03; 18h ago
 Main PID: 1755 (crond)
    Tasks: 1 (limit: 4915)
   Memory: 2.1M
   CGroup: /system.slice/crond.service
           └─1755 /usr/sbin/crond -n

Sep 24 13:01:01 localhost.localdomain CROND[30121]: (root) CMD (run-parts /etc/cron.hourly)
Sep 24 14:01:01 localhost.localdomain CROND[22819]: (root) CMD (run-parts /etc/cron.hourly)

[5] Start a service and add it to startup services.

[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/httpd.service.

[6] Restart a service.

[[email protected] ~]# systemctl restart crond

[7] Check that a service has been added to the startup services.

[[email protected] ~]# systemctl is-enabled postfix

[8] Check the running status of a service.

[[email protected] ~]# systemctl is-active bluetooth