# Problem starting the service

**URL:** <https://discourse.chef.io/t/problem-starting-the-service/7839>\
**Category:** Chef Infra (archive)\
**Created:** [February 19, 2016, 7:07pm UTC](https://discourse.chef.io/t/problem-starting-the-service/7839 "2016-02-19T19:07:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phanikumar](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@phanikumar](https://discourse.chef.io/u/phanikumar)\
**Post date:** [February 19, 2016, 7:07pm UTC](https://discourse.chef.io/t/problem-starting-the-service/7839/1 "2016-02-19T19:07:37Z")

</div>

I was wondering with the things that the following command  
**chef-client -r “recipe[java],recipe[apache\_23112015]”** is not starting the apache service and on the other hand after executing the above command and running sudo chef-client starting the service on a docker machine.

Service start script is as follows.

function start()  
{  
apache\_running=$(ps -ef | grep java | grep -v grep | awk '{ printf 2" " }') if [-z "{apache\_running}"] ; then  
echo "Apache is not running"  
echo "Starting Apache Tomcat"  
cd /opt/apache-tomcat-7.0.64/bin/  
sudo ./startup.sh  
else  
return 0;  
fi  
return 0;  
}
