From 0713dec02cc5504054fa19ac4caba8edfe9df57c Mon Sep 17 00:00:00 2001 From: Nicolas Setton Date: Mon, 9 Jul 2018 15:41:23 -0400 Subject: [PATCH] Add a safety net needed when running on nginx --- compile_server/app/safe_run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compile_server/app/safe_run.py b/compile_server/app/safe_run.py index 6165680..2df74b3 100644 --- a/compile_server/app/safe_run.py +++ b/compile_server/app/safe_run.py @@ -57,4 +57,9 @@ if __name__ == '__main__': # Do not perform any sanity checking on args - this is not meant to # be launched interactively main = sys.argv[1] + + # lxc commands require a HOME - but this might not be set by nginx: + # do this here in this case + if "HOME" not in os.environ: + os.environ["HOME"] = "/home/compile_server" safe_run(main)