unattended-upgrade-shutdown: fix wait-for-signal#296
Draft
kucharskim wants to merge 3 commits intomvo5:masterfrom
Draft
unattended-upgrade-shutdown: fix wait-for-signal#296kucharskim wants to merge 3 commits intomvo5:masterfrom
kucharskim wants to merge 3 commits intomvo5:masterfrom
Conversation
I've noticed that unattended upgrade on shutdown doesn't work. After analyzing the code and some test runs, following cought my attention, from `pydoc3 apt_pkg.get_lock`: > apt_pkg.get_lock = get_lock(...) > get_lock(file: str, errors: bool) -> int > > Create an empty file of the given name and lock it. If the locking > succeeds, return the file descriptor of the lock file. Afterwards, > locking the file from another process will fail and thus cause > get_lock() to return -1 or raise an Error (if 'errors' is True). > > From Python 2.6 on, it is recommended to use the context manager > provided by apt_pkg.FileLock instead using the with-statement. Based on above, I think condition on line 342 should be reversed. Running `unattended-upgrade-shutdown --wait-for-signal` with my diff fixes the issue for me. This addresses mvo5#295
Author
|
Still something is not exactly right. This needs more investigation. |
Author
|
I think this is ready for review. I did two runs, one after another, and wanted until the very end. This code makes it work, but someone who knows and understand the code base better should carefully review. |
Problem is in different place.
Author
|
Based on my comments in #295 about one from many working |
Collaborator
|
I have no idea who |
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.
I've noticed that unattended upgrade on shutdown doesn't work.
This addresses #295