Linux Tips

HOW TO PROPERLY SHUTDOWN AND REBOOT LINUX CENTOS 5/CENTOS 6/RHEL 5/RHEL 6

 

This post will show you the proper command to shutdown and reboot the linux server. To shut down Red Hat Enterprise Linux(RHEL) and CentOS, the root user may issue the /sbin/shutdown command. All the command has been tested on CentOS 6.2 but may workings on other CentOS and RHEL version. The shutdown man page has a complete list of options, but the two most common uses are:

EXAMPLE 1. HOW TO PROPERLY SHUTDOWN CENTOS 5/CENTOS 6/RHEL 5/RHEL 6 :

[root@centos62 ~]# /sbin/shutdown -h now

EXAMPLE 2. HOW TO PROPERLY REBOOT CENTOS 5/CENTOS 6/RHEL 5/RHEL 6 :

[root@centos62 ~]# /sbin/shutdown -r now

After shutting everything down, the -h option halts the machine, and the -r option reboots.

These are another useful shutdown command :

EXAMPLE 3. TO SHUTDOWN IN NEXT 10 MINUTES:

[root@centos62 ~]# /sbin/shutdown -h +10

EXAMPLE 4. TO REBOOT IN NEXT 10 MINUTES:

[root@centos62 ~]# /sbin/shutdown -r +10

EXAMPLE 5. TO SHUTDOWN THE SERVER IN NEXT 3 SECONDS :

[root@centos62 ~]# /sbin/shutdown -t3 -r now

The option “-t3” tells the shutdown command to wait 3 seconds before it starts killing processes.

EXAMPLE 6. RESHEDULED TO SHUTDOWN THE SERVER AT 12:15 :

login as: root
root@192.168.1.44's password:
Last login: Fri Jun  1 12:05:27 2012 from 192.168.1.52
[root@centos62 ~]# date
Fri Jun  1 12:12:00 MYT 2012
[root@centos62 ~]# /sbin/shutdown -r 12:15

Broadcast message from root@centos62.ehowstuff.local
        (/dev/pts/0) at 12:12 ...

The system is going down for reboot in 3 minutes!

Broadcast message from root@centos62.ehowstuff.local
        (/dev/pts/0) at 12:13 ...

The system is going down for reboot in 2 minutes!

Broadcast message from root@centos62.ehowstuff.local
        (/dev/pts/0) at 12:14 ...

The system is going down for reboot in 1 minute!
Advertisements