running a command & remotely

24 views
Skip to first unread message

Abhijit Chakraborty

unread,
Mar 20, 2018, 9:10:17 AM3/20/18
to ansible...@googlegroups.com
Hi all,
              I am running a command using the command module. This is how it is

- name: start
    command: /opt/eate/bin/script.pl >/dev/null &

Now the problem is , after running the command, its not able to come out and i have to manually abort the playbook to come out of the execution.

How can i handle this so that after trigerring the command successfully  , it exits properly ?

Brian Coca

unread,
Mar 20, 2018, 9:24:15 AM3/20/18
to Ansible Project
use nohup to detach the tty.

In any case, it is not a good way to start backgrounded services, it
is much better to use the init system or some other service control
software on the target.

--
----------
Brian Coca

Mike Klebolt

unread,
Mar 20, 2018, 9:26:51 AM3/20/18
to Ansible Project
Sounds like you may want to use async “fire and forget” by specifying a poll value of 0.

Reply all
Reply to author
Forward
0 new messages