Ignore hotplug socket when collecting logs (SC-345)#985
Merged
Conversation
46f8ec8 to
9edc036
Compare
Update "cloud-init collect-logs" to ignore /run/cloud-init/hook-hotplug-cmd as this will raise the error "/run/cloud-init/hook-hotplug-cmd` is a named pipe" if included. Also updated logs.py to continue writing the tarball if it fails collecting a file rather than let the exception bubble up. LP: #1940235
9edc036 to
3a3fe57
Compare
paride
approved these changes
Aug 18, 2021
Contributor
paride
left a comment
There was a problem hiding this comment.
Not an authoritative review but this lgtm!
blackboxsw
approved these changes
Aug 19, 2021
Collaborator
blackboxsw
left a comment
There was a problem hiding this comment.
This works for me. We'll get a noise error if other files are root read-only in /run/cloud-init (which only cloud-init should be writing anyway).
This was referenced May 12, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Commit Message
Additional Context
https://bugs.launchpad.net/cloud-init/+bug/1940235
Test Steps
Start an impish image (or
packages/bddeb, upload to your instance, install deb and reboot).Run
cloud-init collect-logsOn main, fails as mentioned in the bug. On this branch, shows
Wrote /root/cloud-init.tar.gzhavinghook-hotplug-cmdexcluded from the tarball. From now on, if any other error is encountered, we should see something along the lines of:with the error file(s) being excluded from the tarball.
We should really add integration tests for
cloud-init collect-logs. I'd like to add it to this PR if there's time.Checklist: