Operating System - HP-UX
1826388 Members
4314 Online
109692 Solutions
New Discussion

Re: How to submit a remote script from UNIX to RedHat Linux

 
Johnny Kwok
Occasional Advisor

How to submit a remote script from UNIX to RedHat Linux

Hello All,

We have an application running on a RedHat Linux Server communicating between our HP and DB Server.

Our HP Servers have a weekly rebooting schedule and after that, Sys Admin has to login the RedHat Linux Server to restart a script to re-establish the connection between HP and the DB Server.

Can this process be automated ?

Thanks.
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: How to submit a remote script from UNIX to RedHat Linux

Hi,

Why not use cron on your RedHat apps server just after the rebooting schedule on HPUX servers.

Regards,
Robert-Jan
Steven E. Protter
Exalted Contributor

Re: How to submit a remote script from UNIX to RedHat Linux

Yes,

cron can be used to restart the services that were connecting to the HP servers, or simply reboot an short time after the HP servers scheduled reboot.

Many ways to solve the issue depending on what services are involved.

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
Johnny Kwok
Occasional Advisor

Re: How to submit a remote script from UNIX to RedHat Linux

I tried but the rebooting schedule was so hectic, they never finished exactly ontime.

My CRON script started but either the DB or HP Server was not completely up.

We ended up had to do it manually anyway.

The other option I was thinking of is to use openSSH.

However, I don't know how to setup openSSH between a UNIX and a RedHat LINUX Server.

Has anyone done something like this ?
A. Clay Stephenson
Acclaimed Contributor

Re: How to submit a remote script from UNIX to RedHat Linux

A far, far better answer is to abandon your weekly rebootings. That is a state-of-the-art stupid approach to UNIX administration.
If it ain't broke, I can fix that.
Johnny Kwok
Occasional Advisor

Re: How to submit a remote script from UNIX to RedHat Linux

Unfortunately, we have no saying on the weekly rebooting schedule.

Management long ago decided:

1. Some bad apps running on this server will be "fixed" after the reboot,

2. We need to block off this time slot for any hardware/software maintenance that we may need to do,

3. The reboot should clear any memory leaks issue.
A. Clay Stephenson
Acclaimed Contributor

Re: How to submit a remote script from UNIX to RedHat Linux

Well, it's rather simple to execute a remote command from HP-UX to Linux. While ssh is the more secure way, remsh will work just fine.

Set up .rhosts in the user's (root?) home directory so that it looks something like this:
hpuxboxhostname root

The .rhosts file should be owned by the user (root?) and have mode set to 400.

Then on your HP-UX box as that user (root?):
remsh linuxboxhostname command

You can verify that you have everything working by issueing something like:

remsh dilbert ls -l /etc


If it ain't broke, I can fix that.
Dino_4
Frequent Advisor

Re: How to submit a remote script from UNIX to RedHat Linux


Hi,

first of all, Clays 1st answer so far sounds as the best to me. Don't reboot, fix the application.

However, the problem, as I understand it, is to have the timing right for starting the scripts.

You might want to create some start script on the HP-Box that creates a file on the Linux-Box in some dir.
Let it start somewhere at the end of the boot process late in runlevel 2 or even 3.

The Linux box controled by cron checks every minute if this file exists in a timeframe (maybe 1 hour) when the HP-Box is supposed to come up again.
The Linux-Box then calls a script (remsh to HP and start processes) and erases the file that was created by the HP-Box.

Regards
Dino_4
Frequent Advisor

Re: How to submit a remote script from UNIX to RedHat Linux


Hi,

first of all, Clays 1st answer so far sounds as the best to me. Don't reboot, fix the application.

However, the problem, as I understand it, is to have the timing right for starting the scripts.

You might want to create some start script on the HP-Box that creates a file on the Linux-Box in some dir.
Let it start somewhere at the end of the boot process late in runlevel 2 or even 3.

The Linux box controled by cron checks every minute if this file exists in a timeframe (maybe 1 hour) when the HP-Box is supposed to come up again.
The Linux-Box then starts the script to establish connection and erases the created file.

Regards
Yogeeraj_1
Honored Contributor

Re: How to submit a remote script from UNIX to RedHat Linux

hi,

Unattended restarts are very dangerous! It would be preferable that you just restart the process that you fear is causing a problem.

good luck!

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