Virtual Me2Me: Redirect stdin of Xsession to /dev/null.

This fixes the problem of the Me2Me process being stopped when running as a
shell background job.

BUG=106935
TEST=Follow repro steps

Review URL: http://codereview.chromium.org/8899011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114238 0039d316-1c4b-4281-b951-d872f2087c98
parent 8e1f93e8
...@@ -258,7 +258,13 @@ class Desktop: ...@@ -258,7 +258,13 @@ class Desktop:
def launch_x_session(self): def launch_x_session(self):
# Start desktop session # Start desktop session
# The /dev/null input redirection is necessary to prevent Xsession from
# reading from stdin. If this code runs as a shell background job in a
# terminal, any reading from stdin causes the job to be suspended.
# Daemonization would solve this problem by separating the process from the
# controlling terminal.
session_proc = subprocess.Popen("/etc/X11/Xsession", session_proc = subprocess.Popen("/etc/X11/Xsession",
stdin=open("/dev/null", "r"),
cwd=os.environ["HOME"], cwd=os.environ["HOME"],
env=self.child_env) env=self.child_env)
if not session_proc.pid: if not session_proc.pid:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment