mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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.
This commit is contained in:
parent
9c9ef0d6ab
commit
77ce83fe22
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue