In RHEL, you can manage system services daemons using the systemctl
command. This command allows you to start, stop, restart, enable, or disable system service daemons as needed.
To start a system service daemon, use the systemctl start
command followed by the name of the service. For example:
$ systemctl start ssh
To stop a system service daemon, use the systemctl stop
command followed by the name of the service. For example:
$ systemctl stop ssh
To restart a system service daemon, use the systemctl restart
command followed by the name of the service. For example:
$ systemctl restart ssh
To enable a system service daemon to start at boot time, use the systemctl enable
command followed by the name of the service. For example:
$ systemctl enable ssh
To disable a system service daemon from starting at boot time, use the systemctl disable
command followed by the name of the service. For example:
$ systemctl disable ssh
You can also use the systemctl status
command to view the current status of a system service daemon, including whether it is running, stopped, or enabled. For example:
$ systemctl status ssh
● ssh.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-06-01 09:08:15 EDT; 1h 20min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 358 (sshd)
Tasks: 1 (limit: 507)
Memory: 2.4M
CGroup: /system.slice/ssh.service
└─358 /usr/sbin/sshd -D
Jun 01 09:08:15 localhost.localdomain systemd[1]: Started OpenSSH server daemon.