public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/nginx] f45: Merge branch 'rawhide' into f45
@ 2026-11-26 3:54 Felix Kaechele
0 siblings, 0 replies; 3+ messages in thread
From: Felix Kaechele @ 2026-11-26 3:54 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/nginx
Branch : f45
Commit : b1ae56ecdcee1b73b3730ebddcdc1af472b2fa51
Author : Felix Kaechele <felix@kaechele.ca>
Date : 2026-11-25T22:53:00-05:00
Stats : +119/-17 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/nginx/c/b1ae56ecdcee1b73b3730ebddcdc1af472b2fa51?branch=f45
Log:
Merge branch 'rawhide' into f45
---
diff --git a/nginx-upgrade b/nginx-upgrade
index 8bf987a..fa698bc 100755
--- a/nginx-upgrade
+++ b/nginx-upgrade
@@ -6,22 +6,103 @@
# master process of each instance, then gracefully stopping the old master.
# This allows for zero-downtime upgrades of nginx.
-# Last updated: 2026-03-08
+# Last updated: 2026-11-24
+# Seconds to wait for the old master to rename its PID file, for the old
+# master to exit and for systemd to follow the new master.
TIMEOUT=10
+# Seconds to wait for the new master to parse its configuration and write its
+# PID file. Failures are detected early, so this only bounds a slow start
+# (e.g. resolving upstream hostnames). Matches systemd's default
+# TimeoutStartSec.
+START_TIMEOUT=90
+
+err() {
+ # Errors go to stderr and to the journal: the RPM file trigger discards
+ # stdout, and a failed upgrade leaves the old binary running.
+ echo "ERROR: $*" >&2
+ echo "$*" | systemd-cat -t nginx-upgrade -p err 2>/dev/null
+}
+
+valid_pid() {
+ # usage: valid_pid <pid> <cgroup>
+ # PID file contents are not trusted: only accept a PID that belongs to
+ # the unit's cgroup, as systemd does for PID files not owned by root.
+ local pid=$1 cgroup=$2
+ [[ $pid =~ ^[0-9]+$ ]] && (( pid > 1 )) &&
+ grep -qxF "0::$cgroup" "/proc/$pid/cgroup" 2>/dev/null
+}
wait_for_file() {
# usage: wait_for_file <present|absent> <file> <label>
local mode=$1 file=$2 label=$3
local i
- for ((i=0; i<TIMEOUT; i++)); do
+ # Poll often: if the new master fails quickly, the old master renames
+ # .oldbin back to the PID file and a slow poll would never see it.
+ for ((i=0; i<TIMEOUT*10; i++)); do
[[ $mode == present && -f $file ]] && return 0
[[ $mode == absent && ! -f $file ]] && return 0
- sleep 1
+ sleep 0.1
+ done
+
+ err "$label - file never ${mode}ed: $file"
+ return 1
+}
+
+wait_for_new_master() {
+ # usage: wait_for_new_master <pid-file> <old-pid-file> <old-pid> <cgroup> <label>
+ # Prints the new master's PID on success.
+ #
+ # The old master renames its PID file to .oldbin before it executes the
+ # new binary, but the new master only writes its PID file after it has
+ # parsed its configuration. The old master must not be stopped before
+ # that: systemd (Type=forking) would find no PID to follow, consider the
+ # unit stopped and kill the new master (rhbz#2582004).
+ local file=$1 old_file=$2 old_pid=$3 cgroup=$4 label=$5
+ local i pid
+
+ for ((i=0; i<START_TIMEOUT*10; i++)); do
+ pid=
+ { read -r pid < "$file"; } 2>/dev/null
+ if [[ $pid != "$old_pid" ]] && valid_pid "$pid" "$cgroup"; then
+ echo "$pid"
+ return 0
+ fi
+ # If the new master exits (e.g. invalid configuration), the old
+ # master renames .oldbin back to the PID file. It is also removed
+ # if the old master itself exits.
+ if [[ ! -f $old_file ]]; then
+ if kill -0 "$old_pid" 2>/dev/null; then
+ err "$label - upgrade aborted: the new master exited, the old master ($old_pid) keeps running the old binary. Check the configuration and restart the service."
+ else
+ err "$label - upgrade aborted: the old master ($old_pid) exited."
+ fi
+ return 1
+ fi
+ sleep 0.1
+ done
+
+ err "$label - upgrade aborted: no new master PID in $file after ${START_TIMEOUT}s, the old master ($old_pid) keeps running the old binary. Restart the service."
+ return 1
+}
+
+wait_for_main_pid() {
+ # usage: wait_for_main_pid <service-unit> <pid> <label>
+ # Check that systemd follows the new master once the old one is gone.
+ local unit=$1 pid=$2 label=$3
+ local i
+
+ for ((i=0; i<TIMEOUT*10; i++)); do
+ if ! /bin/systemctl is-active -q "$unit"; then
+ err "$label - $unit is no longer active after the upgrade."
+ return 1
+ fi
+ [[ $(/bin/systemctl show -p MainPID --value "$unit") == "$pid" ]] && return 0
+ sleep 0.1
done
- echo "ERROR: $label - file never ${mode}ed: $file" >&2
+ err "$label - systemd does not track the new master ($pid) as the main process of $unit."
return 1
}
@@ -29,23 +110,38 @@ upgrade_instance() {
# usage: upgrade_instance <service-unit> <pid-file>
local unit="$1" pid_file="$2"
local old_pid_file="${pid_file}.oldbin"
+ local old_pid new_pid cgroup
if [ ! -f "$pid_file" ]; then
echo "[$unit] No PID file at $pid_file - skipping."
return 0
fi
+ # Take the old master's PID from systemd rather than from a PID file.
+ old_pid=$(/bin/systemctl show -p MainPID --value "$unit")
+ cgroup=$(/bin/systemctl show -p ControlGroup --value "$unit")
+ if [[ -z $cgroup ]] || ! valid_pid "$old_pid" "$cgroup"; then
+ err "[$unit] Could not determine the main PID - skipping."
+ return 1
+ fi
+
echo "[$unit] Starting new master process..."
/bin/systemctl kill --signal=SIGUSR2 --kill-who=main "$unit"
- wait_for_file present "$old_pid_file" "$unit - new master start" || return 1
+ wait_for_file present "$old_pid_file" "[$unit] new master start" || return 1
+
+ new_pid=$(wait_for_new_master "$pid_file" "$old_pid_file" "$old_pid" "$cgroup" "[$unit] new master start") || return 1
- echo "[$unit] New master is up. Gracefully stopping old master..."
- local old_pid
- old_pid=$(cat "$old_pid_file" 2>/dev/null)
+ echo "[$unit] New master ($new_pid) is up. Gracefully stopping old master ($old_pid)..."
+ if ! valid_pid "$old_pid" "$cgroup"; then
+ err "[$unit] Old master ($old_pid) is gone before it could be stopped."
+ return 1
+ fi
/bin/kill -s QUIT "$old_pid" 2>/dev/null
- wait_for_file absent "$old_pid_file" "$unit - old master stop" || return 1
+ wait_for_file absent "$old_pid_file" "[$unit] old master stop" || return 1
+
+ wait_for_main_pid "$unit" "$new_pid" "[$unit] new master takeover" || return 1
echo "[$unit] Done."
return 0
@@ -54,9 +150,11 @@ upgrade_instance() {
overall_rc=0
# Discover every active nginx instance via systemctl
-instances=$(systemctl list-units --type=service --state=running --no-legend "nginx*" |
+# Instance names may contain the characters systemd allows in unit names,
+# including "\" from escaping (e.g. nginx@foo\x2dbar.service).
+instances=$(systemctl list-units --type=service --state=running --no-legend --plain "nginx*" |
awk '{print $1}' |
- grep -E '^nginx(@\w+)?\.service$')
+ grep -E '^nginx(@[-[:alnum:]:_.\\]+)?\.service$')
for unit in $instances; do
pid_file=$(systemctl show "$unit" -p PIDFile --value)
@@ -73,6 +171,8 @@ done
exit $overall_rc
+# Man page source for pod2man (see nginx.spec), never executed.
+# shellcheck disable=SC2317
: <<'POD'
=pod
diff --git a/nginx.spec b/nginx.spec
index e62bee8..a97fea2 100644
--- a/nginx.spec
+++ b/nginx.spec
@@ -38,7 +38,9 @@
# kTLS requires OpenSSL 3.0 (default in F36+ and EL9+, available in EPEL8)
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 9 || 0%{?epel} >= 8
-%global with_ktls 1
+%bcond_without ktls
+%else
+%bcond_with ktls
%endif
# Build against OpenSSL 3 on EL8
@@ -60,7 +62,7 @@
Name: nginx
Epoch: 2
-Version: 1.30.7
+Version: 1.30.8
Release: %autorelease
Summary: A high performance web server and reverse proxy server
@@ -357,7 +359,7 @@ if ! ./configure \
--with-http_xslt_module=dynamic \
--with-mail=dynamic \
--with-mail_ssl_module \
-%if 0%{?with_ktls}
+%if %{with ktls}
--with-openssl-opt=enable-ktls \
%endif
%if %{without engine}
@@ -511,7 +513,7 @@ install -m 644 -p %{SOURCE20} %{buildroot}%{_tmpfilesdir}/nginx.conf
# A reload is not sufficient here: https://blog.nginx.org/blog/nginx-dynamic-modules-how-they-work#upgradeMod
%transfiletriggerin -- %{_sbindir}/nginx %{nginx_moduleconfdir} %{nginx_moduledir}
if [ "${1:-0}" -ge 1 ]; then
- test -f %{_sysconfdir}/nginx/rpm-disable-upgrade || /usr/bin/nginx-upgrade >/dev/null 2>&1 || :
+ test -f %{_sysconfdir}/nginx/rpm-disable-upgrade || /usr/bin/nginx-upgrade >/dev/null || :
fi
diff --git a/sources b/sources
index 5680054..a7e6a4a 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (nginx-1.30.7.tar.gz) = c88979d6c4da0942110b2b78a5d1a4c62a3f1d943ec0a430f17df8f5d23c32620af44dc53569aac4f4fdd76a7a019dc97d7f994b87203ec35eafc9af8bc78555
-SHA512 (nginx-1.30.7.tar.gz.asc) = 537b55d5dfa3197d127dbe25866e4ea761ea6fbf715b1c4efbc21522e6e1cd2ecf2896419fbd35a4d15a6653ed7dec434b92a39cff1582b16f69559856a3b948
+SHA512 (nginx-1.30.8.tar.gz) = d5650b0aeb8a9d2d1f5dc3e830a63c51c9777c4aabd22d447bb69fffb6d8cbe2cbbef5b9e4e6650d8ea91601dc394f117bbc05e9eb5f84863a1e9afbf17d4732
+SHA512 (nginx-1.30.8.tar.gz.asc) = e617688b560df14df47514e83f4083454d92e5465f381830a01378bcdb76d94d6080597cbbfd5a06f94d05bfbaf973a0218b800bd72ed4207b892e4ff4542415
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [rpms/nginx] f45: Merge branch 'rawhide' into f45
@ 2026-11-20 13:55 Felix Kaechele
0 siblings, 0 replies; 3+ messages in thread
From: Felix Kaechele @ 2026-11-20 13:55 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/nginx
Branch : f45
Commit : d7c1e3bd240c54abaa81d4a7ef8daa53efb02c35
Author : Felix Kaechele <felix@kaechele.ca>
Date : 2026-11-20T08:54:34-05:00
Stats : +4/-4 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/nginx/c/d7c1e3bd240c54abaa81d4a7ef8daa53efb02c35?branch=f45
Log:
Merge branch 'rawhide' into f45
---
diff --git a/nginx.spec b/nginx.spec
index ee738b7..e62bee8 100644
--- a/nginx.spec
+++ b/nginx.spec
@@ -60,7 +60,7 @@
Name: nginx
Epoch: 2
-Version: 1.30.6
+Version: 1.30.7
Release: %autorelease
Summary: A high performance web server and reverse proxy server
@@ -510,7 +510,7 @@ install -m 644 -p %{SOURCE20} %{buildroot}%{_tmpfilesdir}/nginx.conf
# Request zero-downtime upgrade upon installation of a new nginx binary or modules
# A reload is not sufficient here: https://blog.nginx.org/blog/nginx-dynamic-modules-how-they-work#upgradeMod
%transfiletriggerin -- %{_sbindir}/nginx %{nginx_moduleconfdir} %{nginx_moduledir}
-if [ $1 -ge 1 ]; then
+if [ "${1:-0}" -ge 1 ]; then
test -f %{_sysconfdir}/nginx/rpm-disable-upgrade || /usr/bin/nginx-upgrade >/dev/null 2>&1 || :
fi
diff --git a/sources b/sources
index 31f845c..5680054 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (nginx-1.30.6.tar.gz) = 1b04fcb5a7ee3df573b1a0d792cf1f1cfc02d30d03592f2f04b2b2842d9f42364957f4420e53af380b9fffd5eb4a3a5c11f6d71643168db25baeea748cf94fa2
-SHA512 (nginx-1.30.6.tar.gz.asc) = b2e91921ae7093780f92089b11b3c2d722dd78130da0f17ed645a5c8d799ec10bc4e469f63a55c62e6e5f8a1e74624e26ae1a11abcdd1dfb7825a4f7c71ac7f7
+SHA512 (nginx-1.30.7.tar.gz) = c88979d6c4da0942110b2b78a5d1a4c62a3f1d943ec0a430f17df8f5d23c32620af44dc53569aac4f4fdd76a7a019dc97d7f994b87203ec35eafc9af8bc78555
+SHA512 (nginx-1.30.7.tar.gz.asc) = 537b55d5dfa3197d127dbe25866e4ea761ea6fbf715b1c4efbc21522e6e1cd2ecf2896419fbd35a4d15a6653ed7dec434b92a39cff1582b16f69559856a3b948
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [rpms/nginx] f45: Merge branch 'rawhide' into f45
@ 2026-10-14 22:27 Felix Kaechele
0 siblings, 0 replies; 3+ messages in thread
From: Felix Kaechele @ 2026-10-14 22:27 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/nginx
Branch : f45
Commit : 6ebadb853abcd63dcd144ee6068757317ac0639c
Author : Felix Kaechele <felix@kaechele.ca>
Date : 2026-10-14T18:13:49-04:00
Stats : +11/-3 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/nginx/c/6ebadb853abcd63dcd144ee6068757317ac0639c?branch=f45
Log:
Merge branch 'rawhide' into f45
---
diff --git a/nginx.spec b/nginx.spec
index 8fd716a..ee738b7 100644
--- a/nginx.spec
+++ b/nginx.spec
@@ -60,7 +60,7 @@
Name: nginx
Epoch: 2
-Version: 1.30.5
+Version: 1.30.6
Release: %autorelease
Summary: A high performance web server and reverse proxy server
@@ -108,7 +108,11 @@ Patch4: 0005-Compile-perl-module-with-O2.patch
BuildRequires: make
BuildRequires: gcc
+%if 0%{?fedora} > 42
+BuildRequires: openpgpverify
+%else
BuildRequires: gnupg2
+%endif
%if 0%{?with_gperftools}
BuildRequires: gperftools-devel
%endif
@@ -272,7 +276,11 @@ BuildRequires: zlib-devel
%prep
# Combine all keys from upstream into one file
cat %{S:3} %{S:4} %{S:5} %{S:6} > %{_builddir}/%{name}.gpg
+%if 0%{?fedora} > 42
+%{openpgpverify} --keyring='%{_builddir}/%{name}.gpg' --signature='%{SOURCE1}' --data='%{SOURCE0}'
+%else
%{gpgverify} --keyring='%{_builddir}/%{name}.gpg' --signature='%{SOURCE1}' --data='%{SOURCE0}'
+%endif
%autosetup -p1
cp %{SOURCE200} %{SOURCE10} %{SOURCE12} %{SOURCE18} %{SOURCE220} .
diff --git a/sources b/sources
index 52f45ab..31f845c 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (nginx-1.30.5.tar.gz) = 0e36c27b1a2c3c7f38b73990cef615c59f300ef1bd473a5ed23d5f89ff4e8cd51ca63754430a5dfe4fdaf48ed9eb64a3d74b0bf9a80226f700f99d1d2fa9000d
-SHA512 (nginx-1.30.5.tar.gz.asc) = 3a7713c6ae026e13c7d514ea01393bdc745759130bc5409d9e00ce3bc5dfa61e5d41bf620478b78001c9aa4dc3b9e0eaac946a3f96f8c8b3249548ba4129c9d4
+SHA512 (nginx-1.30.6.tar.gz) = 1b04fcb5a7ee3df573b1a0d792cf1f1cfc02d30d03592f2f04b2b2842d9f42364957f4420e53af380b9fffd5eb4a3a5c11f6d71643168db25baeea748cf94fa2
+SHA512 (nginx-1.30.6.tar.gz.asc) = b2e91921ae7093780f92089b11b3c2d722dd78130da0f17ed645a5c8d799ec10bc4e469f63a55c62e6e5f8a1e74624e26ae1a11abcdd1dfb7825a4f7c71ac7f7
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-26 3:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26 3:54 [rpms/nginx] f45: Merge branch 'rawhide' into f45 Felix Kaechele
-- strict thread matches above, loose matches on Subject: below --
2026-11-20 13:55 Felix Kaechele
2026-10-14 22:27 Felix Kaechele
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox