Bug 1352154

Summary: Tracker for %post compatibility
Product: [Fedora] Fedora Reporter: Colin Walters <walters>
Component: rpm-ostreeAssignee: Colin Walters <walters>
Status: ASSIGNED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dustymabe, enrico.tagliavini, fedoraproject, jjardon, jlebon, mattdm, miabbott, msuchy, samuel-rhbugs, walters
Target Milestone: ---Keywords: Tracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1473402, 1348671, 1352152, 1367585, 1367587, 1377367, 1377369, 1408530, 1415451, 1456278, 1569722, 1657041, 1657367, 1702226, 1717966, 1817258, 1827441, 2132103    
Bug Blocks:    

Description Colin Walters 2016-07-01 19:59:38 UTC
rpm-ostree is a new model for rpm packages on using ostree[0].  In order to implement atomic upgrades without special filesystem support, it runs %post scripts using rofiles-fuse[1]

This means that %post scripts, whenever replacing an existing file, must do create-new-then-rename, rather than open(O_TRUNC).  This is a core distinction between `/usr/bin/install` and `/usr/bin/cp`.

Additionally, if your %post script is generated cached state derived purely from /usr content (e.g. ldconfig, gtk-update-icon-cache), please consider moving it to /usr, so that the cache state is stored with the data. 

The initial rpm-ostree implementation of %post is here: https://github.com/projectatomic/rpm-ostree/pull/338

[0] https://ostree.readthedocs.io/en/latest/manual/adapting-existing/
[1] https://github.com/ostreedev/ostree/blob/master/man/rofiles-fuse.xml

Comment 1 Colin Walters 2016-08-16 21:16:11 UTC
Also, rpm-ostree doesn't currently implement Lua, and we'd like to avoid doing so for as long as possible.  For more information, see:

http://lists.rpm.org/pipermail/rpm-ecosystem/2016-August/000391.html

Comment 2 Jan Kurik 2017-08-15 09:18:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 5 Miroslav Suchý 2017-11-28 11:43:10 UTC
ad #4 (the code in that PR will go away, but anyway) I do not get why /var/cache should be read only. That does not make sense to me.

Comment 6 Colin Walters 2017-11-28 14:13:17 UTC
(In reply to Miroslav Suchý from comment #5)
> ad #4 (the code in that PR will go away, but anyway) I do not get why
> /var/cache should be read only. That does not make sense to me.

There's a bit more information at
https://ostree.readthedocs.io/en/latest/manual/adapting-existing/

But to elaborate on that, in order to support reliable "offline" updates as well as rollbacks, we have a strict rule that the update system does *not* touch user data.  /var is user data.

We *do* support "rpm-ostree livefs" today which will run `systemd-tmpfiles` which will process /var - in the case of mock, rpm-ostree synthesizes a tmpfiles.d snippet.  This is significantly more controlled than allowing arbitrary %post to write directly to /var.

See also https://github.com/projectatomic/rpm-ostree/pull/888 and http://lists.rpm.org/pipermail/rpm-ecosystem/2017-July/000481.html

Comment 7 Fedora End Of Life 2018-02-20 15:27:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 9 Colin Walters 2018-11-08 17:24:08 UTC
Another case here is that the `update-alternatives` system stores links in `/var`, which is wrong.  They should be moved under `/usr`.

Comment 10 Enrico Tagliavini 2019-04-23 09:37:44 UTC
Want to add the following two too?

bug #1702226

bug #1702233

Comment 11 Ben Cotton 2019-05-02 19:37:53 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Dusty Mabe 2019-05-02 21:09:03 UTC
This is a tracker.. moving to rawhide.

Comment 13 Ben Cotton 2019-08-13 17:10:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 14 Ben Cotton 2019-08-13 19:10:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 15 Dusty Mabe 2019-08-14 13:50:28 UTC
Switching back to rawhide since this is a running tracker.