This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git


The following commit(s) were added to refs/heads/master by this push:
     new bc99dab  PHOENIX-6162 Apply PHOENIX-5594 to the phoenix-queryserver 
repo
bc99dab is described below

commit bc99dab65b43c5955d9a890eeeb07631aa90e53e
Author: Istvan Toth <[email protected]>
AuthorDate: Mon Sep 28 19:15:10 2020 +0200

    PHOENIX-6162 Apply PHOENIX-5594 to the phoenix-queryserver repo
---
 bin/queryserver.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bin/queryserver.py b/bin/queryserver.py
index 18b69d8..19e0109 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -149,6 +149,10 @@ if command == 'start':
         sys.stderr.write("daemon mode not supported on this 
platform{}".format(os.linesep))
         sys.exit(-1)
 
+    # get the current umask for the sub process
+    current_umask = os.umask(0)
+    os.umask(current_umask)
+
     # run in the background
     d = os.path.dirname(out_file_path)
     if not os.path.exists(d):
@@ -172,8 +176,12 @@ if command == 'start':
                 sys.exit(0)
             signal.signal(signal.SIGTERM, handler)
 
+            def initsubproc():
+                # set the parent's umask
+                os.umask(current_umask)
+
             print('%s launching %s' % (datetime.datetime.now(), cmd))
-            child = subprocess.Popen(cmd.split())
+            child = subprocess.Popen(cmd.split(), preexec_fn=initsubproc)
             sys.exit(child.wait())
 
 elif command == 'stop':

Reply via email to