subprocess should be run when this if statement is true

This commit is contained in:
Zhaofeng Yang 2021-11-01 12:32:38 +08:00
parent deddf0c01c
commit ba25df0b1c
No known key found for this signature in database
GPG key ID: 117FA0323121BD88

View file

@ -32,8 +32,9 @@ 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)