iam also struck in tomcat8 to run .sh script can you share your playbook.
In which file i have to add this line.(nohup $CATALINA_HOME/bin/catalina.sh start) On Wednesday, February 12, 2014 at 12:28:42 AM UTC+5:30, Alain Sahli wrote: > > Thank you very much! Your solution works. > > On Tuesday, February 11, 2014 5:27:50 PM UTC+1, David Adams wrote: >> >> This is a good point. Tomcat does NOT detach, so running startup.sh >> directly from an Ansible ssh session may well immediately shut down. You've >> got to wrap it in something that will detach correctly. The easiest would >> be nohup. startup.sh is also kind of pointless. You can just call >> catalina.sh directly. From my Tomcat app's init script: >> >> nohup $CATALINA_HOME/bin/catalina.sh start >> >> -dave >> >> >> >> On Tue, Feb 11, 2014 at 6:50 AM, Karl E. Jorgensen < >> [email protected]> wrote: >> >>> Hi >>> >>> On Sun, Feb 09, 2014 at 12:25:06PM -0800, Alain Sahli wrote: >>> > Hi! >>> > >>> > I wrote a simple playbook that downloads, extracts and starts Tomcat. >>> Here are >>> > the relevant parts of it: >>> > >>> > - name: Download Tomcat 7.0.42 >>> > get_url: url= >>> http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.42/bin/ >>> > apache-tomcat-7.0.42.tar.gz >>> dest=/home/tomcat/apache-tomcat-7.0.42.tar.gz >>> > >>> > - name: Extract Tomcat >>> > command: chdir=/home/tomcat tar -xvzf apache-tomcat-7.0.42.tar.gz >>> creates=/ >>> > home/tomcat/apache-tomcat-7.0.42 >>> > >>> > - name: Change ownership of Tomcat installation >>> > file: path=/home/tomcat/apache-tomcat-7.0.42 owner=tomcat >>> group=tomcat state= >>> > directory recurse=yes >>> > >>> > - name: Configure Tomcat server >>> > template: src=tomcat-users.xml >>> dest=/home/tomcat/apache-tomcat-7.0.42/conf/ >>> > notify: restart tomcat >>> > >>> > - name: Set JAVA_HOME for tomcat >>> > lineinfile: dest=/home/tomcat/apache-tomcat-7.0.42/bin/setenv.sh >>> line='export >>> > JAVA_HOME=/opt/java/jdk1.7.0_51' create=yes state=present mode=0555 >>> > >>> > - name: Start Tomcat >>> > command: /home/tomcat/apache-tomcat-7.0.42/bin/startup.sh >>> > sudo: true >>> > sudo_user: tomcat >>> > >>> > - name: wait for tomcat to start >>> > wait_for: port=8080 >>> >>> Does tomcat actually detach from the TTY? >>> >>> IIRC failure to do so can keep the SSH session open. Or alternatively: >>> Break the offending process (tomcat) when ssh is killed... >>> >>> If you start tomcat from a normal login shell, and run "ps -ef|grep >>> tomcat" (or similar), it should not be associated with your login >>> tty... >>> >>> -- >>> Karl E. Jorgensen >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ansible Project" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/332a55c8-161e-49f9-b057-49ab93747fad%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
