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 77ce83fe22
)
This commit is contained in:
parent
15695ea3bc
commit
f0bd79d41b
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue