From 00ef2f6285f20ad32193649d34862388e49fdad2 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Sun, 25 Feb 2018 13:40:51 -0800 Subject: [PATCH] Only pass in --allow-root if the user is root. (#1594) --- python/ray/services.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/ray/services.py b/python/ray/services.py index a912f5b9c..ce18e5f4e 100644 --- a/python/ray/services.py +++ b/python/ray/services.py @@ -665,11 +665,14 @@ def start_ui(redis_address, stdout_file=None, stderr_file=None, cleanup=True): # querying the jupyter server. token = binascii.hexlify(os.urandom(24)).decode("ascii") command = ["jupyter", "notebook", "--no-browser", - "--allow-root", "--port={}".format(port), "--NotebookApp.iopub_data_rate_limit=10000000000", "--NotebookApp.open_browser=False", "--NotebookApp.token={}".format(token)] + # If the user is root, add the --allow-root flag. + if os.geteuid() == 0: + command.append("--allow-root") + try: ui_process = subprocess.Popen(command, env=new_env, cwd=new_notebook_directory,