From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 To: devel@lists.altlinux.org References: <20191031115808.35705-1-darktemplar@altlinux.org> <20191031125957.GA19388@altlinux.org> From: Aleksei Nikiforov Message-ID: <7d94a565-0723-68ca-717b-f86ef1256356@altlinux.org> Date: Thu, 31 Oct 2019 16:19:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191031125957.GA19388@altlinux.org> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Language: ru Content-Transfer-Encoding: 8bit Subject: Re: [devel] [PATCH for rpm] Add triggers circumvension for packagekit offline update X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 13:19:21 -0000 Archived-At: List-Archive: List-Post: 31.10.2019 15:59, Dmitry V. Levin пишет: > On Thu, Oct 31, 2019 at 02:58:08PM +0300, Aleksei Nikiforov wrote: >> Joint change with Oleg Solovyov (mcpain@) > > Thanks. > > It's not clear from the commit message why one might need to disable > rpmdb --rebuilddb after rpm update. > > Could you elaborate, please? > packagekit offline update is implemented in following way: 1) system is preparing for offline update: all new installed packages are downloaded, etc. 2) system is rebooting into special systemd offline update mode upon user request. 3) in this offline update mode packagekit offline update service is performing system update using packagekit service activated via dbus. 4) Last step of systemd offline update is a reboot request. It must be made by offline update service. And packagekit offline update service does request it. Thus, rpmdb --rebuilddb from rpm scripts would be in race against reboot request. Testing showed that it doesn't work properly in such conditions. In best case, rpmdb --rebuilddb doesn't do anything at all before reboot happens. Instead of hoping to get it work properly in such conditions, disabling it in rpm scripts and calling it right after update but before reboot request from packagekit offline update works fine: http://git.altlinux.org/people/darktemplar/packages/?p=PackageKit.git;a=commitdiff;h=9b34f9657927dc748ec0a7b42cf2f58389a7f60a A bit info about offline updates: https://www.freedesktop.org/software/systemd/man/systemd.offline-updates.html >> --- >> alt/rpm.spec | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/alt/rpm.spec b/alt/rpm.spec >> index 6217493b7..d93e701b1 100644 >> --- a/alt/rpm.spec >> +++ b/alt/rpm.spec >> @@ -385,6 +385,7 @@ ls -A tests/rpmtests.dir 2>/dev/null ||: >> #[ ! -L %%_rpmlibdir/noarch-alt-%%_target_os ] || rm -f %%_rpmlibdir/noarch-alt-%%_target_os ||: >> >> %post >> +if [ ! -f %_localstatedir/PackageKit/disable-rpm-triggers ]; then >> #chgrp %%name %%_localstatedir/%%name/[A-Z]* >> [ -n "$DURING_INSTALL" -o -n "$BTE_INSTALL" ] || >> %_rpmlibdir/pdeath_execute $PPID %_rpmlibdir/postupdate >> @@ -393,6 +394,7 @@ ls -A tests/rpmtests.dir 2>/dev/null ||: >> if set /var/cache/apt/*.bin && [ -f "$1" ]; then >> %_rpmlibdir/pdeath_execute $PPID rm -f "$@" >> fi >> +fi >> : > > If this change is needed, it should rather look this way: > > if [ -f %_localstatedir/PackageKit/disable-rpm-triggers ]; then > exit 0 > fi > > > > _______________________________________________ > Devel mailing list > Devel@lists.altlinux.org > https://lists.altlinux.org/mailman/listinfo/devel >