commit:b2887fbe816538781c82b1e64d2804e0352376fa
author:Chip Black
committer:Chip Black
date:Mon Mar 3 12:14:43 2025 -0600
parents:528f7212ce38031dcc5726acb04ba51192da989a
Rotate nginx logs
diff --git a/configure-nginx-host.sh b/configure-nginx-host.sh
line changes: +3/-0
index d80fe57..ef410f7
--- a/configure-nginx-host.sh
+++ b/configure-nginx-host.sh
@@ -8,3 +8,6 @@ load_opts "$1"
 sed -e "s/\$MASTODON_ADDR/$MASTODON_ADDR/" \
     -e "s/\$HOSTNAME/$HOSTNAME/" \
        nginx/server.conf > /usr/local/etc/nginx/sites-available/$HOSTNAME
+
+mkdir -p /usr/local/etc/newsyslog.conf.d
+cp nginx/newsyslog.conf /usr/local/etc/newsyslog.conf.d/nginx.conf

diff --git a/mastodon/newsyslog.conf b/mastodon/newsyslog.conf
line changes: +5/-3
index 54f54b1..74868be
--- a/mastodon/newsyslog.conf
+++ b/mastodon/newsyslog.conf
@@ -1,3 +1,5 @@
-/var/log/mastodon/streaming.log root:wheel 440 90 * @T06 Xp /var/run/mastodon-streaming.pid
-/var/log/mastodon/sidekiq.log root:wheel 440 90 * @T06 Xp /var/run/mastodon-sidekiq.pid
-/var/log/mastodon/web.log root:wheel 440 90 * @T06 Xp /var/run/mastodon-web.pid
+# logfilename                    [owner:group]  mode  count  size  when  flags  [/pid_file] [sig_num]
+/var/log/mastodon/streaming.log  root:wheel     440      90     *  @T06  Xp     /var/run/mastodon-streaming.pid
+/var/log/mastodon/sidekiq.log    root:wheel     440      90     *  @T06  Xp     /var/run/mastodon-sidekiq.pid
+/var/log/mastodon/web.log        root:wheel     440      90     *  @T06  Xp     /var/run/mastodon-web.pid
+/var/log/nginx/*.log                            440       1     *  @T00  XCG    /var/run/nginx.pid 30

diff --git a/nginx/newsyslog.conf b/nginx/newsyslog.conf
line changes: +2/-0
index 0000000..80e507c
--- /dev/null
+++ b/nginx/newsyslog.conf
@@ -0,0 +1,2 @@
+# logfilename         [owner:group]  mode  count  size  when  flags  [/pid_file] [sig_num]
+/var/log/nginx/*.log                 644   30     *     @T00  XCGp   /var/run/nginx.pid 30