From d1e69fe528abc679556e69a2b89bfd72594a4409 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 19 Oct 2022 14:31:03 -0700 Subject: [PATCH] spec: Fix ownership of the dnf-json rpmmd files dnf-json previously ran as a service, and the /var/cache/osbuild-composer/rpmmd directory and files were owned by root. As a script called from osbuild-composer those directories and files need to be owned by _osbuild-composer:_osbuild-composer, otherwise it will not be able to depsolve after an upgrade from the previous implementation. This can be worked around by removing the /var/cache/osbuild-composer/rpmmd directory and restarting the service or rebooting. Fixes #3079 --- osbuild-composer.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osbuild-composer.spec b/osbuild-composer.spec index 3fa22d3ec..fb1f368d8 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -350,6 +350,12 @@ The dnf-json binary used by osbuild-composer and the workers. %files dnf-json %{_libexecdir}/osbuild-composer/dnf-json +%post dnf-json +# Fix ownership of the rpmmd cache files from previous versions where it was owned by root:root +if [ -e /var/cache/osbuild-composer/rpmmd ]; then + chown -f -R --from root:root _osbuild-composer:_osbuild-composer /var/cache/osbuild-composer/rpmmd +fi + %if %{with tests} || 0%{?rhel} %package tests