From 8a3603cd5facaee13782a58c6a245edecc032c7f Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Tue, 5 Jan 2021 18:41:44 -0500 Subject: [PATCH] upgrades: Restart FreedomBox service at end of dist-upgrade This was removed in an earlier change, so restore it. Avoids a transient "IndexError: list index out of range" error caused by django when visiting a page. Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- actions/upgrades | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actions/upgrades b/actions/upgrades index d3b98063a..ca8e81303 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -12,7 +12,8 @@ import subprocess import sys from plinth.action_utils import (apt_hold, debconf_set_selections, - run_apt_command, service_daemon_reload) + run_apt_command, service_daemon_reload, + service_restart) from plinth.modules.apache.components import check_url from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST, get_current_release, is_backports_current) @@ -440,6 +441,11 @@ def _perform_dist_upgrade(): print('Running unattended-upgrade...', flush=True) subprocess.run(['unattended-upgrade', '--verbose']) + # Restart FreedomBox service to ensure it is using the latest + # dependencies. + print('Restarting FreedomBox service...', flush=True) + service_restart('plinth') + # Update apt cache again to trigger force_upgrades. print('Updating Apt cache...', flush=True) run_apt_command(['update'])