Skip to content

Commit

Permalink
Merge pull request ansible#4384 from ryanpetrello/rsyslog-chmod
Browse files Browse the repository at this point in the history
properly write rsyslog configuration as 0640
  • Loading branch information
ryanpetrello authored Jun 8, 2020
2 parents 0a07353 + c53e5bd commit 99c0a95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion awx/main/utils/external_logging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import shutil
import tempfile
import tempfile
import urllib.parse as urlparse

from django.conf import settings
Expand Down Expand Up @@ -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')

0 comments on commit 99c0a95

Please sign in to comment.