From b9e0d5b81d02691d44f5966fc0cc5fa11555913b Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Mon, 10 Aug 2020 17:42:15 +0530 Subject: [PATCH] Creates a symlink to the .so file in postint for mod_wsgi On Focal, mod_wsgi expects a shared library for the python module at: $VENV/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.so But, the real shared library path is $VENV/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so" So we are creating a symlink with the proper path if we are using Python 3.8 --- install_files/securedrop-app-code/debian/postinst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install_files/securedrop-app-code/debian/postinst b/install_files/securedrop-app-code/debian/postinst index 63541cd25f..c1659cad92 100644 --- a/install_files/securedrop-app-code/debian/postinst +++ b/install_files/securedrop-app-code/debian/postinst @@ -93,6 +93,14 @@ function adjust_wsgi_configuration { perl -pi -e 's/^WSGIProcessGroup journalist.*\n//' "$journalist_conf" fi fi + # Create the WSGI so file link if only on Python3.8 + wsgi_so_link="/opt/venvs/securedrop-app-code/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.so" + wsgi_so="/opt/venvs/securedrop-app-code/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so" + if test -f "/usr/bin/python3.8"; then + if test ! -L $wsgi_so_link; then + ln -s $wsgi_so $wsgi_so_link + fi + fi } # Manage PaX flags for web app, only required under Xenial.