-
Notifications
You must be signed in to change notification settings - Fork 201
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
dbus: wait for 'netplan try' to be ready (LP: #1949893) #245
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
=======================================
Coverage 99.09% 99.09%
=======================================
Files 58 58
Lines 9913 9977 +64
=======================================
+ Hits 9823 9887 +64
Misses 90 90 ☔ View full report in Codecov by Sentry. |
b015bc5
to
99e6190
Compare
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.
Looks good, two nitpicks inside but given the constraints probably the best we can do :) [reading this again I really hope it does not sound negative - it's not meant this way]
This comment has been minimized.
This comment has been minimized.
8d58917
to
cc37ced
Compare
Thank you @mvo5 for your comments! Indeed having a "stamp file" is a much more universal approach. I'm not sure why I didn't think about that earlier... I thought about passing signals from child to parent process (like we do from parent to child currently) and also about passing DBus signal directly from the Python code (but that would probably be overkill as we do not have proper DBus integration with the python code, currently and on the Polling for a file is plain and simple solution. |
cc37ced
to
0bbc0d5
Compare
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.
Looks very nice! I have some comments/nitpicks/suggestions inline that are hopefully useful but nothing that would bock this. Thanks a lot for working on this!
netplan-dbus now waits for the spawned 'netplan try' child to touch the /tmp/netplan-try.ready stamp file before it returns the DBus call. If no stamp file is detected within up to 5sec it hits a timeout and returns an error.
9f27143
to
0cf3e7e
Compare
0cf3e7e
to
0bd35a4
Compare
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.
Looks very nice, thank you! One tiny nitpick inline but feel free to ignore :)
to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/
to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/
0bd35a4
to
5aa371b
Compare
Thank you so much @mvo5 for all your input here. I think this is ready for merging \o/ Let me run some more test on it before merging it early next week. |
netplan-dbus now waits for the spawned 'netplan try' child to touch the /run/netplan/netplan-try.ready stamp file before it returns the DBus call. If no stamp file is detected within up to 5 sec it hits a timeout and returns an error. Additionally, this PR places ephemeral netplan configs in /run/netplan/config-XXXXXX, to avoid potential exploits of tmpfiles, like https://lwn.net/Articles/250468/ COMMITS: * test:dbus: some cleanup * test:utils: add touch() method to MockCmd * cli:try: add touch/clear_ready_stamp methods * dbus: wait for 'netplan try' to be ready netplan-dbus now waits for the spawned 'netplan try' child to touch the /tmp/netplan-try.ready stamp file before it returns the DBus call. If no stamp file is detected within up to 5sec it hits a timeout and returns an error. * cli:apply: some more time for NM to have all interfaces created * dbus:cli: move netplan-try.ready stamp file to /run/netplan to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/ * dbus: move ephemeral netplan config states to /run/netplan to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/
Merged in e19441c |
Description
netplan-dbus now waits for the spawned 'netplan try' child to touch the
/run/netplan/netplan-try.ready
stamp file before it returns the DBus call. If no stamp file is detected within up to 5 sec it hits a timeout and returns an error.Additionally, this PR places ephemeral netplan configs in
/run/netplan/config-XXXXXX
, to avoid potential exploits of tmpfiles, like https://lwn.net/Articles/250468/Checklist
make check
successfully.make check-coverage
).