<div dir="ltr"><div class="gmail-adn gmail-ads" style="border-left:none;padding:0px;display:flex;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium;text-decoration-style:initial;text-decoration-color:initial"><div class="gmail-gs" style="margin:0px;padding:0px 0px 20px;width:953px"><div class="gmail-"><div id="gmail-:1d6" class="gmail-ii gmail-gt" style="font-size:12.8px;direction:ltr;margin:8px 0px 0px;padding:0px"><div id="gmail-:1d5" class="gmail-a3s gmail-aXjCH" style="overflow:hidden;font:small/1.5 Arial,Helvetica,sans-serif"><div dir="ltr"><font face="times new roman, serif">Hello All:</font><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">I'm attempting to install Apache Tomcat 8.5.32 onto a Centos 7.5 VM via Chef Software. </font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">My VM(s) are created and managed by VirtualBox and Vagrant. There are no issues creating any of the VM(s).</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">What is an issue is when I execute a "kitchen converge" from the Chef Workstation which I have set to load the tomcat::default recipe (default.rb).</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">From there the recipe chimes along to the point of executing the 'sudo systemctl daemon-reload' as noted below from the excerpt of the tomcat::default recipe. </font></div><div><div><font face="times new roman, serif"><b>execute 'daemon-reload' do</b></font></div><div><font face="times new roman, serif"><b>  command 'sudo systemctl daemon-reload'</b></font></div><div><font face="times new roman, serif"><b>end</b></font></div></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">The execution within the tomcat::default recipe is to start the tomcat service:</font></div><div><div><font face="times new roman, serif"><b>service "tomcat" do</b></font></div><div><font face="times new roman, serif"><b>  action :start</b></font></div><div><font face="times new roman, serif"><b>end</b></font></div></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">This is where I receive the error with respect of the tomcat service failing but as I peel back the onion through "<b>systemctl status tomcat.service</b>" and "<b>journalctl -xe</b>" for details once logged into the VM (<b>kitchen login</b>) it appears the real issue is with the tomcat service remains in an "<b>auto-restart state</b>" which leads to "<b>tomcat.service: control process exited, code=exited status=1</b>", "<b>Failed to start Apache Tomcat Web Application Container", "Unit tomcat.service entered failed state"<span> </span></b>and<b> "tomcat.service failed.</b>" </font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">I believe since my<span> </span><b>tomcat.service.erb</b><span> </span>template is not able to create via the "touch" command a file called ‘<b>/opt/tomcat/logs/catalina.out</b>’:<span> </span><b>Permission denied</b><span> </span>detailed from the <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"<b>journalctl -xe</b>" output. </span></font></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="times new roman, serif"><br></font></span></div><div><font face="times new roman, serif">For testing pursposes, I issued "<b>sudo touch </b><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>/opt/tomcat/logs/catalina.out</b>" command on the VM that created the emptied file and re-ran "<b>kitchen converge</b>" from the chef workstation. The same results and error output occurred although the VM now has the <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">‘<b>/opt/tomcat/logs/catalina.out'</b><span> </span>file. </span></span></font></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="times new roman, serif"><br></font></span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="times new roman, serif"><b><u>Question</u></b>: </font></span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><font face="times new roman, serif">Is there way to modify the template file:<span> </span><b>tomcat.service.erb</b><span> </span>to include creating <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">‘<b>/opt/tomcat/logs/catalina.out</b>' file prior to execution of the <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><b>'sudo systemctl daemon-reload'</b>command? Also, I'm unsure how long  the command: <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><b>'sudo systemctl daemon-reload' <span> </span></b>takes and perhaps is a causing the failed state of the tomcat.service since it times out?. If there's another resolution to this issue or the path I'm leading towards is the wrong direction, please advise.</span></span></span></font></span></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><font face="times new roman, serif"><br></font></span></span></span></span></span></div><div><font face="times new roman, serif"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">The instructions that I'm following can be found in an article titled: "</span></span></span></span></span><span style="color:rgb(58,58,58)"><b>How To Install Apache Tomcat 8 on CentOS 7</b>"</span></font></div><div><b><font face="times new roman, serif"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> </span></span></span></span></span><a href="https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7" target="_blank" style="color:rgb(17,85,204)">https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7</a></font></b></div><div><b><font face="times new roman, serif"><br></font></b></div><div><font face="times new roman, serif"><b>Please refer to the section: "</b><b><h3 id="gmail-m_-391834178456045558gmail-install-systemd-unit-file" style="box-sizing:border-box;margin:14px auto 11px;padding:0px;letter-spacing:0.005em;color:rgb(58,58,58);width:745px;display:inline">Install Systemd Unit File"</h3></b></font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">Any assistance will be well received and I'll be extremely appreciative.</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">Thank you to All!</font></div><div><font face="times new roman, serif"><br></font></div><div><b><font face="times new roman, serif">See "systemctl status tomcat.service" and "journalctl -xe" for details<br></font></b></div><div><font face="times new roman, serif"><br></font></div><div><div><font face="times new roman, serif">================================================================================</font></div><div><font face="times new roman, serif">           Error executing action `start` on resource 'service[tomcat]'</font></div><div><font face="times new roman, serif">           ================================================================================</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">           Mixlib::ShellOut::ShellCommandFailed</font></div><div><font face="times new roman, serif">           ------------------------------------</font></div><div><font face="times new roman, serif">           Expected process to exit with [0], but received '1'</font></div><div><font face="times new roman, serif">           ---- Begin output of /bin/systemctl --system start tomcat ----</font></div><div><font face="times new roman, serif">           STDOUT:</font></div><div><font face="times new roman, serif">           STDERR: Job for tomcat.service failed because the control process exited with error code. See "systemctl status tomcat.service" and "journalctl -xe" for details.</font></div><div><font face="times new roman, serif">           ---- End output of /bin/systemctl --system start tomcat ----</font></div><div><font face="times new roman, serif">           Ran /bin/systemctl --system start tomcat returned 1</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">           Resource Declaration:</font></div><div><font face="times new roman, serif">           ---------------------</font></div><div><font face="times new roman, serif">           # In /tmp/kitchen/cache/cookbooks/tomcat/recipes/default.rb</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">           124: service "tomcat" do</font></div><div><font face="times new roman, serif">           125:   action :start</font></div><div><font face="times new roman, serif">           126: end</font></div><div><font face="times new roman, serif">           127:</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">           Compiled Resource:</font></div><div><font face="times new roman, serif">           ------------------</font></div><div><font face="times new roman, serif">           # Declared in /tmp/kitchen/cache/cookbooks/tomcat/recipes/default.rb:124:in `from_file'</font></div></div><div><font face="times new roman, serif"><br></font></div><div><div><font face="times new roman, serif">[vagrant@tomcat-centos-75 ~]$<span> </span><b>sudo systemctl status tomcat.service</b></font></div><div><font face="times new roman, serif">● tomcat.service - Apache Tomcat Web Application Container</font></div><div><b><font face="times new roman, serif">   Loaded: loaded (/etc/systemd/system/tomcat.service; disabled; vendor preset: disabled)</font></b></div><div><b><font face="times new roman, serif">   Active: activating (auto-restart) (Result: exit-code) since Tue 2018-07-24 13:59:08 UTC; 2s ago</font></b></div><div><font face="times new roman, serif">  Process: 5999 ExecStart=/opt/tomcat/bin/startup.sh (code=exited, status=1/FAILURE)</font></div><div><font face="times new roman, serif"><br></font></div><div><font face="times new roman, serif">Jul 24 13:59:08<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>tomcat.service: control process exited, code=exited status=1</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:08<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>Failed to start Apache Tomcat Web Application Container.</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:08<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>Unit tomcat.service entered failed state.</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:08<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>tomcat.service failed.</b></font></div><div><font face="times new roman, serif">[vagrant@tomcat-centos-75 ~]$</font></div><div><font face="times new roman, serif">[vagrant@tomcat-centos-75 ~]$</font></div><div><font face="times new roman, serif">[vagrant@tomcat-centos-75 ~]$<b><span> </span>sudo journalctl -xe</b></font></div><div><font face="times new roman, serif">-- The result is failed.</font></div><div><font face="times new roman, serif">Jul 24 13:59:28<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>Unit tomcat.service entered failed state.</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:28<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>tomcat.service failed</b>.</font></div><div><font face="times new roman, serif">Jul 24 13:59:38<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>tomcat.service holdoff time over, scheduling restart.</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:38<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>Starting Apache Tomcat Web Application Container...</b></font></div><div><font face="times new roman, serif">-- Subject: Unit tomcat.service has begun start-up</font></div><div><font face="times new roman, serif">-- Defined-By: systemd</font></div><div><font face="times new roman, serif">-- Support:<span> </span><a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank" style="color:rgb(17,85,204)">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a></font></div><div><font face="times new roman, serif">--</font></div><div><font face="times new roman, serif">-- Unit tomcat.service has begun starting up.</font></div><div><font face="times new roman, serif">Jul 24 13:59:39<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>startup.sh[6025]:<span> </span><b>touch: cannot touch ‘/opt/tomcat/logs/catalina.out’: Permission denied</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:39<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>tomcat.service: control process exited, code=exited status=1</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:39<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>startup.sh[6025]:<span> </span><b>/opt/tomcat/bin/catalina.sh: line 464: /opt/tomcat/logs/catalina.out: Permission denied</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:39<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>Failed to start Apache Tomcat Web Application Container.</b></font></div><div><font face="times new roman, serif">-- Subject: Unit tomcat.service has failed</font></div><div><font face="times new roman, serif">-- Defined-By: systemd</font></div><div><font face="times new roman, serif">-- Support:<span> </span><a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank" style="color:rgb(17,85,204)">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a></font></div><div><font face="times new roman, serif">--</font></div><div><b><font face="times new roman, serif">-- Unit tomcat.service has failed.</font></b></div><div><font face="times new roman, serif">--</font></div><div><font face="times new roman, serif">-- The result is failed.</font></div><div><font face="times new roman, serif">Jul 24 13:59:39<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>Unit tomcat.service entered failed state.</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:39<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>systemd[1]:<span> </span><b>tomcat.service failed.</b></font></div><div><font face="times new roman, serif">Jul 24 13:59:45<span> </span><a href="http://tomcat-centos-75.vagrantup.com/" target="_blank" style="color:rgb(17,85,204)">tomcat-centos-75.vagrantup.com</a><span> </span>sudo[6033]:  vagrant : TTY=pts/0 ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/journalctl -xe</font></div><div><font face="times new roman, serif">lines 2749-2772/2772 (END)</font></div></div></div><div class="gmail-yj6qo"></div><div class="gmail-adL"></div></div></div><div class="gmail-hi" style="border-bottom-left-radius:1px;border-bottom-right-radius:1px;padding:0px;width:auto;background:rgb(242,242,242);margin:0px"></div></div></div><div class="gmail-ajx" style="clear:both"></div></div><div class="gmail-gA gmail-gt gmail-acV" style="font-size:12.8px;padding:0px;width:auto;border-bottom-left-radius:0px;border-bottom-right-radius:0px;border-top:none;margin:0px;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;text-decoration-style:initial;text-decoration-color:initial"><div class="gmail-gB gmail-xu" style="border-top:0px;padding:0px"><div class="gmail-ip gmail-iq" style="clear:both;margin:0px;padding:16px 0px;border-top:none"><br class="gmail-Apple-interchange-newline"></div></div></div><br></div>