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
core: do not attempt to add 'private' symlinks when RootImage/RootDirectory are used #22272
Conversation
There's an app0.service in the extension app0.raw, so don't use the same name for a unit in minimal.raw
Makes the setup idempotent, as mksquashfs by default attempts to append to an existing image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
I can confirm that the PR fixes #22264
|
16c4617
to
1a8e4f4
Compare
|
TEST-29-PORTABLE failed. Is it related? |
|
Possibly but I don't quite understand why it's affecting the sanitizer build - @mrc0mmand any idea? |
|
tentatively set the red label. |
|
I'm a bit confused now how this all should work, but from a quick glance it looks like a timing issue? The portable-related stuff is mostly dark magic for me, so I'm not sure what's going wrong there. |
|
There's two services running, and creating those files, by the time they are removed they should be all done, but maybe I need to add some looping |
I see. I'll do a couple of local tests just to confirm this, so we don't have to for CI confirmation in case it's something else. |
|
Indeed. I can reproduce the issue locally and applying: diff --git a/test/units/testsuite-29.sh b/test/units/testsuite-29.sh
index 3afdc44ff4..8cffb2e66d 100755
--- a/test/units/testsuite-29.sh
+++ b/test/units/testsuite-29.sh
@@ -112,8 +112,13 @@ portablectl detach --now --runtime --extension /usr/share/app1.raw /usr/share/mi
# Ensure that the combination of read-only images, state directory and dynamic user works, and that
# state is retained. Check after detaching, as on slow systems (eg: sanitizers) it might take a while
# after the service is attached before the file appears.
-grep -q -F bar /var/lib/private/app0/foo
-grep -q -F baz /var/lib/private/app1/foo
+for ((i = 0; i < 20; i++)); do
+ if grep -q -F bar /var/lib/private/app0/foo && grep -q -F baz /var/lib/private/app1/foo; then
+ break
+ fi
+
+ sleep 0.5
+done
# portablectl also works with directory paths rather than images
makes the test gods happy: |
|
wow that's really slow - ok thanks, this really helps, will fix it |
yeah, I guess bumping the sleep to 1s might make sense, given the loop runs for more than one iteration only in sanitizer runs |
|
After the loop, the |
1a8e4f4
to
4127554
Compare
|
It's really weird, all the calls before the check should be blocking |
…ectory are used A bind mount is added directly from private on the host to the actual destination directory, no need for the symlinks (which cannot be created as the bind mount happens first and creates the target as an actual directory) Fixes systemd#22264
4127554
to
3fa80e5
Compare
|
Ah, I understand the issue - with sanitizers, the trusted profile is used, which means DynamicUser is disabled. But in that case the state directory storage is /var/lib/foo, not /var/lib/private/foo, but the test was hard-coded to check the latter only. Should be fixed now. |
A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)
Fixes #22264