mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
check_queue_worker_errors: Add support for running unprivileged.
Previously, this script needed access to Django settings, which in turn required access to /etc/zulip/zulip-secrets.conf. Since that isn't world-readable, this meant that this couldn't run as an unprivileged `nagios` user. Fix that by just hardcoding the appropriate path under /var/log/.
This commit is contained in:
@@ -7,13 +7,9 @@ import glob
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append('/home/zulip/deployments/current')
|
||||
import scripts.lib.setup_path_on_import
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
|
||||
from django.conf import settings
|
||||
|
||||
wildcard = os.path.join(settings.QUEUE_ERROR_DIR, '*.errors')
|
||||
# settings.QUEUE_ERROR_DIR; not importing Django so that this can run
|
||||
# as the nagios user.
|
||||
wildcard = os.path.join("/var/log/zulip/queue_error", '*.errors')
|
||||
clean = True
|
||||
for fn in glob.glob(wildcard):
|
||||
print('WARNING: Queue errors logged in %s' % (fn,))
|
||||
|
||||
Reference in New Issue
Block a user