Skip to content

Commit

Permalink
supervisord: use bash for scripts and export env var to supervisor pr…
Browse files Browse the repository at this point in the history
…ocess
  • Loading branch information
sonroyaalmerol authored May 15, 2024
1 parent 71602a0 commit 7881120
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config_parser.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

customConfigFolder="/etc/sogo/sogo.conf.d/"
configPath="/etc/sogo/sogo.conf"
Expand Down
11 changes: 6 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/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
echo "LD_LIBRARY_PATH=/usr/local/lib/sogo:$LD_LIBRARY_PATH" >> /etc/default/sogo
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
Expand Down
3 changes: 2 additions & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7881120

Please sign in to comment.