New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine support path for RPMs that install into /opt
, /usr/local
etc
#233
Comments
I'd support the /usr/lib/opt approach! |
/opt
/opt
, /usr/local
etc
@cgwalters any hints about what I can do in the meantime to get a sensible /opt to work? I was thinking of manually putting things into /usr/lib/opt during my install script, and then setting up a bind mount to /opt in my /etc/fstab, but I don't know if that'll be incompatible with the existing mount mechanism under OSTree. Is there a better way to weasel my way into the standard OSTree mount mechanism? |
(the issue here is proprietary software with hardcoded assumptions about being in /opt, by the way; otherwise I'd just patch it) |
We can change rpm-ostree to do this postprocessing automatically. |
@cgwalters yeah, sorry, I realize that; was just asking about what to do between now and having native support for /opt in |
The only thing I can think of is to postprocess the RPM outside of rpm-ostree, basically RPMs are just It might sound complex at first but it'd probably be a 4 line script + 15 line spec file. |
@cgwalters but then I also need something to add an /opt bind mount back at runtime, right? The RPMs are still hardcoded to think they're in /opt. Would I have my RPM-wrangler add an entry to fstab as well? |
Add a systemd tmpfiles.d file which creates the symlink |
Oh, excellent, thanks! |
Ah, it looks like https://github.com/projectatomic/rpm-ostree/blob/master/src/libpriv/rpmostree-postprocess.c#L102 is already putting a symlink for |
Turns out even with |
I don't think you want to replace the full
or so. In the current model, the |
Ah yes, I just figured out the immutable bit on /. The reason I was trying to redirect all of /opt, rather than just subdirectories within it is that I have a few different packages that want to put things into /opt, and I was just going to have a general purpose "/opt fixer" in my postprocessing script rather than teaching my individual RPMs how to add to tmpfiles. So my postprocess script currently just copies /opt into /usr/lib/opt and adds a tmpfiles.d entry that (tries to) symlink /opt to /usr/lib/opt. I can do it for individual packages, but that starts putting a lot more burden on different subprojects, so I was hoping to avoid that |
Interesting effect of having |
Yeah, this would all be better if rpm-ostree handled it internally. I'll get around to this at some point if no one else does. |
How would you envision the "ostree-native" version of this working? My concern with the obvious thing is that a lot of programs use it to store all their files, including ones they expect to mutate. Simply making a symlink from |
@cgwalters I would suggest an migration of I'm not sure if the way to say we drop all files from
What do you think? |
I hope this will help others to workaround until there is an solution, thanks to @cgwalters and @copumpkin Rebuild puppet-agent rpm with new pathRegular Expression to change /opt/ -to-> /var/opt:
Copy Conent from /opt/ to the new location: /var/opt/
File:
Start Custom Yum repository:
via rpm-ostree upgrade I've got the changes in ostree and /opt/puppetlabs -> /var/opt/puppetlabs e.g. I can run now puppet agent on centos-atomic host. The above documented solution is upgradeable. I have no blog or website where I can put this and link from here. HTH |
by the way this does not work with rpm-ostree -> I get the following log error: https://nopaste.me/view/dd563d20 A test installation of my rpmrebuild rpm on my ostree-build system was just fine, files & binaries are located in Can someone help? |
After some research I was able to understand that I have to modify my custom rpm so that is will be located under I changed the regular expression from above to: As next I have to add or change the tmpfiles.d file (system.d tmpfiles.d) of puppet-agent rpm (my custom rpm) before
On my testing centos-atomic-host it is now possible to start the puppet-agent systemd service, the original location of There are some addtional adjustments todo at the custom rpm - which are not yet done by me, but the informations here are already useful so I hope. HTH |
Thanks for providing the workarounds. I would like to support this better, however, it would touch a lot of code that is in flux for other work (e.g. the just-landed package layering). |
See coreos#233 - for RPMs which place files in e.g. `/opt`, we have different behavior in the treecompose case (silently drop it) versus package layering (does the wrong thing). Since the unpacker right now is only used in the layering case, this just ensures we'll get a consistent error there.
This adds support for layering rpms with files in /opt. The way we do this is that when importing the rpms we rewrite any files in /opt into /usr/lib/opt, and then we add back a symlink from the toplevels of /opt into /usr/lib/opt via the per-package tmpfiles.d. Also, in order for this to work with the %post script we bind /opt to usr/lib/opt during the script execution. This fixes coreos#233 at least for Google Chrome.
Ran into this today, with Chrome not being able to install plugins (presumably) because of read-only |
Should this issue have been closed? Although installation into /opt works, installation into /usr/local - also mentioned in teh title - does not (afaict). Let alone "etc", which presumably means many more locations. Personally, I came across the issue when |
Yeah agreed, as mentioned in #1795, it was only a partial fix which addresses the Chrome case. |
Instead of attempting to shoehorn incompatible RPMs into the OSTree model, what if one were to install them using regular dnf in an "app container" such as a system-wide version of toolbox? ChromeOS takes this approach with its Crostini subsystem -- users install standard deb packages in an LXD system container, and there is a middle layer connecting the container with the host system, for instance, by automatically exporting launchers and icons. |
How do I get |
Requesting that this get addressed, Doppler-cli is also not compatible due to it dropping files into the |
This issue also breaks the https://www.unifiedremote.com/download/other#linux install on Silverblue |
OK so, nowadays with the whole container-native change, one can do completely arbitrary stuff in a container build (e.g. Dockerfile) and perform any requisite custom transformations there. Here's a demo of installing the HP scripting tools:
Is it beautiful? No. But there's going to be a lot of special casing here, particularly for applications which mix mutable/writable state like log files alongside binaries. In this (I verified that at least the binaries run, though I don't have a HP box handy to test this stuff) Also of note...instead of doing |
this issue also breaks https://github.com/mozilla/sops installation |
This issue breaks also these: Microsoft Defender Endpoint (how to install PaloAlto GlobalProtect VPN Client Stuff like this is deal breaker for usage of rpm-ostree based Distributions like Silverblue in an Enterprise environment. |
RPMs like Puppet and Google Chrome go in
/opt
.For the package layering case, in this PR we made it an obvious error.
The core problem here is: OSTree defines
/opt
(really/var/opt
) as system administrator territory - it's never rolled forward/backwards etc. Content in there isn't protected by thero
bind mount covering/usr
right now.One approach would be to - for these RPMs, automatically rewrite the content into
/usr
. Chrome I don't believe actually stores any persistent state in/var
, so simply rewriting/opt/google/chrome
->/usr/lib/opt/google/chrome
with a compatibility symlink would likely work.Puppet probably stores state in
/var
and hence would be harder.The text was updated successfully, but these errors were encountered: