Also, if it's in .bashrc and startup.sh is using /bin/sh, then they likely won't get loaded-- you might need to move it to something like .profile (I forget exactly what startup file(s) sh loads but I believe .bashrc / .bash_profile isn't included).
Oh then should I create .profile file (at this location "~/") and export these variables in this file. But I checked tomcat-startup.sh file and it do not include any of the above discussed files(.bashrc, bash_profile or .profile)Just for reference here is the tomcat/startup.sh:
## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# -----------------------------------------------------------------------------# Start Script for the CATALINA Server## $Id: startup.sh 1202062 2011-11-15 06:50:02Z mturk $# -----------------------------------------------------------------------------# Better OS/400 detection: see Bugzilla 31132os400=falsecase "`uname`" inOS400*) os400=true;;esac# resolve links - $0 may be a softlinkPRG="$0"
while [ -h "$PRG" ] ; dols=`ls -ld "$PRG"`link=`expr "$ls" : '.*-> \(.*\)$'`if expr "$link" : '/.*' > /dev/null; thenPRG="$link"elsePRG=`dirname "$PRG"`/"$link"fidone
PRGDIR=`dirname "$PRG"`EXECUTABLE=catalina.sh# Check that target executable existsif $os400; then# -x will Only work on the os400 if the files are:# 1. owned by the user# 2. owned by the PRIMARY group of the user# this will not work if the user belongs in secondary groupsevalelseif [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; thenecho "Cannot find $PRGDIR/$EXECUTABLE"echo "The file is absent or does not have execute permission"echo "This file is needed to run this program"exit 1fifiexec "$PRGDIR"/"$EXECUTABLE" start "$@"On Sun, May 12, 2013 at 6:29 PM, Morgan Blackthorne < " target="_blank"> > wrote:
I would log in as the user and check to make sure that those values are set. Also, if it's in .bashrc and startup.sh is using /bin/sh, then they likely won't get loaded-- you might need to move it to something like .profile (I forget exactly what startup file(s) sh loads but I believe .bashrc / .bash_profile isn't included).--~*~ StormeRider ~*~"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."(from Smallville Season 6x1: "Zod")
On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSSOn Sun, May 12, 2013 at 4:43 AM, Chandan Maheshwari < " target="_blank"> > wrote:
Can you guide me what other trouble shooting I can do."Neither JAVA_HOME nor JRE_HOME is set, need at least one to set" But now I am setting those in ~/.bashrc file also.I did some troubleshooting initially to redirect output of command ..../tomcat/bin/startup.sh in a .txt file and saw that it says:Also there are no logs for tomcat also.Thanks Morgan,I am afraid, but it doesn't give any error. The chef-client runs successfully and creates node and client onto my chef-server. Any other location where I can check logs after logging into the newly created instance.
--On Sun, May 12, 2013 at 5:00 PM, Morgan Blackthorne < " target="_blank"> > wrote:
Specifying what error it runs I to will probably help folks help you. It's standard troubleshooting question number one: what happens when you try?--
On Sunday, May 12, 2013, Chandan Maheshwari wrote:
To be more specific, here is what all I have tried:For point 3 and 4 above the strange thing is that other commands inside run_tomcat.sh, like extracting war, deleting some directory from the extracted war executes. BUT TOMCAT DOESN'T START UP.BUT IT DO NOT START.Inside this run_tomcat.sh, I am exporting the environment variables and then running the "/home/ubuntu/tomcat/bin/startup.sh"Now using "execute" resource, ran "/home/ubuntu/tomcat/bin/startup.sh" BUT IT DO NOT START.In a recipe inside bash script simply added the environment variables at the end of ~/.bashrc and then ran source ~/.bashrc [ this works I can verify from ~/.bashrc file)What I did is:I have my cookbook: where in my recipe, I am downloading tomcat.tar (this I have placed somewhere in my other machine). After downloading I extract the same tomcat.tar (suppose in location /home/ubuntu/tomcat). Now I am simply trying to start tomcat. I tried the below mentioned ways, but is not able to start/stop.1) Modified the ~/.bashrc file from my recipe to export JAVA_HOME, CATALINA_HOME,
2) Modified the ~/.bashrc file from my recipe to export JAVA_HOME, CATALINA_HOME,
What I did is:
ran a bash script inside recipe to simply add the environment variables at the end of ~/.bashrc and then ran source ~/.bashrc
Inside bash script resource, ran "/home/ubuntu/tomcat/bin/startup.sh" BUT IT DO NOT START.
3) Wrote a shell script and kept at the same location from where I am downloading tomcat.tar, downloaded the run_tomcat.sh on to the chef-client (using resource remote_file) and then using the "execute" resource running the run_tomcat.sh.
4) Wrote a shell script and kept at the same location from where I am downloading tomcat.tar, downloaded the run_tomcat.sh on to the chef-client (using resource remote_file). Set environment variables using "environment resource" and run script using "execute" resource.
Inside this run_tomcat.sh, running the "/home/ubuntu/tomcat/bin/startup.sh"
BUT IT DO NOT START.I tried couple of other things also, but is not able to start or stop the tomcat.On Fri, May 10, 2013 at 11:00 PM, Chandan Maheshwari < > wrote:
I don't want to use the existing tomcat cookbook, as I want to try it from my location(where I have kept the tomcat.tar) also I want to use tomcat7.Any help is greatly appreciated.I am executing this script using "execute" and in command passing the full path of the script. The script does everything (extracts my application war in particular location, removes some unwanted files from the extracted war), but it do not stops the tomcat and then starts it back.Now I have one shell script which basically stops the tomcat, extracts my application war in particular location, removes some unwanted files from the extracted war and then starts the tomcat back.Then I am using some resources to untar it to define a specific folder structure onto my new instance created using knife ec2 plugin. (to be specific ubuntu)Basically I have wrote a cookbook, where I am simply downloading a tar file of tomcat with other stuff related to my app from some location.Hi All,This may be a stupid or a silly question. But I am finding issues in getting it done.
The chef-client runs successfully.Now when I login to the newly created instance, I can't see any tomcat logs. Moreover when I run the shell script manually (which I ran with cookbook also), it does everything and I can hit the URL to access my app.
--
Thanks and Regards,
Chandan
--
Regards,
Chandan
--~*~ StormeRider ~*~"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."(from Smallville Season 6x1: "Zod")
On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS
Regards,
Chandan
--Chandan Maheshwari,
Cloud Softwate Engineer, Clogeny Technologies,(M) 0091-8956541752Skype: chandan.maheshwari16
Archive powered by MHonArc 2.6.16.