1820137 Members
3424 Online
109619 Solutions
New Discussion юеВ

System shutdown commands

 
SOLVED
Go to solution
Diadina Cotte
Advisor

System shutdown commands

I have little knowledge on HP-UX.

To shutdown the system I have to type #shutdown -r ?????????
or this is the command for reboot?

If I reboot what are the commands to restart as multi-user???

thanks
Coffee please ;-)
9 REPLIES 9
Justo Exposito
Esteemed Contributor
Solution

Re: System shutdown commands

Hi Diadina,

To shutdown the system you can do:

# shutdown -h now

as root user and in the / directory.

Regards,

Justo.
Help is a Beatiful word
Rodney Hills
Honored Contributor

Re: System shutdown commands

Enter "shutdown -h -y 0"

The -h option is for halt, -y is to answer yes to questions and 0 is how long to wait to start shutdown process.

Their is a "man" page on the syntax
man 1m shutdown

-- Rod Hills
There be dragons...
Pete Randall
Outstanding Contributor

Re: System shutdown commands

The shutdown command initiates an orderly shutdown, going through all the shutdown scripts to terminate process normally. The reboot command causes an immediate shutdown.
Shutdown is the preferred method.

Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: System shutdown commands

To shutdown the system:
shutdown -h -y 0

To shutdown and reboot in the normal run state befined in /etc/inittab:
shutdown -r -y 0

Man 1m shutdown for details.
If it ain't broke, I can fix that.
Klaus Crusius
Trusted Contributor

Re: System shutdown commands

Hi,

"shutdown -h 60" will shut down and halt after a grace period of 60 seconds.

"shutdown -r 0" will shutdown and reboot immediately.

The initial state (S for single user, 3 for multi user) is in /etc/inittab.


Regards, Klaus
There is a live before death!
Helen French
Honored Contributor

Re: System shutdown commands

Some points:

1) Normal and safe shutdown command:

# shutdown -h -y 0 (h-halt, y-answer yes, 0-in 0 seconds)

2) Normal and safe reboot:

# shutdown -y -r 0 (r-reboot)

3) Immediate and unsafe reboot:

# reboot -r (r-reboot, use -h for halt)

4) Just start your system and do not interrupt, the system will start in multi user mode unless there is some starup/configuration issue.
Life is a promise, fulfill it!
Nick Wickens
Respected Contributor

Re: System shutdown commands

Just to add to Justos reply - "shutdown -r 0" will bring the system down and backup to multiple user mode.

shutdown on its own takes you down to single user mode from which the command "init 3" takes you back to run level 3 (you can check your current run level with the command "who -r").

If your machine (assuming its a D or K class or similar) is not set to autoboot it may halt on the way up and ask you to select a boot path. If this happens just enter "bo pri" and it will boot from the primary boot disk.
Hats ? We don't need no stinkin' hats !!
Pete Randall
Outstanding Contributor

Re: System shutdown commands

Sorry, Diadina, I mis-read your question. As the others have said, shutdown -h will halt the system while shutdown -r will reboot. Depending on your default init level in /etc/initab (i.e. 3), the system should come back up in multi-user mode.

Pete

Pete
Darrell Allen
Honored Contributor

Re: System shutdown commands

Hi,

The first thing to do is "man 1m shutdown". Yes, "shutdown -r" reboots the system. There is a reboot command but it does not perform a graceful shutdown and reboot. That is, reboot does not run the rc (run control) scripts that will properly shutdown your applications. shutdown does run them.

Rebooting (or cold booting) will bring up the system to the run level specified in /etc/inittab on the initdefault line which typically looks like:
init:3:initdefault:

Also "man init" and "man rc" for more info.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)