Merge pull request #4384 from ryanpetrello/rsyslog-chmod

properly write rsyslog configuration as 0640
This commit is contained in:
Ryan Petrello 2020-06-08 14:05:18 -04:00 committed by GitHub
commit 99c0a954e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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')