summaryrefslogtreecommitdiff
path: root/utils/searx.sh
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-03-04 12:22:20 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2020-03-04 12:22:20 +0100
commit3aff2c19d16619d949dc52216b29ef637d1a44a1 (patch)
tree26504ad52a3d4d15b8083eb19e0a4013680d12ff /utils/searx.sh
parent9f1cb7a943cc5a5e26fec753ddeec47bd3580ea0 (diff)
downloadsearxng-3aff2c19d16619d949dc52216b29ef637d1a44a1.tar.gz
searxng-3aff2c19d16619d949dc52216b29ef637d1a44a1.zip
docs: complement uwsgi documentation for all distros
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/searx.sh')
-rwxr-xr-xutils/searx.sh49
1 files changed, 40 insertions, 9 deletions
diff --git a/utils/searx.sh b/utils/searx.sh
index 447e9911e..03911dff6 100755
--- a/utils/searx.sh
+++ b/utils/searx.sh
@@ -643,7 +643,7 @@ rst-doc() {
arch="$(echo "${arch}" | sed 's/.*/ & \\/' | sed '$ s/.$//')"
fedora="$(echo "${fedora}" | sed 's/.*/ & \\/' | sed '$ s/.$//')"
- eval "echo \"$(< ${REPO_ROOT}/docs/build-templates/searx.rst)\""
+ 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.
@@ -656,19 +656,50 @@ rst-doc() {
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}";;
+ ubuntu-*|debian-*) cat <<EOF
+# 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
+
+create ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}
+enable: sudo -H ln -s ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP} ${uWSGI_APPS_ENABLED}/
+start: sudo -H service uwsgi start ${SEARX_UWSGI_APP%.*}
+restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*}
+stop: sudo -H service uwsgi stop ${SEARX_UWSGI_APP%.*}
+disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${CONF}
+EOF
+ ;;
+ arch-*) cat <<EOF
+# 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
+
+create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
+enable: sudo -H systemctl enable uwsgi@${SEARX_UWSGI_APP%.*}
+start: sudo -H systemctl start uwsgi@${SEARX_UWSGI_APP%.*}
+restart: sudo -H systemctl restart uwsgi@${SEARX_UWSGI_APP%.*}
+stop: sudo -H systemctl stop uwsgi@${SEARX_UWSGI_APP%.*}
+disable: sudo -H systemctl disable uwsgi@${SEARX_UWSGI_APP%.*}
+EOF
+ ;;
+ fedora-*) cat <<EOF
+# 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
+
+create: ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
+restart: sudo -H touch ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
+disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
+EOF
+ ;;
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})\""
+ eval "echo \"$(< "${TEMPLATES}/${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP}")\""
echo -e "\n.. END searx uwsgi-appini $DIST_NAME"
)