mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
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 <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
2ae60802a9
commit
8a3603cd5f
@ -12,7 +12,8 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from plinth.action_utils import (apt_hold, debconf_set_selections,
|
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.apache.components import check_url
|
||||||
from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST,
|
from plinth.modules.upgrades import (BACKPORTS_SOURCES_LIST, SOURCES_LIST,
|
||||||
get_current_release, is_backports_current)
|
get_current_release, is_backports_current)
|
||||||
@ -440,6 +441,11 @@ def _perform_dist_upgrade():
|
|||||||
print('Running unattended-upgrade...', flush=True)
|
print('Running unattended-upgrade...', flush=True)
|
||||||
subprocess.run(['unattended-upgrade', '--verbose'])
|
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.
|
# Update apt cache again to trigger force_upgrades.
|
||||||
print('Updating Apt cache...', flush=True)
|
print('Updating Apt cache...', flush=True)
|
||||||
run_apt_command(['update'])
|
run_apt_command(['update'])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user