I did set this to seinsible defaults of my initial project for which I developed this cookbook
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
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 firstname.lastname@example.org 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 email@example.com 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:
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:
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.
[root@centos ~]# /etc/init.d/tomcat6 start
Starting tomcat6: lock file found but no process running for
pid 19454, continuing
[ OK ]
[root@centos ~]# /etc/init.d/tomcat6 stop
[root@centos ~]# [ 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))
On Tue, Sep 7, 2010 at 9:46 AM, Ran Tavory firstname.lastname@example.org 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 email@example.com 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.
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’.
On Mon, Sep 6, 2010 at 8:22 AM, Ran Tavory firstname.lastname@example.org wrote:
On Sep 6, 2010 4:10 PM, “Charles Sullivan” email@example.com wrote:
What distro are you using?
Sent from my iPhone
On Sep 6, 2010, at 6:09 AM, Ran Tavory firstname.lastname@example.org 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
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…