From aa513936945d0e30d2b2da3ce3b000e48aa21689 Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Wed, 5 Aug 2026 01:03:43 +0800 Subject: [PATCH] build: install the systemd unit under /usr/lib, drop the template residue nFPM placed minio.service at /lib/systemd/system. On merged-usr EL/Fedora the file lands correctly through the symlink, but the RPM database records /lib/..., so `rpm -qf` disowns it and - more importantly - systemd's %transfiletriggerin watches /usr/lib/systemd/system, so the path recorded as /lib/... never fires the automatic `daemon-reload` on install or removal. Move the unit to the canonical /usr/lib/systemd/system, which both restores that trigger and makes the package own the path it ships. The destination is asserted verbatim in several places, all updated in lockstep so the packaging gate still passes: the six name/payload/sha checks in test-release.yml (rpm/deb/apk) and expected_payload in sign-release-rpms.sh. Verified by building a real deb with the new config: the unit is at ./usr/lib/systemd/system/minio.service. Also drop the `# Built for ${project.name}...` line from minio.service. nFPM expands variables in content src paths, not file bodies, so that pkger-era placeholder was being written verbatim into every installed unit. Not addressed here, deliberately: the package still does not create the minio-user account the unit references. That matches upstream MinIO's own packages (both rely on the documented manual useradd) and is not a fork regression, so it stays a documentation step rather than a scriptlet. Co-authored-by: Claude --- .github/nfpm.yml | 2 +- .github/workflows/test-release.yml | 12 ++++++------ buildscripts/sign-release-rpms.sh | 2 +- minio.service | 2 -- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/nfpm.yml b/.github/nfpm.yml index 706e80185..a19e839ea 100644 --- a/.github/nfpm.yml +++ b/.github/nfpm.yml @@ -21,7 +21,7 @@ contents: owner: root group: root - src: ${NFPM_UNIT} - dst: /lib/systemd/system/minio.service + dst: /usr/lib/systemd/system/minio.service expand: true file_info: mode: 0644 diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 9dd4f4fb5..c48d1bdc5 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -141,7 +141,7 @@ jobs: # package as the binary, and losing it would install a server with # nothing to start it. rpm -qpl "${rpm_file}" | grep -Fx '/usr/local/bin/minio' - rpm -qpl "${rpm_file}" | grep -Fx '/lib/systemd/system/minio.service' + rpm -qpl "${rpm_file}" | grep -Fx '/usr/lib/systemd/system/minio.service' test "$(rpm -qpl "${rpm_file}" | wc -l)" -eq 2 deb_file="minio_${PKG_VERSION}_amd64.deb" @@ -152,7 +152,7 @@ jobs: test "$(dpkg-deb --field "${deb_file}" Homepage)" = "${expected_url}" test "$(dpkg-deb --field "${deb_file}" Description)" = "${expected_description}" dpkg-deb --contents "${deb_file}" | grep -E 'usr/local/bin/minio$' - dpkg-deb --contents "${deb_file}" | grep -E 'lib/systemd/system/minio\.service$' + dpkg-deb --contents "${deb_file}" | grep -E 'usr/lib/systemd/system/minio\.service$' apk_info="$(tar -xOzf "minio_${PKG_VERSION}_x86_64.apk" .PKGINFO)" grep -Fx "pkgver = ${PKG_VERSION}" <<< "${apk_info}" @@ -161,7 +161,7 @@ jobs: grep -Fx "license = ${expected_license}" <<< "${apk_info}" grep -Fx "pkgdesc = ${expected_description}" <<< "${apk_info}" tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'usr/local/bin/minio' - tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'lib/systemd/system/minio.service' + tar -tzf "minio_${PKG_VERSION}_x86_64.apk" | grep -Fx 'usr/lib/systemd/system/minio.service' for arch in amd64 arm64; do if [ "${arch}" = amd64 ]; then @@ -197,11 +197,11 @@ jobs: rpm_sha="$(rpm -qp --queryformat '[%{FILENAMES} %{FILEDIGESTS}\n]' \ "minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/usr/local/bin/minio" { print $2 }')" rpm_service_sha="$(rpm -qp --queryformat '[%{FILENAMES} %{FILEDIGESTS}\n]' \ - "minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/lib/systemd/system/minio.service" { print $2 }')" + "minio-${PKG_VERSION}-1.${rpm_arch}.rpm" | awk '$1 == "/usr/lib/systemd/system/minio.service" { print $2 }')" deb_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./usr/local/bin/minio | sha256sum | awk '{print $1}')" - deb_service_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./lib/systemd/system/minio.service | sha256sum | awk '{print $1}')" + deb_service_sha="$(ar p "minio_${PKG_VERSION}_${deb_arch}.deb" data.tar.gz | tar -xzOf - ./usr/lib/systemd/system/minio.service | sha256sum | awk '{print $1}')" apk_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" usr/local/bin/minio | sha256sum | awk '{print $1}')" - apk_service_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" lib/systemd/system/minio.service | sha256sum | awk '{print $1}')" + apk_service_sha="$(tar -xzOf "minio_${PKG_VERSION}_${apk_arch}.apk" usr/lib/systemd/system/minio.service | sha256sum | awk '{print $1}')" test "${source_sha}" = "${rpm_sha}" test "${source_sha}" = "${deb_sha}" diff --git a/buildscripts/sign-release-rpms.sh b/buildscripts/sign-release-rpms.sh index d062e8470..96dcc5567 100755 --- a/buildscripts/sign-release-rpms.sh +++ b/buildscripts/sign-release-rpms.sh @@ -14,7 +14,7 @@ expected_summary="S3-Interface Libre Object Storage, Community-maintained MinIO expected_description="S3-Interface Libre Object Storage, Community-maintained MinIO server fork." expected_license="AGPL-3.0-or-later" expected_group="Applications/File" -expected_payload="/lib/systemd/system/minio.service +expected_payload="/usr/lib/systemd/system/minio.service /usr/local/bin/minio" repository="${GH_REPO:-pgsty/minio}" container="${DNFUPDATE_CONTAINER:-dnfupdate}" diff --git a/minio.service b/minio.service index 21c5c4854..ec765cc06 100644 --- a/minio.service +++ b/minio.service @@ -39,5 +39,3 @@ SendSIGKILL=no [Install] WantedBy=multi-user.target - -# Built for ${project.name}-${project.version} (${project.name})