You can troubleshoot scripts by adding -x to the first line. For example, the first line in unix shell scripts is usually:
#/bin/sh Change that to #/bin/sh -x That turns on echo so you can see each statement executed. You may have to edit multiple scripts if one calls another. George Sexton MH Software, Inc. 303 438-9585 www.mhsoftware.com > -----Original Message----- > From: james [mailto:[email protected]] > Sent: Wednesday, January 12, 2011 7:35 PM > To: [email protected] > Subject: tomcat won't start via remote ssh command > > Hi Guys, > > I created a simple (i thought) script to restart a tomcat server when > our > alerting system sees the site as down (almost always a memory issue > that a > reboot of the tomcat server fixes). > > The script runs and works fine when executed as the user on the local > server. When run via ssh, it will shut down the tomcat server, and > appear > to start it -- but does not. I'm not a tomcat expert at all and I > haven't > been able to figure out how to get more information. I'm guessing that > there is some environment information that is missing over the ssh > terminal > that is causing it not to start, but I don't have any hints and the > output > is the same as when it works. > > The SSH command I run that doesn't work is below. Since even this > command > does not work, I won't bother complicating the issue with the details > of my > script: > > $ ssh -t -p 222 [email protected] > '/usr/local/sites/domain.com/domain-tomcat1- > production/tomcat/bin/startup.sh > ' > Using CATALINA_BASE: > /usr/local/sites/domain.com/domain-tomcat1-production/tomcat > Using CATALINA_HOME: > /usr/local/sites/domain.com/domain-tomcat1-production/tomcat > Using CATALINA_TMPDIR: > /usr/local/sites/domain.com/domain-tomcat1-production/tomcat/temp > Using JRE_HOME: /usr > Connection to tomcatserver.domain.com closed. > > Any help would be very much appreciated if you have experience with > this. > James > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
