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

10 views
Skip to first unread message

Aprameya NDS

unread,
May 19, 2016, 7:39:12 PM5/19/16
to Ansible Project
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

Aprameya NDS

unread,
May 19, 2016, 8:21:47 PM5/19/16
to Ansible Project
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: 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)

 
Reply all
Reply to author
Forward
0 new messages