1833568 Members
4349 Online
110061 Solutions
New Discussion

Re: shut down a server

 
SOLVED
Go to solution
Manuales
Super Advisor

shut down a server

hi ..
what is the command with parameters to shut down the server without plugging off the server?

i mean, shutdown and in automatical way it be started up ....

please let me know.
Thanks.
6 REPLIES 6
TTr
Honored Contributor
Solution

Re: shut down a server

> the command with parameters to shut down

shutdown -ry 0

Must be run from the root directory ("cd /")

"reboot" will also work but it does not go through the rc3/rc2/rc1 sequence of stopping all software gracefully.
Patrick Wallek
Honored Contributor

Re: shut down a server

Have you tried looking at the man page for the shutdown command?

# man shutdown

Specifically look at '-r'.

What I use is:

# shutdown -ry 0

Read the man page for the meaning of all of the options.
Dennis Handly
Acclaimed Contributor

Re: shut down a server

And of course there is "shutdown -hy 0" to halt it. You would still have to turn off the power on some systems.
Ganesan R
Honored Contributor

Re: shut down a server

Hi,

Options are below for little more elabrate.

# shutdown [-h|-r] [-y] [grace period]

-h => To halt the system
-r => To reboot the system
-y => Do not require any user interactions

grace period -> the time in seconds to the users to logoff. If it is "0" or "now'system will shutdown immediately.

Ex:

#shutdown -ry 60
#shutdown -ry now
#shutdown -hy 0

shutdown command without any option will take system into single user mode.

Hope this helps.
Best wishes,

Ganesh.
SKR_1
Trusted Contributor

Re: shut down a server

Hi

cd /
shutdown -ry 0 For reboot
shutdown -hy 0 For halt the server

Thanks

SKR
James R. Ferguson
Acclaimed Contributor

Re: shut down a server

Hi Manuales:

An important side-effect of using 'shutdown' is that the shutdown (stop) scripts in the '/sbin/rc?.d' directories are executed to gracefully stop the services launched during startup ('man rc' for more details).

You can also shutdown a system with 'reboot' (see 'man 1 reboot' for details), *but* in this case the normal shutdown scripts are *not* executed.

In reality, the 'shutdown' command executes 'reboot' as its *last* step.

You will find the following useful reading:

# man 1M rc
# man 1M shutdown
# man 1M reboot

Regards!

...JRF...