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

244 views
Skip to first unread message

Dip Giri

unread,
Nov 15, 2021, 3:34:42 AM11/15/21
to Ansible Project
---

- name: Application setup
  hosts: aws
  gather_facts: no
  tasks:

    
    - name: Start application
      shell: nohup mvn spring-boot:run -Drun.jvmArguments="-Xmx1024m" &
      args:
        chdir: /home/dipak

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

dulh...@mailbox.org

unread,
Nov 15, 2021, 4:32:53 AM11/15/21
to ansible...@googlegroups.com

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

--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/77f328ac-d41b-44b5-a7ff-3f85f89fbe54n%40googlegroups.com.

Stefan Hornburg (Racke)

unread,
Nov 15, 2021, 4:38:30 AM11/15/21
to ansible...@googlegroups.com
On 15/11/2021 10:32, dulhaver via Ansible Project wrote:
>
> 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


>
>> On 11/15/2021 9:34 AM Dip Giri <dipakgir...@gmail.com> wrote:
>>
>>
>> ---
>>
>> - name: Application setup
>>   hosts: aws
>>   gather_facts: no
>>   tasks:
>>
>>     - name: Start application
>>       shell: nohup mvn spring-boot:run -Drun.jvmArguments="-Xmx1024m" &
>>       args:
>>         chdir: /home/dipak
>>
>> *I want to execute nohup command on remote host using ansible but it didn't work *
>>
>>
>> --
>> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/77f328ac-d41b-44b5-a7ff-3f85f89fbe54n%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/77f328ac-d41b-44b5-a7ff-3f85f89fbe54n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2021256539.3416.1636968749678%40office.mailbox.org <https://groups.google.com/d/msgid/ansible-project/2021256539.3416.1636968749678%40office.mailbox.org?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.


OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages