Ensure RMT conforms with sles 16 immutability requirements#1435
Ensure RMT conforms with sles 16 immutability requirements#1435
Conversation
This change migrates the creation of several directories and symlinks
from the RPM %post script to systemd-tmpfiles. This is necessary for
compatibility with immutable systems like SLES 16, where /usr is
read-only and /var-related directories should be managed via tmpfiles.d.
Summary of changes:
- Created package/files/rmt-tmpfiles.conf to define directories and symlinks.
- Updated rmt-server.spec to:
- Include rmt-tmpfiles.conf as Source4.
- Install it into %{_tmpfilesdir}.
- Mark /var/lib/rmt and related directories as %ghost.
- Call %tmpfiles_create in %post.
- Remove manual symlink creation and file moves from %post.
206fc0f to
e601da4
Compare
- Create a symlink to old /var/lib
This change migrates the creation of several directories and symlinks
from the RPM %post script to systemd-tmpfiles. This is necessary for
compatibility with immutable systems like SLES 16, where /usr is
read-only and /var-related directories should be managed via tmpfiles.d.
Summary of changes:
- Created package/files/rmt-tmpfiles.conf to define directories and symlinks.
- Updated rmt-server.spec to:
- Include rmt-tmpfiles.conf as Source4.
- Install it into %{_tmpfilesdir}.
- Mark /var/lib/rmt and related directories as %ghost.
- Call %tmpfiles_create in %post.
- Remove manual symlink creation and file moves from %post.
- Create a symlink to old /var/lib
…mt into sles16_immutability_compatibility
|
isn't /usr read-only on an immutable system? if yes then writes (system_uuid, logs, cache config) to it would fail, right? |
That is exactly the point, installation should be idempotent and that is attained through the use of immutable file systems. Read: https://confluence.suse.com/pages/viewpage.action?pageId=1989378136&spaceKey=~RBrownSUSE&title=Packaging%2Bfor%2BImmutable%2BMode%2B-%2BBest%2BPractices for more information |
This does not address my concern, as idempotent installation and runtime writability are two different things, and my concern is about runtime:
The doc you shared only confirms this:
Basically:
|
You are right except the purpose of tmpfile is also for migrating from rmt 2 to rmt 3. During installs, we run post-installation actions which reference |
That's how I understand the concept, too. |
currently, the code is trying to write directly into /usr/share/rmt/* which is read-only on an immutable system. If the assumption is that it will follow a symlink to writeable /var/lib/rmt/* then we're missing symlinks for:
If we're not planning to introduce these then we have to keep writing directly to /var/lib/rmt |
|
I agree with @digitaltom and @arharovets here. Runtime data generally lives in What made the switch to |
Description
This PR aims to migrate RMT directory and symlink management from RPM %post scripts to
systemd-tmpfilesfor SLES 16 Immutability compatibility, read more here.Immutability: Ensures
/varprovisioning works when/usris read-only.Fresh Installs: Enables "stateless" image building;
/var/lib/rmtis created at runtime, not during RPM install.Upgrades: Seamlessly handles existing RMT 2 data in
/var/lib/rmtwhile ensuring correct_rmt:nginxpermissions.Related Issue / Ticket / Trello card:
How to test
/var/lib/rmtis created viasystemd-tmpfiles./usr/share/rmt/public/point correctly to/var/lib/rmt/public/.Change Type
Checklist
MANUAL.mdfile with any changes to the user experience.package/obs/rmt-server.changes.Review
Please check out our review guidelines
and get in touch with the author to get a shared understanding of the change.