1753448 Members
5050 Online
108794 Solutions
New Discussion юеВ

script

 
ssjd
Occasional Contributor

script

guys I want a script that reboots the system and ensures or notifies if reboot was successful and reboot returns a successful return code after a perticular amount time.
6 REPLIES 6
Sanjay_6
Honored Contributor

Re: script

Hi,

A script to reboot the server is not a good idea. A system reboot should be an interactive process which happens once in a while. It is not a daily operation for which you should need a script. However i'm sure someone would probably have one such script handy.

Hope this helps.

regds
Kent Ostby
Honored Contributor

Re: script

ssjd --

The simpliest way to do something like this would be to just shutdown or reboot from cron with two small scripts added.

One would be a script that would send mail just as the shutdown begins.

The second would be a script that sends mail when reboot finishes (i.e. called from an Sxxx script).

This would give you a feel for both the going down and coming up times.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Patrick Wallek
Honored Contributor

Re: script

There is no return code for a system reboot.

You can't do something like an "echo $?" for a reboot.

You would have to look through the /etc/rc.log and look for the status of all of the startup scripts.
A. Clay Stephenson
Acclaimed Contributor

Re: script

In every case I have seen a perceived need for something like this, it was to fix the symptoms of a problem rather than addressing the problem itself. There is absolutely no need for such a process. Why don't you instead explain your problem rather than coming up with a dubious solution?
If it ain't broke, I can fix that.
renarios
Trusted Contributor

Re: script

Hi,

Why the need to reboot your HP-UX systems on a regural base? The only reason for a reboot (I can think of) is changing kernel parameters (needing a reboot).
Personally, I definitely want to be around rebooting a server. If needed, you can interact.

Cheerio,

Renarios
Nothing is more successfull as failure
Rick Garland
Honored Contributor

Re: script

You want to be present for a reboot. Unless you have a perfect system with perfect applications that all behave perfectly, you will encounter problems.

Since everything I mentioned is man-made, nothing is perfect.