diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2020-03-03 19:57:15 +0100 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarit.de> | 2020-03-03 19:57:15 +0100 |
| commit | 3cb7daedb7c5c93a98dfefa191c161f31a1347c6 (patch) | |
| tree | b232a5f7778866839d03a0093d31cfa64f364712 /utils | |
| parent | f25da6070e398f17c24b194c8688595050dc473c (diff) | |
docs: generic doocumentation for searx-uwsgi
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/lib.sh | 60 | ||||
| -rwxr-xr-x | utils/searx.sh | 30 |
2 files changed, 62 insertions, 28 deletions
diff --git a/utils/lib.sh b/utils/lib.sh index 6de66bcaf..f0c710311 100755 --- a/utils/lib.sh +++ b/utils/lib.sh @@ -708,35 +708,39 @@ uWSGI_GROUP= # How distros manage uWSGI apps is very different. From uWSGI POV read: # - https://uwsgi-docs.readthedocs.io/en/latest/Management.html -case $DIST_ID-$DIST_VERS in - ubuntu-*|debian-*) - # init.d --> /usr/share/doc/uwsgi/README.Debian.gz - # For uWSGI debian uses the LSB init process, this might be changed - # one day, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067 - uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available" - uWSGI_APPS_ENABLED="${uWSGI_SETUP}/apps-enabled" - ;; - arch-*) - # systemd --> /usr/lib/systemd/system/uwsgi@.service - # For uWSGI archlinux uses systemd template units, see - # - http://0pointer.de/blog/projects/instances.html - # - https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd - uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-archlinux" - uWSGI_APPS_ENABLED="${uWSGI_SETUP}" - ;; - fedora-*) - # systemd --> /usr/lib/systemd/system/uwsgi.service - # The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see - # - https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html - uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available" - uWSGI_APPS_ENABLED="${uWSGI_SETUP}.d" - uWSGI_USER="uwsgi" - uWSGI_GROUP="uwsgi" - ;; - *) - info_msg "$DIST_ID-$DIST_VERS: uWSGI not yet implemented" - ;; +uWSGI_distro_setup() { + case $DIST_ID-$DIST_VERS in + ubuntu-*|debian-*) + # init.d --> /usr/share/doc/uwsgi/README.Debian.gz + # For uWSGI debian uses the LSB init process, this might be changed + # one day, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067 + uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available" + uWSGI_APPS_ENABLED="${uWSGI_SETUP}/apps-enabled" + ;; + arch-*) + # systemd --> /usr/lib/systemd/system/uwsgi@.service + # For uWSGI archlinux uses systemd template units, see + # - http://0pointer.de/blog/projects/instances.html + # - https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd + uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-archlinux" + uWSGI_APPS_ENABLED="${uWSGI_SETUP}" + ;; + fedora-*) + # systemd --> /usr/lib/systemd/system/uwsgi.service + # The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see + # - https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html + uWSGI_APPS_AVAILABLE="${uWSGI_SETUP}/apps-available" + uWSGI_APPS_ENABLED="${uWSGI_SETUP}.d" + uWSGI_USER="uwsgi" + uWSGI_GROUP="uwsgi" + ;; + *) + info_msg "$DIST_ID-$DIST_VERS: uWSGI not yet implemented" + ;; esac +} + +uWSGI_distro_setup uWSGI_restart() { diff --git a/utils/searx.sh b/utils/searx.sh index 38ccfdcab..447e9911e 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -645,8 +645,38 @@ rst-doc() { eval "echo \"$(< ${REPO_ROOT}/docs/build-templates/searx.rst)\"" + # I use ubuntu-20.04 here to demonstrate that versions are also suported, + # normaly debian-* and ubuntu-* are most the same. + + for DIST_NAME in ubuntu-20.04 arch fedora; do + ( + DIST_ID=${DIST_NAME%-*} + DIST_VERS=${DIST_NAME#*-} + [[ $DIST_VERS =~ $DIST_ID ]] && DIST_VERS= + uWSGI_distro_setup + + echo -e "\n.. START searx uwsgi-description $DIST_NAME" + echo "location: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}" + case $DIST_ID-$DIST_VERS in + ubuntu-*|debian-*) + echo "restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*}" ;; + arch-*) + echo "restart: sudo -H systemctl restart uwsgi@${SEARX_UWSGI_APP%.*}" ;; + fedora-*) + echo "restart: sudo -H touch ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}";; + esac + echo -e ".. END searx uwsgi-description $DIST_NAME" + + echo -e "\n.. START searx uwsgi-appini $DIST_NAME" + eval "echo \"$(< ${TEMPLATES}/${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP})\"" + echo -e "\n.. END searx uwsgi-appini $DIST_NAME" + + ) + done + } # ---------------------------------------------------------------------------- main "$@" # ---------------------------------------------------------------------------- + |