To safely restart a CentOS or Red Hat Enterprise Linux (RHEL) server, you can use the systemctl
command.
First, make sure that you have saved all of your work and that any important processes are running.
Open a terminal window and log in as the root user or use sudo
to execute the following command:
systemctl reboot
This command will initiate a reboot of the server. The system will shut down all processes, unmount all file systems, and then restart the system.
Note: If you need to halt the system instead of rebooting it, you can use the
systemctl halt
command. This will shut down the system and power it off, if supported by the hardware.