[Server-devel] recover from broken yum transaction

Seth Vidal skvidal at fedoraproject.org
Thu Sep 11 22:20:41 EDT 2008


On Fri, 2008-09-12 at 09:54 +1200, Martin Langhoff wrote:

> That is not very useful for us. I don't worry so much about the
> machine being killed in the 'download stuff' part, bit AFAIK that's
> not part of the 'transaction'. When yum-complete-transaction is
> called, I am expecting it to work with the RPMs it has, and ensure
> anything it was trying to do gets done...

The transaction file is written out after the pkgs are downloaded, so
the transaction should complete just fine if the system hasn't changed
state dramatically. 


> WRT networking, in places like Peru my rule of thumb is that 50% of
> the servers will _not_ have internet. Package installations / upgrades
> are very likely to happen by sending out USB keys with a bunch of
> RPMs, and a GPG-signed script that triggers the yum process.

Then that won't be an issue at all, you'll have a local repo on the usb
key which yum can access. It won't even need -C b/c it will have
connectivity to the local file:/// based repo.


> yum supports -C... can yum-complete-transaction support -C as well?

it already does. - try it: yum-complete-transaction --help



> >>  - Is there an easy way to check for pending transactions?
> >
> > yum-complete-transaction checks for them itself
> 
> Yes, though it's useful to be able to check that for logging/reporting...


You can check with one call:
import yum.misc
yum.misc.find_unfinished_transactions()

if it returns a non-empty list then you have unfinished transactions.


> >>  - Does it have useful exit codes indicating whether it's done anything?
> >
> > If the results codes are not good enough we can fix that easily enough.
> 
> I am asking because checking the manpage and reading the source did
> not give me any hints as to exit codes. Neither does 'man yum' talk
> about exit codes except for the "check-update" command.

at this point yum should be returning 0 for any non-erroring exit and 1
for any error condition. Including rpm scriptlet failures.

That should also be true for yum-complete-transaction


-sv




More information about the Server-devel mailing list