From 140740f11a07c8b4bd9180490d7b4acfdc5747be Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Sat, 25 Feb 2023 09:18:54 +0100 Subject: [PATCH] Catch PermissionError when executing on_ac_power Reproducible with: $ touch /usr/bin/on_ac_power and powermgmt-base not installed. Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031880 --- unattended-upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unattended-upgrade b/unattended-upgrade index d4956738..54c79986 100755 --- a/unattended-upgrade +++ b/unattended-upgrade @@ -703,7 +703,7 @@ def should_stop(): and subprocess.call("on_ac_power") == 1: logging.warning("System is on battery power, stopping") return True - except FileNotFoundError: + except (FileNotFoundError, PermissionError): log_once( _("Checking if system is running on battery is skipped. Please " "install powermgmt-base package to check power status and skip "