user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/2] examples: add logrotate sample to show USR1 reopening
Date: Fri,  8 Jul 2016 21:16:11 +0000	[thread overview]
Message-ID: <20160708211611.1623-3-e@80x24.org> (raw)
In-Reply-To: <20160708211611.1623-1-e@80x24.org>

Same as nginx :>
---
 MANIFEST                |  1 +
 examples/logrotate.conf | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 examples/logrotate.conf

diff --git a/MANIFEST b/MANIFEST
index 9864bb3..ceb1a9d 100644
--- 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
index 0000000..4ce0884
--- /dev/null
+++ b/examples/logrotate.conf
@@ -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
+}
-- 
EW


      parent reply	other threads:[~2016-07-08 21:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 21:16 [PATCH 0/2] example updates Eric Wong
2016-07-08 21:16 ` [PATCH 1/2] examples: minimize differences for systemd examples Eric Wong
2016-07-08 21:16 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160708211611.1623-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).