Sponsored Content
Top Forums Shell Programming and Scripting Linux startup and stop scripts using SSH Post 303006004 by siddharthjain on Wednesday 25th of October 2017 10:07:09 PM
Old 10-25-2017
Linux startup and stop scripts using SSH

I have a question. Actually I want to make two scripts, one is startup.sh and other is stopscript.sh
so for example, I have 5 servers.

Each server has two instances :-
abc111 - Masters
-cra4
abc222 -middle tear
-cra
abc333 -middle tear
-cra1
abc444 -middle tear
-cra2
abc555 -middle tear
-cra3

So when starting up a server, first I need to start my masters server first followed by cra4.
And then the next server, it should be middle tier followed by cra1. Same applies to other servers.
Basically when starting the servers i should start with masters first den cra4, middle tear first then cra, middle tear first then cra1, middle tear first then cra2, middle tear first then cra3.

And when stopping the servers, it should be opposite. for example, First i need stop the cra4 then masters, cra then middle tear, cra1 then middle tear, cra2 then middle tear, cra3 then middle tear.

So now I want to make my scripts to work in parallel for startup and for shutdown. I want to make a single scripts through which I can start all the servers one by one and also stop it one by one through ssh
And when we execute the startup or shutdown command, it should also ask me like :-
When we want to start: -
Code:
./startup.sh
1) masters 
2) cra
3) all
Please enter your choice inorder to start the services :- ?

Do you want read the logs for each service while startup :- ?
1) yes 
2) No

And for stopscript.sh
Code:
./stopscript.sh 
1. masters
2. cra

Please enter your choice in order to stop the services 
1. Stop process
2. Force kill Process

Stop type :- ?

I also need to make a command to see all the running processes.
ex :- Command pshow will lists all the running process.
So anyone can help me with this please ?

Last edited by rbatte1; 10-26-2017 at 08:46 AM.. Reason: Some formatting, some spelling, some grammar
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scripts in another linux m/c via ssh

I want to write a script which connects to another linux via ssh. now i need to execute the rest of my script in that linux.. the echo is coming only when i exited from 10.1.1.252.. pls help (4 Replies)
Discussion started by: esham
4 Replies

2. Solaris

stop a process to start at system startup

Hi all! I'm running Solaris 10 and have a question about how i can stop a certain program to start at system startup,for example, as it is now sendmail is starting but i don't need sendmail,on the other hand so would i be very glad to get cups up and running at startup, anyone who can explain where... (3 Replies)
Discussion started by: larsgk
3 Replies

3. Linux

startup scripts (rc3.d)

I've created the following link in order to startup apache tomcat on startup, however, it does not seem to run. Am I missing something out? :confused: /etc/init.d lrwxrwxrwx 1 root root 16 Sep 5 14:59 K73ypbind -> ../init.d/ypbind lrwxrwxrwx 1 root root 16 Sep 11 13:09 S100tomcat ->... (5 Replies)
Discussion started by: jon80
5 Replies

4. Solaris

stop solaris 8 sendmail from running on startup

sorry i got this already... (3 Replies)
Discussion started by: itik
3 Replies

5. HP-UX

Startup scripts

Hi all We have HP UX 11.23 installed on 4 RISC servers (2 oracle databases, 2 Oracle App Servers) , we are in a construction period , so the power failure may happen more than once a day. I need to learn how to create an automatic startup services as in Windows, if we know that the services... (5 Replies)
Discussion started by: kafaween
5 Replies

6. UNIX for Dummies Questions & Answers

Startup/Kill Scripts

Hello, I have to perform an audit of a system at work and I am looking at its /etc/rc3.d: K01tog-pegasus K74nscd S08iptables S50openemm K01yum K74ntpd S09isdn S55cups K02NetworkManager K85mdmpd S09pcmcia S55sshd K03rhnsd ... (8 Replies)
Discussion started by: mojoman
8 Replies

7. AIX

HACMP version 5.4 startup and stop scripts

Hi My hacmp version is 5.4 and it is a active passive cluster. Where can I find the startup and stop scripts? Please assist. Thanks. (2 Replies)
Discussion started by: samsungsamsung
2 Replies

8. UNIX for Dummies Questions & Answers

startup script to monitor and stop exim

hi i am a newbie to linux , we use Communigate for our mail on Centos. my problem is how to stop exim from running at startup. If exim starts our users cannot send their mail. i have stopped it running on all run levels but if i check exim status it says : Exim is stopped but the pid is running. ... (4 Replies)
Discussion started by: dongcool
4 Replies

9. UNIX for Advanced & Expert Users

xsession startup scripts

Can someone please tell me how to run xsession startup scripts whenever I start or after I restart my X session? I'm not trying to do anything fancy I just want this to run. This makes life a lot easier when I use a dual monitor. xrandr --output VGA1 --mode 1024x768 --rate 60 (7 Replies)
Discussion started by: cokedude
7 Replies
ldns(3) 						     Library Functions Manual							   ldns(3)

NAME
ldns_dname_compare, ldns_dname_interval SYNOPSIS
#include <stdint.h> #include <stdbool.h> #include <ldns/ldns.h> int ldns_dname_compare(const ldns_rdf *dname1, const ldns_rdf *dname2); int ldns_dname_interval(const ldns_rdf *prev, const ldns_rdf *middle, const ldns_rdf *next); DESCRIPTION
ldns_dname_compare() Compares the two dname rdf's according to the algorithm for ordering in RFC4034 Section 6. dname1: First dname rdf to compare dname2: Second dname rdf to compare Returns -1 if dname1 comes before dname2, 1 if dname1 comes after dname2, and 0 if they are equal. ldns_dname_interval() check if middle lays in the interval defined by prev and next prev <= middle < next. This is usefull for nsec check- ing prev: the previous dname middle: the dname to check next: the next dname return 0 on error or unknown, -1 when middle is in the interval, +1 when not AUTHOR
The ldns team at NLnet Labs. Which consists out of Jelte Jansen and Miek Gieben. REPORTING BUGS
Please report bugs to ldns-team@nlnetlabs.nl or in our bugzilla at http://www.nlnetlabs.nl/bugs/index.html COPYRIGHT
Copyright (c) 2004 - 2006 NLnet Labs. Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
ldns_dname_is_subdomain. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035. REMARKS
This manpage was automaticly generated from the ldns source code by use of Doxygen and some perl. 30 May 2006 ldns(3)
All times are GMT -4. The time now is 09:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy