System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

reboot and shutdown the servers

 
SOLVED
Go to solution
Shivkumar
Super Advisor

reboot and shutdown the servers

Dear Sirs,

Which are tghe best commands to "reboot" and "shutdown" the hpux servers ? Can we do it as a powerbroker user or will need to login as a root on the console ?

Do we need to take backup of any config files in case servers fails to come up successfully ?

Thanks,
Shiv
15 REPLIES 15
Jeff_Traigle
Honored Contributor
Solution

Re: reboot and shutdown the servers

shutdown is the preferred command to use since it runs through the init.d scripts to bring things down gracefully.

Any user defined in /etc/shutdown.allow can use the shutdown command. No need to be logged on the console either, though that is typically preferred so you can watch the enter boot process for problems.
--
Jeff Traigle
Steven E. Protter
Exalted Contributor

Re: reboot and shutdown the servers

Shalom Shiv,

reboot is quick and does not run the shutdown scripts. It can and has corrupted data and databases in the past.

it is much faster.

shutdown is the right way to go especially for critical systems with critical data on them.

shutdown runs the shutdown scripts as planned in the init/shutdown setup.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: reboot and shutdown the servers

Hi Shiv:

'reboot' is really the last step of 'shutdown'. 'shutdown' causes your '/sbin/init.d/*' "stop" sequences to run while 'reboot' does not. Therefore, it is appropriate and wise to do 'shutdown' whenever possible.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: reboot and shutdown the servers

Hi SHiv:

I should add that you can enable a non-root user to run the 'shutdown' command by adding the user to the '/etc/shutdown.allow' file.

See the manpages for 'shutdown(1M)' for more information.

Regards!

...JRF...
Deoncia Grayson_1
Honored Contributor

Re: reboot and shutdown the servers

the reboot command kills all processes instead of gracefully terminating them, it speeds the boot process up but it may cause data lost/corruption

you should use the shutdown -r to reboot your server gracefully...

you can add users to the shutdown.allow file which is located in /etc which give user rights to run the shutdown command.
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Raj D.
Honored Contributor

Re: reboot and shutdown the servers

Hi Shiv,

Here is something:

1. If you have not rebooted/shutdowned the server long time, it is a good practice to keep all the configuration data backed up, incase of any problem. [ Nickel and cfg2html is good. ]

2. You can issue # shutdown -r -y 0
To reboot the server.

And # shutdown -h -y 0
To Halt.

3. You can login to console , to use the reboot to check for any error messages in console . You can use sudo or powerbroker , but rebooting/shutdown from console gives you much flexibility.


Enjoy,
Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Hoang Chi Cong_1
Honored Contributor

Re: reboot and shutdown the servers

Hi Shivkumar
As I think there isn't "best command to reboot and shutdown" a HP-UX server :)
As HP engineer recommendation: should'n give "root" permission to any other user for security reason!

The most importance things in your question is: Was reboot or shutdown process effected to your applications?
The answer is: It depend on your applications!
In my system, before reboot or shutdown the server, I always shutdown all my application for example: Oracle, DB2, etc...

Of course, you need to backup all your application for saving data and application configuration including backup importance volume group (vg00 like an example).

Hope this helps
Hoang Chi Cong
Looking for a special chance.......
Indrajit_1
Valued Contributor

Re: reboot and shutdown the servers

Hi;

The Best command to Shutdown and Reboot a hp unix Server is ..

To shutdown..
#shutdown -yh 0

To Reboot..

#shutdown -yr 0

To execute this command either u should have root access or u should have sudo permission.

cheers
indrajit
Never Ever Give Up
Highlighted
Joseph Loo
Honored Contributor

Re: reboot and shutdown the servers

hi,

it depends on needs, a good doc on whether u like to reboot or shutdown:

http://docs.hp.com/en/B2355-90672/ch02s06.html

as to whether backup is essential, it depends as well. if u have not shutdown for a very, very long time, and intent to leave the system down for a day or 2, it will be good to backup and also make_tape_recovery, cause u never know if the disks will fail.

regards.
what you do not see does not mean you should not believe
Shameer.V.A
Respected Contributor

Re: reboot and shutdown the servers

Hi Shiv,

You can issue
#shutdown -r -y 0 to reboot the server.

And
#shutdown -h -y 0 to shutdown & halt, so that you can power off.

It is good practice to take configuration file backups in regular interval, so that in case of any problem, you can recover. Also take ignite image in regular interval for critical servers, so that you will have a working known setup always.

You can give shutdown permission for any user by adding the user to /etc/shutdown.allow file.

Always shutdown all the applications like Oracle, SAP etc... before issuing shutdown command.

Regards,

Shameer
.... See invisible, feel intangible and achieve impossible as everything is possible ....
Arunvijai_4
Honored Contributor

Re: reboot and shutdown the servers

Hi Shiv,

A graceful shutdown is the best way of shutting down any servers including HP-UX. It will allow all processes to clean their junks up. Also, it is good to broadcast message to users logged into the system with "wall"

# shutdown
# reboot -h [Shut down the system and halt]
# reboot -r [Shut down the system and reboot automatically (default)]
# reboot -t time [Specify what time reboot will bring the system down]

# man 1M reboot
# man shutdown

will always help you.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Yogeeraj_1
Honored Contributor

Re: reboot and shutdown the servers

hi,

it is preferrable in most cases to use "shutdown" command to reboot the server!

This way you sure all your scripts runs gracefully in shutting down the different processes..

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Cem Tugrul
Esteemed Contributor

Re: reboot and shutdown the servers

Hi Shiv,
As an additon to other replies please
take a look;

http://docs.hp.com/en/A5201-96043-en/apcs06.html

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Devender Khatana
Honored Contributor

Re: reboot and shutdown the servers

Hi,

shutdown is the only command used for proper shutdown. The options defined will be based on your requirements like if you wish to reboot, halt or boot to single user mode.

reboot should never be used unless you have changed the kernel and is rebooting to boot of the new kernel. When doing kernel changes through SAM as well reboot is used which inturn does a reboot as the kernel itself has changed.

My favourite to shutdown and halt an HPUx system

#shutdown -hy 0

Apart from root the shutdown authorization can be given to any common user by putting a entry of that user name in file /etc/shutdown.allow

I also used to prefer a special user for shutdown purposes if your shutdown is executed allmost everyday and users are not much capable. In that case I used to put the shutdown command in the .profile with proper options.

HTH,
Devender
Impossible itself mentions "I m possible"
Raj D.
Honored Contributor

Re: reboot and shutdown the servers

Shiv ,

In short we use :
# shutdown -r -y 0
(for reboot).

# shutdown -h -y 0
(for shutdown)

And it works perfect without any problem.

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "