-
Notifications
You must be signed in to change notification settings - Fork 78
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
unattended-upgrade-shutdown: fix wait-for-signal #296
base: master
Are you sure you want to change the base?
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
Still something is not exactly right. This needs more investigation. |
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.
Based on my comments in #295 about one from many working |
I have no idea who |
I've noticed that unattended upgrade on shutdown doesn't work.
This addresses #295