You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by an...@apache.org on 2019/11/29 13:12:54 UTC
[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-5594 Different
permission of phoenix-*-queryserver.log from umask (Toshihiro Suzuki)
This is an automated email from the ASF dual-hosted git repository.
ankit pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
new 786aded PHOENIX-5594 Different permission of phoenix-*-queryserver.log from umask (Toshihiro Suzuki)
786aded is described below
commit 786aded5776807d4d092fd315db021f1d6052327
Author: Toshihiro Suzuki <br...@gmail.com>
AuthorDate: Fri Nov 29 22:05:04 2019 +0900
PHOENIX-5594 Different permission of phoenix-*-queryserver.log from umask (Toshihiro Suzuki)
---
bin/queryserver.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/bin/queryserver.py b/bin/queryserver.py
index 0c07b3b..26d096c 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -148,6 +148,10 @@ if command == 'start':
print >> sys.stderr, "daemon mode not supported on this platform"
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):
@@ -171,8 +175,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':