Problem starting of Tomcat on remote host


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem starting of Tomcat on remote host
# 1  
Old 06-10-2011
Problem starting of Tomcat on remote host

Hi All,

I have several Tomcat 7.0.12 installations on remote servers for different projects. I need to start and stop them from a centralized server. Once I start the server remotely using ssh commands, server starts successfully but prompt does not exit. It keeps on holding.

I have password-less sudo connectivity established from central server to all remote hosts.

Command used is :
Code:
ssh -l user remote-address 'cd TOMCAT_HOME/bin; ./startup.sh'

I tried to search the over the forum came through this one https://www.unix.com/shell-programmin...te-tomcat.html but no significant solution. So I had to spawn a new thread.

Any ideas/suggestions?

Thanks in advance.

Regards,
Bhaskar
# 2  
Old 06-10-2011
What happens if you redirect stderr:

Code:
ssh -l user remote-address 'cd TOMCAT_HOME/bin; ./startup.sh 2>/dev/null'

If that hangs too, try to redirect all stdin, stdout and stderr:

Code:
ssh -l user remote-address 'cd TOMCAT_HOME/bin; ./startup.sh </dev/null >/dev/null 2>&1'

This User Gave Thanks to radoulov For This Post:
# 3  
Old 06-10-2011
Thanks a lot mate!! the second option ran perfect fine.

By the way, just out of curiosity wanted to know, how redirection of all stdin, stderr, stdout make a prompt come out.

Thanks and Cheers!!
Bhaskar
# 4  
Old 06-10-2011
Quote:
Originally Posted by bhaskar_m
Thanks a lot mate!! the second option ran perfect fine.

By the way, just out of curiosity wanted to know, how redirection of all stdin, stderr, stdout make a prompt come out.
I suppose that in the first case the startup.sh is not properly detaching from the controlling terminal.
When closing all three standard I/O channels (standard input, output and error output) it seems to do it.
# 5  
Old 06-10-2011
Thanks Mate!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check/get the exit status of a remote command executed on remote host through script

Geeks, Could you please help me out in my script and identify the missing piece. I need to check/get the exit status of a remote command executed on remote host through script and send out an email when process/processes is/are not running on any/all server(s). Here's the complete... (5 Replies)
Discussion started by: lovesaikrishna
5 Replies

2. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies

3. Linux

How to push Tomcat logs to remote syslog server?

I found a script for automatically push tomcat logs to syslog server which is locate in same server. How do I change it to push logs to remote server? log4j.rootLogger=INFO, WARN, console, file, SYSLOG log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.append=true... (2 Replies)
Discussion started by: heshandh
2 Replies

4. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

5. Shell Programming and Scripting

running commands to remote host from centralized host

Gurus/Experts We have a centralized UNIX/Solaris server from where we can actually ssh to all other UNIX/Solaris servers...I need to write a script that reside on this centerlized server and do FileSystem monitoring (basically run df -h or -k) of other remote servers and then send an email to me... (6 Replies)
Discussion started by: anjum.suri
6 Replies

6. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

7. UNIX for Dummies Questions & Answers

TomCat access in an Remote Linux Server

Hi all, I Installed Tomcat in an remote linux server (/usr/tomcat)and start service, using ./startup.sh (and tried with ./catalina.sh too). //----------------------------------------------------------------// # ./startup.sh Using CATALINA_BASE: /usr/tomcat/apache-tomcat-6.0.16/ Using... (1 Reply)
Discussion started by: gothama
1 Replies

8. Shell Programming and Scripting

Problem with Unix script to start remote Tomcat

I have Tomcat installed on a Unix box and I need to start it remotely from another Unix box. Tomcat is started using a script. When this script is run locally everything is fine. When I run the same script from remote box, tomcat starts but the command running the script does not terminate.:( ... (2 Replies)
Discussion started by: shrgh
2 Replies

9. Solaris

How to delete the files from local host to remote host

Hi all, i am copying .gz files from production server to development server using "scp" command.my requirement is after copying .gz files i want to delete old .gz files(two days back) in development server from production server. like this way i need to delelte .log ,.z and .dmp files... (3 Replies)
Discussion started by: krishna176
3 Replies

10. Shell Programming and Scripting

Problem with logging into remote host

Hi All, I am using a script for remotely logging into a rhost using telnet and shutdown a server. The script is as follows. IP = 10.24.12.23; export IP UNAME = username ; export UNAME PWD = password; export PWD CRDIR = /etc/rc.d/init.d ; export CRDIR echo "logging into remote... (4 Replies)
Discussion started by: patil_reddy
4 Replies
Login or Register to Ask a Question