Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Switch logrotate to be in charge of tornado logs.

Alex Vandivere6c64e78e61c
diff --git a/puppet/zulip/templates/logrotate/zulip.template.erb b/puppet/zulip/templates/logrotate/zulip.template.erb
index 9e157be689c..df859bfaacc 100644
--- a/puppet/zulip/templates/logrotate/zulip.template.erb
+++ b/puppet/zulip/templates/logrotate/zulip.template.erb
@@ -1,3 +1,6 @@
+# Logfiles generated by Django understand logrotate's standard
+# "create" functionality, via logging.handlers.WatchedFileHandler
+
/var/log/zulip/analytics.log
/var/log/zulip/auth.log
/var/log/zulip/digest.log
@@ -26,8 +29,6 @@
create 644 zulip zulip
}
-/var/log/zulip/tornado-*.log
-/var/log/zulip/tornado.log
/var/log/zulip/server.log
{
missingok
@@ -38,3 +39,18 @@
notifempty
create 644 zulip zulip
}
+
+# Logfiles generated from supervisor _do not_ understand logrotate,
+# and thus must use copytruncate. They also must not use supervisor's
+# built-in log rotation.
+/var/log/zulip/tornado-*.log
+/var/log/zulip/tornado.log
+{
+ missingok
+ rotate <%= @access_log_retention_days %>
+ daily
+ compress
+ delaycompress
+ notifempty
+ copytruncate
+}
diff --git a/puppet/zulip/templates/supervisor/zulip.conf.template.erb b/puppet/zulip/templates/supervisor/zulip.conf.template.erb
index a9b2af7991e..ad5553ba26c 100644
--- a/puppet/zulip/templates/supervisor/zulip.conf.template.erb
+++ b/puppet/zulip/templates/supervisor/zulip.conf.template.erb
@@ -54,8 +54,8 @@ stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10)
user=zulip ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/zulip/tornado-98%(process_num)02d.log ; stdout log path, NONE for none; default AUTO
-stdout_logfile_maxbytes=100MB ; max # logfile bytes b4 rotation (default 50MB)
-stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
+stdout_logfile_maxbytes=0 ; Rotated by logrotate
+stdout_logfile_backups=0
directory=/home/zulip/deployments/current/
numprocs=<%= @tornado_ports.length %>
<% else -%>
@@ -70,8 +70,8 @@ stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10)
user=zulip ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/var/log/zulip/tornado.log ; stdout log path, NONE for none; default AUTO
-stdout_logfile_maxbytes=100MB ; max # logfile bytes b4 rotation (default 50MB)
-stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
+stdout_logfile_maxbytes=0 ; Rotated by logrotate
+stdout_logfile_backups=0
directory=/home/zulip/deployments/current/
<% end -%>