Operating System - HP-UX
1825693 Members
3333 Online
109686 Solutions
New Discussion

Reboot from crontab will not complete

 
SOLVED
Go to solution
Gregory Ardoin
Occasional Advisor

Reboot from crontab will not complete

I recently migrated my 700 series (10.20) box to a B2600. It is setup for nightly reboots @ 12:01. Since the migrations, it will not reboot completely. The next morning it will be at the system menu prompt waiting for which device to boot from. Also, if I reboot from the command prompt it will reboot with no problem.
9 REPLIES 9
John Dvorchak
Honored Contributor
Solution

Re: Reboot from crontab will not complete

Can you cut and paste the exact line in crontab?

This has always worked for me:

01 12 * * * /usr/sbin/shutdown -ry 0

Also what does setboot look like:

root> setboot
Primary bootpath : 2/0/1.6.0
Alternate bootpath : 2/0/1.0.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)
If it has wheels or a skirt, you can't afford it.
A. Clay Stephenson
Acclaimed Contributor

Re: Reboot from crontab will not complete

Why reboot at all? If you need to reboot nitely then you are fixing the symptoms rather than addressing the problem itself.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Reboot from crontab will not complete

I agree with A. Clay.

I sometimes run my production systems for MONTHS between reboots. That's because I have the applications properly configured along with the OS. The most frequent cause of reboots are security patches.

If you have to boot once a day, something is wrong. Even weekly is too much.

I'm somewhat happy its hard reboot from crontab. Thats a process that really requires a human to be involved and thinking about it.

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
Gregory Ardoin
Occasional Advisor

Re: Reboot from crontab will not complete

I'm not positive why it is being rebooted nightly and I a far from a unix guru. There is a subsystem on this platform by Avaya and they stipulate a nightly reboot. I have pounded out the line in the crontab for the last two weeks and it has run fine without rebooting. Even if I reboot once a month it will still stall.

Crontab line:
01 00 * * 0-6 /etc/shutdown -r -y 0



Primary bootpath : 10/0/15/0.6.0
Alternate bootpath :10/0/15/0.5.0

Autoboot is ON (enabled)
Autosearch is ON (enabled)
Patrick Wallek
Honored Contributor

Re: Reboot from crontab will not complete

If root's home directory has been changed from / to /home/root it could pose a problem. You could try something like:

cd / ; /etc/shutdown -ry 0

and see if that helps.
Steven E. Protter
Exalted Contributor

Re: Reboot from crontab will not complete

Patrick's command cd /

Is because shutdown will fail if its run from a mounted directory.

cd /stand


shutdown -ry now

It won't shutdown and will advise you to cd / prior to running the command.

If we've helpled, please point us. :-)

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
Gregory Ardoin
Occasional Advisor

Re: Reboot from crontab will not complete

Thanks Patrick/Steven but that did not work. The problem still happens. It will start the reboot from the crontab but it is like someone is hitting the escape key to stop the process. Then once I get in it is at the boot menu.

ex. menu:



b) Boot from specified device
s) Search for bootable devices
a) Enter Boot Administration mode
x) Exit and continue boot sequence
?) Help

Select from menu:

Then once I select the device. (i.e. b p0) the system will boot.
John Dvorchak
Honored Contributor

Re: Reboot from crontab will not complete

I don't have a lot of experience with the B2600, but the only thing I can think of is maybe the autosearch feature is the problem. Try disabling it and see what happens:

setboot -s off

Then run setboot again to make sure it took:

#setboot
Primary bootpath : 52.6.0
Alternate bootpath : 52.3.0

Autoboot is ON (enabled)
Autosearch is OFF (disabled)

Let us know what happens. And sorry about my typo in the first response I should have had the crontab entry like yours for a midnight reboot not mine which was a noon reboot.

01 00 * * 1-6 .......
If it has wheels or a skirt, you can't afford it.
Jeff Schussele
Honored Contributor

Re: Reboot from crontab will not complete

Hi,

Sounds like you don't have the system set to autoboot - run
setboot
and note the value for AutoBoot. If it's OFF then run
setboot -b on
and check it again.
You should also check the value for Primary bootpath & verify that it is indeed the HW path for the boot disk.

HTH,
Jeff

P.S. I agree with the others - this ain't no MicroBlows box. I'd question the vendor as to *exactly* why they feel it has to be rebooted nightly.
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!