[Yum-devel] Exit non-0 when scriptlets fail?
Panu Matilainen
pmatilai at laiskiainen.org
Tue Dec 23 08:27:34 UTC 2008
On Sun, 21 Dec 2008, Jesse Keating wrote:
> On Sun, 2008-12-21 at 07:24 -0800, Jesse Keating wrote:
>>
>> Hrm, neither of those seem to be what I'm seeing. In my attempts to
>> reproduce with a small subset, I can't manage to get yum to exit non-0
>> even if I do get scriptlet errors. Of course, I'm not getting the exact
>> same errors because I think the errors I got with the large package set
>> are due to rpm ordering. I gave up late last night :/
>
> Alright, I finally repeated the problem.
>
> Trying to install NetworkManager into a fresh chroot dir will result in
> a non-zero exit, likely due to the rpm ordering putting setup after the
> avahi-autoipd install, which tries to add a group in %pre.
%pre and %preun are special as those can actually abort installation of
the package. Starting with 4.6 rpm reports but otherwise ignores non-pre
scriptlets failing: as the package is already on disk and might've done
whatever in %pre, there's no going back at that point, treating non-pre
scriptlet failures as errors will only leave useless dupes around.
>
> groupadd: unable to open group file
> useradd: unknown GID 100
> useradd: unknown group avahi-autoipd
> error: %pre(avahi-autoipd-0.6.24-1.fc11.i386) scriptlet failed, exit
> status 6
> error: install: %pre scriptlet failed (2), skipping
> avahi-autoipd-0.6.24-1.fc11
>
> It seems difficult to get this particular ordering reliably, adding a
> few more packages will result in different ordering. I think this is
> all due to shadow-utils not properly requiring the database files things
> like groupadd and useradd will modify, so that's where the fix should
> go.
Nope, somebody broke the sacred early bootstrap package dependency chain
by adding a bogon script to setup, see
https://www.redhat.com/archives/fedora-devel-list/2008-December/msg02732.html
> At this point, the only thing in yum that is worrisome is that even
> though avahi-autoipd had a fatal error, yum only shows:
>
> Warning: scriptlet or other non-fatal errors occurred during
> transaction, and that the summary shows avahi-autoipd was installed.
> The files from avahi-autoipd aren't installed either. So it seems that
> yum is getting a bit confused here.
Indeed. The return code of ts.run() doesn't tell that much (it's slightly
more meaningful with rpm 4.6 due to only giving errors from pre-scriptlets
but only a little). For accurate "install failed" reporting, yum would
need to collect any rpm.RPMCALLBACK_*_ERROR events in the transaction
callback and filter failures out of the post-transaction summary. With rpm
4.6 there's also a new callback error rpm.RPMCALLBACK_SCRIPT_ERROR which
indicates that a scriptlet failed, the semantics are descripbed here:
https://bugzilla.redhat.com/show_bug.cgi?id=216221#c15
- Panu -
More information about the Yum-devel
mailing list