From 78811200a38239963b42d65021f36f82dab7190e Mon Sep 17 00:00:00 2001 From: Son Date: Wed, 15 May 2024 14:30:54 -0400 Subject: [PATCH] supervisord: use bash for scripts and export env var to supervisor process --- config_parser.sh | 2 +- entrypoint.sh | 11 ++++++----- supervisord.conf | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/config_parser.sh b/config_parser.sh index bd453a0..de7b8fd 100644 --- a/config_parser.sh +++ b/config_parser.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash customConfigFolder="/etc/sogo/sogo.conf.d/" configPath="/etc/sogo/sogo.conf" diff --git a/entrypoint.sh b/entrypoint.sh index 1285c0e..684606f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,5 @@ -#!/bin/sh +#!/bin/bash -# Solve libssl bug for Mail View if [ -z "$LD_PRELOAD" ]; then LIBSSL_LOCATION=$(find / -type f -name "libssl.so.*" -print -quit 2>/dev/null) echo "LD_PRELOAD=$LIBSSL_LOCATION" >> /etc/default/sogo @@ -8,12 +7,14 @@ if [ -z "$LD_PRELOAD" ]; then export LD_PRELOAD=$LIBSSL_LOCATION else echo "LD_PRELOAD=$LD_PRELOAD" >> /etc/default/sogo - echo "LD_LIBRARY_PATH=/usr/local/lib/sogo:$LD_LIBRARY_PATH" >> /etc/default/sogo + if [ -z "$LD_LIBRARY_PATH" ]; then + echo "LD_LIBRARY_PATH=/usr/local/lib/sogo:/usr/local/lib:/usr/lib" >> /etc/default/sogo + else + echo "LD_LIBRARY_PATH=/usr/local/lib/sogo:/usr/local/lib:$LD_LIBRARY_PATH" >> /etc/default/sogo + fi export LD_PRELOAD=$LD_PRELOAD fi -. /usr/share/GNUstep/Makefiles/GNUstep.sh - # Set process UID and GID at runtime if [ -n "$PUID" ] && [ -n "$PGID" ]; then groupmod -g $PGID sogo diff --git a/supervisord.conf b/supervisord.conf index 645fb01..e96f1b7 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -5,7 +5,8 @@ logfile=/dev/null logfile_maxbytes=0 [program:sogo] -command=/bin/bash -c '/usr/local/sbin/sogod -WONoDetach YES -WOLogFile /var/log/sogo/sogo.log' +command=/bin/bash -c '. /usr/share/GNUstep/Makefiles/GNUstep.sh && /usr/local/sbin/sogod -WONoDetach YES -WOLogFile /var/log/sogo/sogo.log' +environment=LD_PRELOAD="%(ENV_LD_PRELOAD)s" user=sogo stdout_logfile=/dev/fd/1 stdout_logfile_maxbytes=0