From f0bd79d41b9b5100ad60e7a9a7209bb7a24e6089 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sat, 25 Mar 2017 00:19:48 -0400 Subject: [PATCH] fixes ansible-connection working directory (#22964) When ansible-connection forks the process, it changed the working directory to /. This patch will prevent ansible-connection from changing the working directory in the forked process. (cherry picked from commit 77ce83fe22cf4fde6d9179a075337448c67f9715) --- bin/ansible-connection | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ansible-connection b/bin/ansible-connection index 89e1158ef23..da1b4eec52b 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -63,7 +63,7 @@ def do_fork(): if pid > 0: return pid - os.chdir("/") + #os.chdir("/") os.setsid() os.umask(0) @@ -119,6 +119,7 @@ class Server(): self.play_context = play_context display.display("starting new persistent socket with path %s" % path, log_only=True) + display.display('current working directory is %s' % os.getcwd(), log_only=True) self._start_time = datetime.datetime.now()