# log files not getting generated from the tool with async:\<some higher value\> poll:0

**URL:** <https://forum.ansible.com/t/log-files-not-getting-generated-from-the-tool-with-async-some-higher-value-poll-0/21499>\
**Category:** Ansible Project\
**Created:** [May 19, 2016, 11:39pm UTC](https://forum.ansible.com/t/log-files-not-getting-generated-from-the-tool-with-async-some-higher-value-poll-0/21499 "2016-05-19T23:39:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aprameya\_NDS](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Aprameya\_NDS](https://forum.ansible.com/u/Aprameya_NDS)\
**Post date:** [May 19, 2016, 11:39pm UTC](https://forum.ansible.com/t/log-files-not-getting-generated-from-the-tool-with-async-some-higher-value-poll-0/21499/1 "2016-05-19T23:39:12Z")

</div>

Hi,  
I have a scenario where in i am running a traffic tool which runs infinitely.  
So to unblock from Ansible point of view i run it asynchronously by defining async:0 and poll:0

But the tool is not able to generate any log files.

When i kill the running task on the host i see the log file contents in the JID file that gets created by the async\_wrapper in the “.ansible\_async” folder:

pwd  
/root/.ansible\_async  
888194576255.30295

The same tool when run with predefined time and triggered synchronously generates log files created by the tool.

My query is that is it something to do with async\_wrapper creating some virtual env kind of and does not show the log files created by the tool until that task completes or is there a way to  
get back the log files created by the tool?

Regards  
Aprameya

---

<div class="post-metadata">

**Author:** ![Aprameya\_NDS](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Aprameya\_NDS](https://forum.ansible.com/u/Aprameya_NDS)\
**Post date:** [May 20, 2016, 12:21am UTC](https://forum.ansible.com/t/log-files-not-getting-generated-from-the-tool-with-async-some-higher-value-poll-0/21499/2 "2016-05-20T00:21:46Z")

</div>

> Looks like the async\_wrapper always changes its directory to / while daemenoising:

Is there a way to override this through some options?

def daemonize\_self():

# daemonizing code: [ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.](http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66012)

try:  
pid = os.fork()  
if pid \> 0:

# exit first parent

sys.exit(0)  
except OSError, e:  
print \>\>sys.stderr, “fork #1 failed: %d (%s)” % (e.errno, e.strerror)  
sys.exit(1)

# decouple from parent environment

os.chdir(“/”)  
os.setsid()  
os.umask(022)
