This commit is contained in:
Alexey Avramov 2020-06-28 15:48:09 +09:00
parent 231c705700
commit 986404d615

View File

@ -3341,15 +3341,18 @@ if separate_log:
pass
except PermissionError:
errprint('ERROR: cannot create {}'.format(log_dir))
if root:
exit(1)
try:
os.chmod(log_dir, mode=0o750)
except FileNotFoundError:
errprint('ERROR: file not found: {}'.format(log_dir))
if root:
exit(1)
except PermissionError:
errprint('ERROR: permission denied: {}'.format(log_dir))
if root:
exit(1)
try:
@ -3359,12 +3362,13 @@ if separate_log:
format="%(asctime)s: %(message)s")
except FileNotFoundError:
errprint('ERROR: file not found: {}'.format(logfile))
if root:
exit(1)
except PermissionError:
errprint('ERROR: permission denied: {}'.format(logfile))
if root:
exit(1)
if separate_log:
logging.info('Starting nohang with the config: {}'.format(config))