Merge pull request #30 from yangzhaofeng/patch-1

subprocess should be run when this if statement is true
This commit is contained in:
simonmicro 2021-11-01 11:03:58 +01:00 committed by GitHub
commit 50f4778dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,8 +32,10 @@ def change_uid_grp():
new_uid = int(os.getenv('UID', str(uid)))
os.chown("/home/py-kms", new_uid, new_gid)
os.chown("/usr/bin/start.py", new_uid, new_gid)
if os.path.isfile(dbPath): os.chown(dbPath, new_uid, new_gid)
loggersrv.debug("%s" %str(subprocess.check_output("ls -al " + dbPath, shell=True)))
if os.path.isfile(dbPath):
os.chown(dbPath, new_uid, new_gid)
loggersrv.debug("%s" %str(subprocess.check_output("ls -al " + dbPath, shell=True)))
if gid != new_gid:
loggersrv.info("Setting gid to '%s'." % str(new_gid))
os.setgid(gid)