Tomcat service start not working

Hi All,

I’m trying to start tomcat as a service via “notifies” and when the recipe runs I get the below output

==> default: [2015-11-23T18:01:30+05:30] INFO: remote_file[/usr/share/apache-tomcat-8.0.26/webapps/my-app.war] sending start action to service[tomcat] (immediate)
==> default: Recipe: tomcat::install_tomcat
==> default:   * service[tomcat] action start
==> default:  (up to date)

and tomcat does not start.

This is what I have written in my recipe
notifies :start, 'service[tomcat]', :immediately

I have also tried with

service 'tomcat' do action :start end

and this gives the output as below.

==> default: * service[tomcat] action start
==> default:  (up to date)

And does not start tomcat as well

On the other hand,

service 'tomcat' do action :stop end

stops the tomcat instance

Any idea what could be wrong?


Are you not looking at action :restart ?

The idempotent behavior is: if you notify something to start and it’s already started, do nothing, hence the ‘up to date’ log you get, tomcat is already started, so don’t try to start it again.

Well, I have a stop just before that and to test, I had the tomcat service stopped manually as well. Still the start would not work.

I tried with restart and that works, I was also able to start the tomcat service manually.


Maybe you have another resource earlier in the run starting tomcat ?

Maybe you can make a gist of a run log ?