Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The installers do change a lot of system files. System may become unbootable if something fails during the software updates. Yet, it is almost impossible to ensure atomicity of even simple single file write operations. How is all of that is resolved in unix installers? Are they file-system dependent?

share|improve this question
    
One technique is that files are typically not rewritten but newly created (old versions removed). –  Pavel Šimerda May 18 at 17:19

3 Answers 3

up vote 0 down vote accepted

yum relies on rpm to do the transaction ... rpm isn't atomic. history or yum-complete-transaction try to do the best they can, after the fact.

You can also use the LVM snapshot features in recent versions of yum, and then rollback the entire block device if there is a problem. But you have to do the actual rollback using an external bootable LVM environment (because yum/rpm/glibc could all be hosed by that point).

If you need atomic guarantees then you can't directly use rpm directly (Eg. you ostree, 0install, or layering multiple bootable environments).

share|improve this answer
    
I think that this answers my question as I posted it but I would like to see more information. Where did you get all that from? –  Val May 20 at 0:13

yum 3.2.25 or later brings a history command to examine, complete or roll-back transactions. The history information lives in /var/lib/yum/history. The yum-complete-transaction tool can be used following a power loss or crash to complete transactions or to simply discard aborted ones by erasing the journaled information maintanined in /var/lib/yum/transaction-all and /var/lib/yum/transaction-done.

UPDATE

The atomicity is based on a Sqlite database's ability to provide the illusion of atomicity. An excellent discussion of these technique can be found in a whitepaper entitled Atomic Commit in SQLite.

share|improve this answer
    
I am also interested to know how reliable is that? How do you ensure that all writes are on the disk and in order, how do you isolate the installation from other processes? –  Val May 18 at 17:13

Actually, atomic updates are a problem; yum (and apt, pacman, etc) are not atomic. Fortunately, people are experimenting with solutions. See rpm-ostree and CoreOS atomic upgrades.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.