From fa88cb5375c753c538a61bb79eb18d2cca554609 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 14 Feb 2019 09:10:24 +0100 Subject: [PATCH] - rel 3; when nginx is stuck and has oldbin and current bin for hours/days then log rotation only tells current binary to reopen logs leaving old one logging to old files. Tell old binary, too to reopen logs. --- nginx.init | 7 +++++++ nginx.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nginx.init b/nginx.init index 5ac987b..f209fc0 100755 --- a/nginx.init +++ b/nginx.init @@ -152,6 +152,13 @@ upgrade() { # Tell nginx to reopen logs # http://nginx.org/en/docs/control.html#logs reopen_logs() { + local oldbin_pidfile="${pidfile}.oldbin" + + if [ -f $oldbin_pidfile ]; then + show "Reopening $svname (oldbin) logs" + killproc -p $oldbin_pidfile $prog -USR1 + fi + show "Reopening $svname logs" killproc -p $pidfile $prog -USR1 } diff --git a/nginx.spec b/nginx.spec index ccf0ff7..a43813c 100644 --- a/nginx.spec +++ b/nginx.spec @@ -42,7 +42,7 @@ Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności # - mainline: production quality but API can change Name: nginx Version: 1.15.8 -Release: 2 +Release: 3 License: BSD-like Group: Networking/Daemons/HTTP Source0: http://nginx.org/download/%{name}-%{version}.tar.gz -- 2.44.0