PasteFS logoPasteFS
Blue Light on 14 Aug, 2015
Raw Data
  1. CentOS 7 /RHEL7 Shut down/Restart/Suspend/Hibernate/Sleep The System
  2. I would like to shut down or restart the system in the centos 7 or rhel 7, How to shutdown system? which commands I can use to shutdown the system? of course, you still can use the “poweroff” command to shutdown the system, this is an old command in the centos 6.x or previous version. In this post you will see that how to CentOS 7 /RHEL7 shut down/restart/suspend/hibernate the system using systemctl command.
  3. In centos 7 or Rhel 7, A number of power management commands used in old centos version or rhel are replaced by systemctl utility.
  4. you are able to use systemctl command with “poweroff” option to shutdown the system or with “reboot” option to restart the system. those old commands are still available to use for compatibility only in centos 7 or rhel 7.
  5. CentOS 7 /RHEL7 Shut down/Restart/Suspend/Hibernate The System
  6. CentOS 7 shut down the system
  7. To shutdown and power-off the centos 7 or rhel 7 system, issue the following command, type:
  9. systemctl poweroff
  10. this command not only shutdown the system, but also prints a wall message to all users that are currently logged into the system. If passing with “–force” option, shutdown of all running services is skipped, however all processes are killed and all file systems are unmounted or mounted read-only. type:
  12. systemctl poweroff --force
  13. CentOS 7 restart the system
  14. To shutdown and reboot the system, using the following systemctl command with reboot option, type:
  16. systemctl reboot
  17. this command also will send a wall message to all logged user in the current system. if passing “–force” option to this command, the operation action is similar with “poweroff”. enter:
  19. systemctl reboot --force
  20. Note: if “–force” option is specified twice, the operation is immediately executed without terminating any processes or unmounting any file systems, this my result in data loss.
  22. systemctl reboot --force --force
  23. CentOS 7 suspend the system
  24. To suspend the system (make it sleep), issue the following systemctl command with “suspend” option, type:
  26. systemctl suspend
  27. this command will save the system state in RAM and put the machine in a sleep state, and the system still requires power in this state.As the system state is saved in RAM, so its restoring speed of the system is fast.
  28. CentOS 7 hibernate the system
  29. To hibernate the system, issue the following command as root user:
  31. systemctl hibernate
  32. this command will fully powered off the system and the system state is saved to disk. the system does not require power, and can stay in hibernate mode indefinitely. because the system state is not saved in RAM, so its restoring speed of the system is slower than suspend mode.
  33. done…..
  34. source: