Skip to content
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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on May 3, 2021

  1. unattended-upgrade-shutdown: fix wait-for-signal

    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
    kucharskim committed May 3, 2021
    Configuration menu
    Copy the full SHA
    1f62799 View commit details
    Browse the repository at this point in the history
  2. Revert "unattended-upgrade-shutdown: fix wait-for-signal"

    Problem is in different place.
    kucharskim committed May 3, 2021
    Configuration menu
    Copy the full SHA
    4ff7744 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    353af0d View commit details
    Browse the repository at this point in the history