Merge pull request #7418 from ryanpetrello/rsyslog-file-perm

properly write rsyslog configuration as 0640

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-06-23 16:01:26 +00:00
committed by GitHub

View File

@@ -1,6 +1,6 @@
import os
import shutil
import tempfile
import tempfile
import urllib.parse as urlparse
from django.conf import settings
@@ -117,6 +117,7 @@ def reconfigure_rsyslog():
with tempfile.TemporaryDirectory(prefix='rsyslog-conf-') as temp_dir:
path = temp_dir + '/rsyslog.conf.temp'
with open(path, 'w') as f:
os.chmod(path, 0o640)
f.write(tmpl + '\n')
shutil.move(path, '/var/lib/awx/rsyslog/rsyslog.conf')
supervisor_service_command(command='restart', service='awx-rsyslogd')