# I want to execute nohup command on remote host using ansible but it didn't work

**URL:** <https://forum.ansible.com/t/i-want-to-execute-nohup-command-on-remote-host-using-ansible-but-it-didnt-work/35996>\
**Category:** Ansible Project\
**Created:** [November 15, 2021, 8:34am UTC](https://forum.ansible.com/t/i-want-to-execute-nohup-command-on-remote-host-using-ansible-but-it-didnt-work/35996 "2021-11-15T08:34:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dip\_Giri](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@Dip\_Giri](https://forum.ansible.com/u/Dip_Giri)\
**Post date:** [November 15, 2021, 8:34am UTC](https://forum.ansible.com/t/i-want-to-execute-nohup-command-on-remote-host-using-ansible-but-it-didnt-work/35996/1 "2021-11-15T08:34:42Z")

</div>



---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [November 15, 2021, 9:32am UTC](https://forum.ansible.com/t/i-want-to-execute-nohup-command-on-remote-host-using-ansible-but-it-didnt-work/35996/2 "2021-11-15T09:32:29Z")

</div>

I guess the error message you got would be helpful in order to troubleshoot your problem

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [November 15, 2021, 9:38am UTC](https://forum.ansible.com/t/i-want-to-execute-nohup-command-on-remote-host-using-ansible-but-it-didnt-work/35996/3 "2021-11-15T09:38:47Z")

</div>

> I guess the error message you got would be helpful in order to troubleshoot your problem

At any rate, nohup is IMHO not the correct way to start an application as a server / daemon. Even if some tutorials on the web say so. There is no control of the running application, so please use some kind of supervisor (e.g.systemd).

On top of that using the shell module is fragile and not recommended unless the command module really doesn't to the trick for you.

Regards

```
          Racke

```
