Package: unattended-upgrades
Version: 2.8
Severity: grave
Justification: renders package unusable

Dear Maintainer,

   * What led up to the situation?

Currently unattended-upgrades marks the powermgmt-base package
as Suggested. powermgmt-base provides the /sbin/on_ac_power and
/usr/sbin/on_ac_power script(s), which unattended-upgrades requires to
function at all, because of this check in /usr/bin/unattended-upgrade
at line 676:

if apt_pkg.config.find_b("Unattended-Upgrade::OnlyOnACPower", True) \
   and subprocess.call("on_ac_power") == 1:

The absence of the powermgmt-base package, and thus the on_ac_power
script, results in the following error:

root# /usr/bin/unattended-upgrade
Traceback (most recent call last):
  File "/usr/bin/unattended-upgrade", line 2522, in <module>
    sys.exit(main(options))
  File "/usr/bin/unattended-upgrade", line 1993, in main
    res = run(options, rootdir, mem_log, logfile_dpkg,
  File "/usr/bin/unattended-upgrade", line 2061, in run
    if should_stop():
  File "/usr/bin/unattended-upgrade", line 676, in should_stop
    and subprocess.call("on_ac_power") == 1:
  File "/usr/lib/python3.9/subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'on_ac_power'

(Note that it's not clear to me why this is a PermissionError, since
the script doesn't actually exist, but that is a secondary point.)

The powermgmt-base package needs to be installed in order for
unattended-upgrades to function at all. Thus, the powermgmt-base package
needs to be marked as Depends for unattended-upgrades.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

Installing the powermgmt-base package makes the problem go away.

Thanks much,
--
Steve Lane
sdl...@lbl.gov

-- System Information:
Debian Release: 11.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-21-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages unattended-upgrades depends on:
ii  debconf [debconf-2.0]  1.5.77
ii  lsb-base               11.1.0
ii  lsb-release            11.1.0
ii  python3                3.9.2-3
ii  python3-apt            2.2.1
ii  python3-dbus           1.2.16-5
ii  python3-distro-info    1.0
ii  ucf                    3.0043
ii  xz-utils               5.2.5-2.1~deb11u1

Versions of packages unattended-upgrades recommends:
ii  cron [cron-daemon]  3.0pl1-137
ii  systemd-sysv        247.3-7+deb11u1

Versions of packages unattended-upgrades suggests:
ii  bsd-mailx                          8.1.2-0.20180807cvs-2
ii  needrestart                        3.5-4+deb11u2
ii  nullmailer [mail-transport-agent]  1:2.2-3
ii  powermgmt-base                     1.36
pn  python3-gi                         <none>

-- debconf information:
* unattended-upgrades/origins_pattern: 
"origin=Debian,codename=${distro_codename},label=Debian-Security";
* unattended-upgrades/enable_auto_updates: true

Reply via email to