# Using ansbile to launch a long running process on a remote host

**URL:** <https://forum.ansible.com/t/using-ansbile-to-launch-a-long-running-process-on-a-remote-host/13617>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 6, 2013, 7:33pm UTC](https://forum.ansible.com/t/using-ansbile-to-launch-a-long-running-process-on-a-remote-host/13617 "2013-10-06T19:33:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soumya\_Simanta](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Soumya\_Simanta](https://forum.ansible.com/u/Soumya_Simanta)\
**Post date:** [October 6, 2013, 7:33pm UTC](https://forum.ansible.com/t/using-ansbile-to-launch-a-long-running-process-on-a-remote-host/13617/1 "2013-10-06T19:33:08Z")

</div>

I’m new to Ansible. I’m trying to start a process on a remote host using a very simple Ansbile Playbook.

Here is how my playbook looks like

```auto
-
  hosts: somehost
  gather_facts: no
  user: ubuntu  
  tasks:
    - name: change directory and run jetty server
      shell: cd /home/ubuntu/code; nohup ./run.sh    
      async: 45

```

run.sh calls a java server process with a few parameters. My understanding was that using async my process on the remote machine would continue to run even after the playbook has completed (which should happen after around 45 seconds.)

However, as soon as my playbook exits the process started by run.sh on the remote host terminals as well.

Can anyone explain what’s going and what am I missing here.

Thanks.

I’ve also posted this question here on StackOverflow.

[http://stackoverflow.com/questions/19212983/using-ansbile-to-launch-a-long-running-process-on-a-remote-host](http://stackoverflow.com/questions/19212983/using-ansbile-to-launch-a-long-running-process-on-a-remote-host)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 6, 2013, 9:44pm UTC](https://forum.ansible.com/t/using-ansbile-to-launch-a-long-running-process-on-a-remote-host/13617/2 "2013-10-06T21:44:38Z")

</div>

FYI – There wouldn’t be a reason to use async with nohup as async is already daemonizing.
