I'd avoid nohup like the plague. Why not just write a small upstart or systemd script and run your java app as a service: task?
On 27 September 2016 at 09:07, 刘松 <[email protected]> wrote: > Hi, > May I ask for execute java program with ansible? > I execute a java program (spring boot project, a jar package for java web > site) > ansible ofbiz1 -m shell -a "chdir=/opt/CassEC-OrderSupports nohup java > -jar product.jar &", it echo success ,but in fact,it do nothing! the java > program is not been started! > I'm very sure that I can execute nohup java -jar product.jar & in the > machine directly, I can start the java program. > > and I try use this command , > ansible ofbiz1 -m shell -a "chdir=/opt/CassEC-OrderSupports nohup > /usr/java/jdk1.8.0_74/java -jar product.jar &", > as I prefer the java direction, it work! > > Can anybody tell me why? and how can I use java -jar direct with ansible? > > -- > 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/93a1408f-18ab-43b8-8b29-90328899dea1%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CAK5eLPRAS9ttFuvWQk6B3LUnionhQ2he%2BdSwj6F%2B_uGQKXSCtw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
