]> Sergey Matveev's repositories - public-inbox.git/commitdiff
examples: add logrotate sample to show USR1 reopening
authorEric Wong <e@80x24.org>
Fri, 8 Jul 2016 21:12:26 +0000 (21:12 +0000)
committerEric Wong <e@80x24.org>
Fri, 8 Jul 2016 21:15:18 +0000 (21:15 +0000)
Same as nginx :>

MANIFEST
examples/logrotate.conf [new file with mode: 0644]

index 9864bb397a37be59fe8089437f9ec746533354f8..ceb1a9dadf9fc74ed0234eb647397e56be567d7e 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -20,6 +20,7 @@ examples/apache2_perl.conf
 examples/apache2_perl_old.conf
 examples/cgi-webrick.rb
 examples/cgit-commit-filter.lua
+examples/logrotate.conf
 examples/public-inbox-config
 examples/public-inbox-httpd.socket
 examples/public-inbox-httpd@.service
diff --git a/examples/logrotate.conf b/examples/logrotate.conf
new file mode 100644 (file)
index 0000000..4ce0884
--- /dev/null
@@ -0,0 +1,24 @@
+# ==> /etc/logrotate.d/public-inbox <==
+#
+# See the logrotate(8) manpage for more information:
+#    http://linux.die.net/man/8/logrotate
+/var/log/public-inbox/*.log {
+       weekly
+       missingok
+       rotate 52
+       compress
+       delaycompress
+       notifempty
+       sharedscripts
+       dateext
+       # note the lack of the racy "copytruncate" option in this
+       # config.  public-inbox-*d supports the USR1 signal and
+       # we send it as our "lastaction":
+       lastaction
+               # systemd users do not need PID files,
+               # only signal the @1 process since the @2 is short-lived
+               # For systemd users, assuming you use two services
+               systemctl kill -s SIGUSR1 public-inbox-httpd@1.service
+               systemctl kill -s SIGUSR1 public-inbox-nntpd@1.service
+       endscript
+}