# Remote jboss startup script failing in Ansible

**URL:** <https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615>\
**Category:** Ansible Project\
**Created:** [May 31, 2017, 8:14pm UTC](https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615 "2017-05-31T20:14:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surya](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@Surya](https://forum.ansible.com/u/Surya)\
**Post date:** [May 31, 2017, 8:14pm UTC](https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615/1 "2017-05-31T20:14:22Z")

</div>

HI Team,

I have the Jboss startup script to be triggered by Ansible for my BAU activities.

**startup script starts: Host controller, Process controller, and Server groups. When i run the script locally, its working fine, But when i trigger it from Ansible its not starting the instances.**

**Play book step as below:-**

- hosts: uat\_hosts  
become: yes  
become\_user: jboss

tasks:

- name: stop the Host controller and server group  
shell: “/home/jboss/bin/stopApplePAY-JVM.sh”  
tags: stop-hc-jvm

- name: start the Host controller and server group  
shell: “nohup /home/jboss/bin/startApplePAY-HC.sh 1\>/dev/null 2\>&1”  
tags: start-hc-jvm

Note:- Playbook execution is successful, But its not starting the instances, I have tired adding sleep in the startup script, but did not help. Tried async option in the Play book, no luck.

**Startup script as below:-**

$cat startApplePAY-HC.sh

/opt/applepayuat-jboss6/jboss-eap-6.2/bin/domain.sh -P file:///apps/applepay-jboss6/jboss-eap-6.2/domain/configuration/domain.properties \>/dev/null 2\>&1 &

Note:- The above script will start totally 6 Jboss java process.

Please some one help if you fix for this. Thank you …!

Tnx  
Surya

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 1, 2017, 9:59am UTC](https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615/2 "2017-06-01T09:59:30Z")

</div>

Start with removing the redirection to /dev/null so you can see what’s happening.

Dick

---

<div class="post-metadata">

**Author:** ![Surya](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@Surya](https://forum.ansible.com/u/Surya)\
**Post date:** [June 7, 2017, 10:53pm UTC](https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615/3 "2017-06-07T22:53:19Z")

</div>

Hi Dick,

I tried with that, just the command is getting executed but in remote machine the instances are not started… any option i can try, Please advice.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 8, 2017, 9:54am UTC](https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615/4 "2017-06-08T09:54:32Z")

</div>

Use enough verbosity (-vvvv).  
If that doesn't work, try redirecting your shell script output to a  
file instead of /dev/null.  
Since your main shell script run another shell script, you can try  
adjusting the verbosity of that as well.

Dick

---

<div class="post-metadata">

**Author:** ![Surya](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@Surya](https://forum.ansible.com/u/Surya)\
**Post date:** [June 8, 2017, 6:17pm UTC](https://forum.ansible.com/t/remote-jboss-startup-script-failing-in-ansible/24615/5 "2017-06-08T18:17:07Z")

</div>

Hi Dick,

Have resolved the issue, just added “sleep 200” in the end of my startup script. So Ansible will wait 200 sec to terminate the ssh session. I could see my jboss instances are started and running fine.

Thanks for your time and suggestions …! Appreciate it .
