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.
pull/22966/head
Peter Sprygada 8 years ago committed by GitHub
parent 9c9ef0d6ab
commit 77ce83fe22

@ -63,7 +63,7 @@ def do_fork():
if pid > 0: if pid > 0:
return pid return pid
os.chdir("/") #os.chdir("/")
os.setsid() os.setsid()
os.umask(0) os.umask(0)
@ -119,6 +119,7 @@ class Server():
self.play_context = play_context self.play_context = play_context
display.display("starting new persistent socket with path %s" % path, log_only=True) 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() self._start_time = datetime.datetime.now()

Loading…
Cancel
Save