[chef] Re: Re: Re: Re: tomcat6 errors


Chronological Thread 
  • From: Ran Tavory < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: tomcat6 errors
  • Date: Tue, 7 Sep 2010 17:31:01 +0300
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=hw7dNhwT2A9aWokzdJPqjJMSkXGnTyPcJldvGlxwlw2fmwHuCAdxZpSls6I44vz535 o1sA7Jgrm2WRUc/zpuIEZV7REX+Y4WutUCu9tL/qxFMfMQX0JnSlB68DmhRRxMB9Zg/p z0ikwGpECpPMbqEM3QPrPPNrhRFbUbRkWunsE=

I dug some more and found the error log at  /var/log/tomcat6/catalina.out with:
/usr/bin/dtomcat6: line 75: /usr/lib/jvm/java/bin/java: No such file or directory

So it looks like although I've set a correct JAVA_HOME in my .bashrc (as root) the script at cookbooks/tomcat6/files/default/dtomcat6 still thinks JAVA_HOME is at /usr/lib/jvm/java/
I could not find a way to convince it that JAVA_HOME is actaully here:
env | grep JAVA
JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk/

So I just hacked it like that:
 ln -s /usr/lib/jvm/jre-1.6.0-openjdk/ /usr/lib/jvm/java

I'm sure this is not the right way, so I was hoping someone would let me know what's the correct fix for the recipe...


On Tue, Sep 7, 2010 at 4:41 PM, Ran Tavory < "> > wrote:
Sorry, I forgot the attach the log from the most recent run on centos. This run was relatively successful, but didn't end well...

 ERROR: Re-raising exception: Chef::Exceptions::Exec - /sbin/service tomcat6 restart returned 1, expected 0

Full log here: http://pastebin.com/RTVhgxrS


On Tue, Sep 7, 2010 at 4:35 PM, Ran Tavory < " target="_blank"> > wrote:
I still haven't been able to get ubuntu to work, but I moved on to test centos and I see other errors...

First I see this error:
/tmp/chef-solo/cookbooks/tomcat6/attributes/default.rb:45:in `from_file': undefined method `[]' for nil:NilClass (NoMethodError)

default.rb line 45 is this:
set_unless[:tomcat6][:with_snmp]        = !languages[:java][:runtime][:name].match(/^OpenJDK/)

If I comment out this line (I don't care that much about snmp now) then things start to move but eventually I get this error:
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:in `handle_command_failures': /sbin/service tomcat6 restart returned 1, expected 0 (Chef::Exceptions::Exec)

So I figured out the problem was in this line at tomcat6/files/default/tomcat6:
NAME="$(/usr/bin/basename $0)"
looks like basename is installed somewhere else, at least on centos (it's on /bin/basename).
When I changed this to just $(basename $0) the installation script finished but still tomcat wasn't installed properly.

~]# /etc/init.d/tomcat6 start
Starting tomcat6: lock file found but no process running for
pid 19454, continuing
                                                           [  OK  ]
~]# /etc/init.d/tomcat6 stop
~]#                                           [  FAILED  ]


Maybe it's b/c I made a mess, I don't know I was trying to get this workin... still couldn't get tomcat6 installed (this time CentOS release 5.5 (Final))

help, thanks


On Tue, Sep 7, 2010 at 9:46 AM, Ran Tavory < " target="_blank"> > wrote:
so what should I put in templates/dtomcat.erb?

I get this when I run:
ERROR: Re-raising exception: Chef::Exceptions::FileNotFound - cookbook tomcat6 does not contain file templates/dtomcat6.erb

On Mon, Sep 6, 2010 at 5:35 PM, Charles Sullivan < " target="_blank"> > wrote:
It wasn't tested well with Ubuntu and makes some assumptions that are only true on other distributions. 

The following needs to be at the very top of the recipe for Ubuntu.  Note that the template and cookbook_file resources were moved from another section of the recipe for order of operations purposes. 

https://gist.github.com/a435155e5f35bc7526a4

Let me know if that doesn't work for you.  I also modified my Tomcat cookbook to use 'jsvc' so that Tomcat would daemonize properly.  If you don't, you'll have to start Tomcat outside of your chef run or manage it with something like 'runit'.

--Charlie



On Mon, Sep 6, 2010 at 8:22 AM, Ran Tavory < " target="_blank"> > wrote:

Ubuntu 10.4

On Sep 6, 2010 4:10 PM, "Charles Sullivan" < " target="_blank"> > wrote:
> What distro are you using?
>
> Sent from my iPhone
>
> On Sep 6, 2010, at 6:09 AM, Ran Tavory < " target="_blank"> > wrote:
>
>> It looks like maybe the tomcat6 cookbook is broken http://cookbooks.opscode.com/cookbooks/tomcat6
>> When I run it I see No such file or directory - /etc/init.d/tomcat6
>> status
>> So it looks like the cookbook is attempting to check tomcat's status
>> before tomcat is installed and so it fails.
>> The full log is here http://pastebin.com/g5u6C9s0
>>
>> I'm a newbe so, you know, if it's my bad let me know....
>> --
>> /Ran
>>




--



--
/Ran




--
/Ran




--
/Ran




--
/Ran




Archive powered by MHonArc 2.6.16.

§