Skip to content

Commit

Permalink
#1114: save cwd and use it when execing commands
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@11885 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 8, 2016
1 parent cc00309 commit e9e4554
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ def kill_dbus():
info = "xpra"

try:
app.exec_cwd = cwd
app.init(opts)
except Exception as e:
log.error("Error: cannot start the %s server", info, exc_info=True)
Expand Down
3 changes: 2 additions & 1 deletion src/xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def __init__(self):
self.start_new_commands = False
self.remote_logging = False
self.env = []
self.exec_cwd = None
self.exec_wrapper = None
self.child_reaper = getChildReaper(self.reaper_exit)
self.send_pings = False
Expand Down Expand Up @@ -734,7 +735,7 @@ def start_child(self, name, child_cmd, ignore=False, callback=None, use_wrapper=
env = self.get_child_env()
try:
real_cmd = self.get_full_child_command(child_cmd, use_wrapper)
proc = subprocess.Popen(real_cmd, stdin=subprocess.PIPE, env=env, shell=shell, close_fds=True, **kwargs)
proc = subprocess.Popen(real_cmd, stdin=subprocess.PIPE, env=env, shell=shell, cwd=self.exec_cwd, close_fds=True, **kwargs)
self.add_process(proc, name, real_cmd, ignore=ignore, callback=callback)
info = " ".join(real_cmd)
if ignore:
Expand Down

0 comments on commit e9e4554

Please sign in to comment.