mirror of
https://github.com/ansible/awx.git
synced 2026-02-24 14:36:00 -03:30
Merge pull request #4384 from ryanpetrello/rsyslog-chmod
properly write rsyslog configuration as 0640
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib.parse as urlparse
|
import urllib.parse as urlparse
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -117,6 +117,7 @@ def reconfigure_rsyslog():
|
|||||||
with tempfile.TemporaryDirectory(prefix='rsyslog-conf-') as temp_dir:
|
with tempfile.TemporaryDirectory(prefix='rsyslog-conf-') as temp_dir:
|
||||||
path = temp_dir + '/rsyslog.conf.temp'
|
path = temp_dir + '/rsyslog.conf.temp'
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
|
os.chmod(path, 0o640)
|
||||||
f.write(tmpl + '\n')
|
f.write(tmpl + '\n')
|
||||||
shutil.move(path, '/var/lib/awx/rsyslog/rsyslog.conf')
|
shutil.move(path, '/var/lib/awx/rsyslog/rsyslog.conf')
|
||||||
supervisor_service_command(command='restart', service='awx-rsyslogd')
|
supervisor_service_command(command='restart', service='awx-rsyslogd')
|
||||||
|
|||||||
Reference in New Issue
Block a user