From 2025f733a9685f6ffe7dcab137ea2a13a30c4c6d Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Sun, 28 May 2017 17:11:41 -0700 Subject: [PATCH] Add a mailman user and setup loggers. --- web/assets/run.sh | 6 ++++++ web/mailman-web/uwsgi.ini | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/web/assets/run.sh b/web/assets/run.sh index dafb162..d69a8da 100755 --- a/web/assets/run.sh +++ b/web/assets/run.sh @@ -89,4 +89,10 @@ python manage.py collectstatic --noinput # this command will upgrade the database. python manage.py migrate +# Create a mailman user with the specific UID and GID and do not create home +# directory for it. Also chown the logs directory to write the files. +useradd -M -U -u 1000 mailman +chown mailman:mailman /opt/mailman-web-data -R + + exec $@ diff --git a/web/mailman-web/uwsgi.ini b/web/mailman-web/uwsgi.ini index c757d1c..0b488bc 100644 --- a/web/mailman-web/uwsgi.ini +++ b/web/mailman-web/uwsgi.ini @@ -17,10 +17,6 @@ threads = 2 uid = 1000 gid = 1000 -# Setup the log files. -req-log = file:/opt/mailman-web-data/uwsgi.log -error-log = file:/opt/mailman-web-data/uwsgi-error.log - # Setup the django_q related worker processes. attach-daemon = ./manage.py qcluster @@ -30,3 +26,17 @@ cron2 = hour=1,unique=1 ./manage.py runjobs hourly cron2 = day=1,unique=1 ./manage.py runjobs monthly cron2 = week=1,unique=1 ./manage.py runjobs weekly cron2 = month=1,unique=1 ./manage.py runjobs yearly + +# Setup the request log. +req-logger = file:/opt/mailman-web-data/logs/uwsgi.log + +# Log cron seperately. +logger = cron file:/opt/mailman-web-data/logs/uwsgi-cron.log +log-route = cron uwsgi-cron + +# Log qcluster commands seperately. +logger = qcluster file:/opt/mailman-web-data/logs/uwsgi-qcluster.log +log-route = qcluster uwsgi-daemons + +# Last log and it logs the rest of the stuff. +logger = file:/opt/mailman-web-data/logs/uwsgi-error.log