commit:     0202a52755e64db7c6caae8b6a15feb52bf3b8e1
Author:     Benoît Dufour <benoit.dufour <AT> mail <DOT> com>
AuthorDate: Thu Nov  9 17:48:15 2023 +0000
Commit:     Benoît Dufour <benoit.dufour <AT> mail <DOT> com>
CommitDate: Thu Nov  9 17:49:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0202a527

www-apps/whoogle-search: Fix the OpenRC init.d file.

Signed-off-by: Benoît Dufour <benoit.dufour <AT> mail.com>

 www-apps/whoogle-search/files/whoogle.initd                 | 13 ++++++++++++-
 ...earch-0.8.3-r1.ebuild => whoogle-search-0.8.3-r2.ebuild} |  0
 ...earch-0.8.4-r1.ebuild => whoogle-search-0.8.4-r2.ebuild} |  0
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/www-apps/whoogle-search/files/whoogle.initd 
b/www-apps/whoogle-search/files/whoogle.initd
index 7695e805bd..6d51df4ab2 100644
--- a/www-apps/whoogle-search/files/whoogle.initd
+++ b/www-apps/whoogle-search/files/whoogle.initd
@@ -2,6 +2,11 @@
 # Copyright 2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Environment variables for whoogle
+source "/etc/default/whoogle"
+export ADDRESS=${BIND_ADDRESS:-0.0.0.0}
+export PORT=${LISTEN_PORT:-5000}
+
 name="Whoogle Search"
 description="A self-hosted, ad-free, privacy-respecting metasearch engine"
 command="/opt/whoogle-search/run"
@@ -17,6 +22,12 @@ depend() {
 
 start_pre() {
        checkpath -fo whoogle:whoogle "/var/log/whoogle.log"
-       source "/etc/default/whoogle"
+       echo "Whoogle is running on: ${BIND_ADDRESS}:${LISTEN_PORT}"
+       cd /opt/whoogle-search
 }
 
+stop_post() {
+       # whoogle doesn't get killed by stop so it needs to be done manually
+       whoogle_pid="$(ps aux | grep -i 
"/usr/lib/python-exec/python3.11/python3 -um app" | grep -v 'grep' | cut -d ' ' 
-f 3-4 | xargs)"
+       kill "${whoogle_pid}"
+}

diff --git a/www-apps/whoogle-search/whoogle-search-0.8.3-r1.ebuild 
b/www-apps/whoogle-search/whoogle-search-0.8.3-r2.ebuild
similarity index 100%
rename from www-apps/whoogle-search/whoogle-search-0.8.3-r1.ebuild
rename to www-apps/whoogle-search/whoogle-search-0.8.3-r2.ebuild

diff --git a/www-apps/whoogle-search/whoogle-search-0.8.4-r1.ebuild 
b/www-apps/whoogle-search/whoogle-search-0.8.4-r2.ebuild
similarity index 100%
rename from www-apps/whoogle-search/whoogle-search-0.8.4-r1.ebuild
rename to www-apps/whoogle-search/whoogle-search-0.8.4-r2.ebuild

Reply via email to