* [PATCH 0/2] example updates
@ 2016-07-08 21:16 Eric Wong
2016-07-08 21:16 ` [PATCH 1/2] examples: minimize differences for systemd examples Eric Wong
2016-07-08 21:16 ` [PATCH 2/2] examples: add logrotate sample to show USR1 reopening Eric Wong
0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2016-07-08 21:16 UTC (permalink / raw)
To: meta
Eric Wong (2):
examples: minimize differences for systemd examples
examples: add logrotate sample to show USR1 reopening
MANIFEST | 1 +
examples/logrotate.conf | 24 ++++++++++++++++++++++++
examples/public-inbox-httpd.socket | 2 +-
examples/public-inbox-httpd@.service | 4 +++-
examples/public-inbox-nntpd@.service | 4 ++--
5 files changed, 31 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] examples: minimize differences for systemd examples
2016-07-08 21:16 [PATCH 0/2] example updates Eric Wong
@ 2016-07-08 21:16 ` Eric Wong
2016-07-08 21:16 ` [PATCH 2/2] examples: add logrotate sample to show USR1 reopening Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-07-08 21:16 UTC (permalink / raw)
To: meta
Our nntpd and httpd are similar so configuration differences
should be minimized
---
examples/public-inbox-httpd.socket | 2 +-
examples/public-inbox-httpd@.service | 4 +++-
examples/public-inbox-nntpd@.service | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/examples/public-inbox-httpd.socket b/examples/public-inbox-httpd.socket
index da37aec..1a1ed73 100644
--- a/examples/public-inbox-httpd.socket
+++ b/examples/public-inbox-httpd.socket
@@ -3,7 +3,7 @@
Description = public-inbox-httpd socket
[Socket]
-ListenStream = 127.0.0.1:280
+ListenStream = 80
Service = public-inbox-httpd@1.service
[Install]
diff --git a/examples/public-inbox-httpd@.service b/examples/public-inbox-httpd@.service
index 4efea2a..56117ef 100644
--- a/examples/public-inbox-httpd@.service
+++ b/examples/public-inbox-httpd@.service
@@ -17,7 +17,9 @@ PERL_INLINE_DIRECTORY=/tmp/.pub-inline
LimitNOFILE = 30000
ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
-ExecStart = /usr/local/bin/public-inbox-httpd
+ExecStart = /usr/local/bin/public-inbox-httpd \
+-1 /var/log/public-inbox/httpd.out.log
+StandardError = syslog
Sockets = public-inbox-httpd.socket
KillSignal = SIGQUIT
User = nobody
diff --git a/examples/public-inbox-nntpd@.service b/examples/public-inbox-nntpd@.service
index bdd9734..62202c2 100644
--- a/examples/public-inbox-nntpd@.service
+++ b/examples/public-inbox-nntpd@.service
@@ -18,8 +18,8 @@ PERL_INLINE_DIRECTORY=/tmp/.pub-inline
LimitNOFILE = 30000
ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
ExecStart = /usr/local/bin/public-inbox-nntpd \
--1 /var/log/public-inbox/nntpd.out.log \
--2 /var/log/public-inbox/nntpd.err.log
+-1 /var/log/public-inbox/nntpd.out.log
+StandardError = syslog
Sockets = public-inbox-nntpd.socket
KillSignal = SIGQUIT
User = nobody
--
EW
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] examples: add logrotate sample to show USR1 reopening
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
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-07-08 21:16 UTC (permalink / raw)
To: meta
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-08 21:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] examples: add logrotate sample to show USR1 reopening Eric Wong
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).