Script to Start services based on dependent services on other AIX machine
Hi,
I just started working on a script. After my research, i found a command which can help me:
AIM: To build a script which starts the services (Services 1) on server 1 automatically whenever its down. And it has a dependency on other service (Service 2) on Server 2.
So my script has to check if service 2 is up and running on other machine and only then has to start Service 1. I cannot use any passwords in the script or do not any a ID with no password required ability to login to other machine using ssh and check the status of the service 2.
So my IDEA is, Service 2 always uses particular port X...so my script which stays on server 1 has to just check if port X is in use, if so just go ahead and start service 1. If not wait for sometime till service 2 is up and then start service 1.
Please help...
I think i can use IF statement and then put nc command and based on its put start service 1. Any thought/help will be really appreciated.
Thank you!! That helps... i am working on building the script accordin to my environment.
I have another question about this.....can i use any command or another script which can wait and check for port 9999 on server 2 and whenever it founds that a service is started on this port...it can kick off my script on server 1....
Really appreciate your help!! i am making progress...
Assumption here is that whenever port goes from unserviced to serviced that your script should be run. This script should be started in the background with nohup (perhaps from /etc/init.d):
This User Gave Thanks to Chubler_XL For This Post:
@Chubler....
I got the script working but i have one last thing...
i am trying to look for a particular word in a logfile while its getting update and when it finds it i want it to run second script...can you help?
Above command is not working for some reason...any thoughts??
also to run the script in background...but when i use nohup myscript.sh .... i doesnt run in background but stays there untill i hit control c.... am i missing something here?
I will post the script i have soon so it helps other....Thanks again for your help!!
Last edited by Franklin52; 11-23-2013 at 08:40 AM..
Reason: Please use code tags
Hello Experts,
I have a requirement to start and stop weblogic services in a clustered environment.
First i need to start weblogic server and once the server is in Running mode i need to do SSH to other server and there i need to start Node Manager and Managed server, After these two are in... (1 Reply)
Hi all,
I remember way back in some old environment, having the HA cluster services not being started automatically at startup, ie. no entry in /etc/inittab.
I remember reason was (taken a 2 node active/passive cluster), to avoid having a backup node being booted, so that it will not... (4 Replies)
I normally use "chkconfig" to configure start up services in a particular run level.....
But i don't know how to do it in solaris 10.... please help me !!! (2 Replies)
I had a doubt if any services need to be restarted if port no in /etc/services in an RHEL setup is changed. For eg, the port no of 443 for SSL may need to be changed.
I hope my query is clear whether any services need to be restarted if port no in /etc/services is changed.
Please revert with... (10 Replies)
Hello All
i have a question related to some services,i want to start some services with server linux centos.
i make "chkconfig httpd on" and "chkconfig asterisk on",but when i verify with chkconfig --list i found
httpd 0: off 1: off 2: on 3: on 4: on 5: on 6:... (6 Replies)
Hi all,
can any one guide me to configure samba services on solaries8 machine and how to use at the client side (i,e) how the client can retrive the data using samba services.
Thanks
venky (2 Replies)
I'm trying to add services to start services automatically during the system start up in suse linux.
I followed these steps..
chkconfig servicename on
and created symbolic link at /etc/rc.d/rc3.d/ folder with name S80servicename. here is the command I used
ln -s /etc/init.d/servicename... (8 Replies)
Solaris uses a few different mechanisms to start up services and processes at boot time. Where do all the running processes come from? Can you find from where they were started? (8 Replies)