11-11-2013
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.
10 More Discussions You Might Find Interesting
1. Solaris
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)
Discussion started by: gc40
8 Replies
2. SuSE
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)
Discussion started by: s_linux
8 Replies
3. Solaris
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)
Discussion started by: venky_vemuri
2 Replies
4. HP-UX
Good morning,
I've installed nrpe 2.12 (from nagios) on a HP-UX B.11.11 U server!
Then I've configured the following files :
$ tail /etc/services
nrpe 5666/tcp # NRPE
$ tail /etc/inetd.conf
nrpe stream tcp nowait nagios /software/nagios/nrpe/bin/nrpe -c... (0 Replies)
Discussion started by: hiddenshadow
0 Replies
5. Shell Programming and Scripting
Dear All,
Pls find my scripts for Agent services strat & stop.
EAMSROOT=/opt/panaces
export EAMSROOT
cd $EAMSROOT
nohup ./OracleAgent.sh start &
nohup ./PFRAgent.sh start &
nohup ./PFR.sh start &
nohup ./SolarisOSAgent.sh start &
exit 0
EAMSROOT=/opt/panaces
export EAMSROOT
cd... (0 Replies)
Discussion started by: starnaresh
0 Replies
6. UNIX for Advanced & Expert Users
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)
Discussion started by: bernard12
6 Replies
7. Red Hat
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)
Discussion started by: RHCE
10 Replies
8. Solaris
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)
Discussion started by: vamshigvk475
2 Replies
9. AIX
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)
Discussion started by: zaxxon
4 Replies
10. UNIX for Beginners Questions & Answers
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)
Discussion started by: beginner786
1 Replies
LEARN ABOUT PHP
win32_query_service_status
WIN32_QUERY_SERVICE_STATUS(3) 1 WIN32_QUERY_SERVICE_STATUS(3)
win32_query_service_status - Queries the status of a service
SYNOPSIS
mixed win32_query_service_status (string $servicename, [string $machine])
DESCRIPTION
Queries the current status for a service, returning an array of information.
PARAMETERS
o $servicename
- The short name of the service.
o $machine
- The optional machine name. If omitted, the local machine will be used.
RETURN VALUES
Returns an array consisting of the following information on success, FALSE if there is a problem with the parameters or a Win32 Error Code
on failure.
o $ServiceType
- The dwServiceType. See Win32Service Service Type Bitmasks.
o $CurrentState
- The dwCurrentState. See Win32Service Service Status Constants.
o $ControlsAccepted
- Which service controls are accepted by the service. See Win32Service Service Control Message Accepted Bitmasks.
o $Win32ExitCode
- If the service exited, the return code from the process.
o $ServiceSpecificExitCode
- If the service exited with an error condition, the service specific code that is logged in the event log is visible here.
o $CheckPoint
- If the service is shutting down, holds the current check point number. This is used by the SCM as a kind of heart-beat to detect
a wedged service process. The value of the check point is best interpreted in conjunction with the WaitHint value.
o $WaitHint
- If the service is shutting down it will set WaitHint to a checkpoint value that will indicate 100% completion. This can be used
to implement a progress indicator.
o $ProcessId
- The Windows process identifier. If 0, the process is not running.
o $ServiceFlags
- The dwServiceFlags. See Win32Service Service Service Flag Constants.
SEE ALSO
Win32Service Predefined Constants.
PHP Documentation Group WIN32_QUERY_SERVICE_STATUS(3)