Bugzilla – Bug 1212798
systemd %transfiletriggerin scriptlet is not executed when installing postgresql-service
Last modified: 2023-09-21 19:14:57 UTC
postgresql-server package ships /usr/lib/tmpfiles.d/postgresql.conf, which is in charge of creating /run/postgresql directory when postgresql-server is installed. Since systemd switched to transfiletriggers, the tmpfiles stuff shipped by packages are supposed to be automatically initialized by filetriggers or transfiletriggers (depending on the transaction backend used by libzypp). %tmpfiles_create are therefore no more needed. A new version of systemd-rpm-macros with %tmpfiles_create converted into NOP has just been submitted (sr#1094993) and has not yet reached Factory. Hence installing postgresql-server from TW/Factory repositories doesn't show the problem. It appears that when installing postgresql-server rebuilt with %tmpfiles_create macro converted into NOP, the transfiletrigger shipped by systemd are not executed by zypper and hence /run/postgresql directory is missing once the package installation is completed. I noticed that: - postgresql-server has a %posttrans script. If it's removed then the problem disappears. - If the "experimental" libzypp backend is used (ZYPP_SINGLE_RPMTRANS=1) then the problem also disappears. - Installing postgresql-server with rpm doesn't have the problem. To reproduce: ------------ - Make sure to install systemd from Base:System and check that there's really a triggers script installed for tmpfiles: # rpm -q --filetriggers systemd | grep "^transfiletriggerin.*tmpfiles" transfiletriggerin scriptlet (using <lua>) -- /usr/lib/tmpfiles.d - Install the version of postgresql-server built with %tmpfiles_create converted into NOP. You can find such build in the following temporary OBS project: https://build.opensuse.org/project/show/home:fbui:branches:test-rebuild-systemd-macros - /run/postgresql should be missing unless the experimental transaction backend (ZYPP_SINGLE_RPMTRANS=1) is used
That sounds like https://bugzilla.opensuse.org/show_bug.cgi?id=1041742 still being present.
(In reply to Dominique Leuenberger from comment #1) > That sounds like https://bugzilla.opensuse.org/show_bug.cgi?id=1041742 still > being present. I'm not sure. This bug is about %transfiletriggerin not being executed *if* the package being installed has a %posttrans script. Otherwise the %transfiletriggerin script is executed. Currently it's executed at the end of each package installation instead of the end of the transaction due to the design of the current backend transaction.
(In reply to Franck Bui from comment #2) > (In reply to Dominique Leuenberger from comment #1) > > That sounds like https://bugzilla.opensuse.org/show_bug.cgi?id=1041742 still > > being present. > > I'm not sure. > > This bug is about %transfiletriggerin not being executed *if* the package > being installed has a %posttrans script. > > Otherwise the %transfiletriggerin script is executed. Currently it's > executed at the end of each package installation instead of the end of the > transaction due to the design of the current backend transaction. which is exactly what the bug was about - see https://bugzilla.opensuse.org/show_bug.cgi?id=1041742#c2
(In reply to Dominique Leuenberger from comment #3) > which is exactly what the bug was about - see > https://bugzilla.opensuse.org/show_bug.cgi?id=1041742#c2 Oh you're right, I just read the title of this bug and forgot already about the details. So yes, while this issue was supposed to be fixed by rpm-4.16.1.3 and libzypp-17.26.1 (see https://bugzilla.opensuse.org/show_bug.cgi?id=1041742#c26), it's still present.
(In reply to Franck Bui from comment #4) > (In reply to Dominique Leuenberger from comment #3) > > which is exactly what the bug was about - see > > https://bugzilla.opensuse.org/show_bug.cgi?id=1041742#c2 > > Oh you're right, I just read the title of this bug and forgot already about > the details. Sorry, but me too. This aspect of bug#1041742 got lost. We payed more attention to SINGLE_TRANS because it works on all systems (SUSE Code15, TW and non-SUSE systems) and it also fixes all %pretrans and LUA issues. But it ATM works with zypper only and it breaks a few features we have (strictly requires download-in-advance; install can not be interrupted between 2 packages nor is it possible to retry a failing package; due to issues in the filesystem package it's not able to upgrade a system when a usrmerge happens). The rpm-4.16 mentioned in bug#1041742 may offer a way not to use `--noposttrans` and so may prevent losing the %transfiletriggerin in rpm, which is more problematic than just executing it at a different location in the workflow. The downside is, it's a SUSE specific patch. Zypper for building e.g. TW images will still show the %transfiletriggerin, %pretrans and LUA issues on older SLE and non-SUSE systems. I'll look into this next week.
(In reply to Michael Andres from comment #5) > We payed more attention to SINGLE_TRANS because it works on all systems > (SUSE Code15, TW and non-SUSE systems) and it also fixes all %pretrans and > LUA issues. But it ATM works with zypper only and it breaks a few features > we have (strictly requires download-in-advance; install can not be > interrupted between 2 packages nor is it possible to retry a failing > package; due to issues in the filesystem package it's not able to upgrade a > system when a usrmerge happens). Then it sounds that fixing this bug and bsc#1041742 by patching rpm 4.16 and adapting libzypp is still the easiest way to go as a short term solution. But the current situation is pretty confusing: the bug was supposed to be fixed 2 years ago but for some reasons it's still there. And now the fix consists in changing the default transaction backend but we don't really know when this will happen (even roughly). We would need know at least if we have to wait in term of days, weeks, months... > The rpm-4.16 mentioned in bug#1041742 may offer a way not to use > `--noposttrans` and so may prevent losing the %transfiletriggerin in rpm, > which is more problematic than just executing it at a different location in > the workflow. The downside is, it's a SUSE specific patch. The status of this SUSE specific patch is still not clear. Is it really part of rpm 4.16+ shipped by SUSE as stated in https://bugzilla.opensuse.org/show_bug.cgi?id=1041742#c26 ? > Zypper for > building e.g. TW images will still show the %transfiletriggerin, %pretrans > and LUA issues on older SLE and non-SUSE systems. Then it really sounds that the patch has to work and be backported to older versions of SLE as well. If not we have to make a choice between never be able to make use of %transfiletriggerin in any SUSE distros (regardless of the transaction backend) or stop supporting building images of TW from older distros. Thanks.
Fixed in libzypp-17.31.21 if rpm supports --runposttrans (rpm-4.17). *** This bug has been marked as a duplicate of bug 1041742 ***