mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-25 09:21:10 +00:00
upgrades: Disable searx during dist-upgrade
Avoid high CPU usage due to uwsgi continuously restarting before searx config is upgraded. Helps #1644. Tests: Ran dist-upgrade for each case: - Without searx installed -> no log messages related to searx. - With searx installed but not enabled -> searx config is upgraded. - With searx installed and enabled -> searx is disabled, later config is upgraded, and searx is re-enabled. Searx page can be accessed at the end. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
826b20c1d9
commit
db993ecb16
@ -420,6 +420,16 @@ def _perform_dist_upgrade():
|
||||
print('Snapshots are not supported, skip taking a snapshot.',
|
||||
flush=True)
|
||||
|
||||
# If searx is enabled, disable it until we can upgrade it properly.
|
||||
searx_is_enabled = pathlib.Path(
|
||||
'/etc/uwsgi/apps-enabled/searx.ini').exists()
|
||||
if searx_is_enabled:
|
||||
print('Disabling searx...', flush=True)
|
||||
subprocess.run([
|
||||
'/usr/share/plinth/actions/apache', 'uwsgi-disable', '--name',
|
||||
'searx'
|
||||
], check=True)
|
||||
|
||||
# Hold freedombox package during entire dist upgrade.
|
||||
print('Holding freedombox package...', flush=True)
|
||||
with apt_hold():
|
||||
@ -462,6 +472,12 @@ def _perform_dist_upgrade():
|
||||
print('Updating searx search engines list...', flush=True)
|
||||
subprocess.run(['/usr/share/plinth/actions/searx', 'setup'],
|
||||
check=True)
|
||||
if searx_is_enabled:
|
||||
print('Re-enabling searx after upgrade...', flush=True)
|
||||
subprocess.run([
|
||||
'/usr/share/plinth/actions/apache', 'uwsgi-enable',
|
||||
'--name', 'searx'
|
||||
], check=True)
|
||||
|
||||
print('Running apt autoremove...', flush=True)
|
||||
run_apt_command(['autoremove'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user