Skip to content

Commit

Permalink
sogod script: create a separate script for supervisor to execute
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol authored May 15, 2024
1 parent 7881120 commit 75e6487
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ COPY --from=builder /tmp/SOGo/Apache/SOGo.conf /etc/apache2/conf-available/SOGo.

COPY supervisord.conf /opt/supervisord.conf
COPY config_parser.sh /opt/config_parser.sh
COPY sogod.sh /opt/sogod.sh
COPY entrypoint.sh /opt/entrypoint.sh

ADD https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${TARGETARCH} /usr/bin/yq
Expand All @@ -136,7 +137,8 @@ RUN a2enmod \
ln -s /usr/local/sbin/sogo-slapd-sockd /usr/sbin/sogo-slapd-sockd && \
ln -s /etc/apache2/conf-available/SOGo.conf /etc/apache2/conf-enabled/SOGo.conf && \
chmod +rx /usr/bin/yq && \
chmod +rx /opt/entrypoint.sh
chmod +rx /opt/entrypoint.sh && \
chmod +rx /opt/sogod.sh

# start from config folder
WORKDIR /etc/sogo
Expand Down
10 changes: 10 additions & 0 deletions sogod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if [ -f /etc/default/sogo ]; then
. /etc/default/sogo
fi

. /lib/lsb/init-functions
. /usr/share/GNUstep/Makefiles/GNUstep.sh

/usr/local/sbin/sogod -WONoDetach YES -WOLogFile /var/log/sogo/sogo.log
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ logfile=/dev/null
logfile_maxbytes=0

[program:sogo]
command=/bin/bash -c '. /usr/share/GNUstep/Makefiles/GNUstep.sh && /usr/local/sbin/sogod -WONoDetach YES -WOLogFile /var/log/sogo/sogo.log'
command=/opt/sogod.sh
environment=LD_PRELOAD="%(ENV_LD_PRELOAD)s"
user=sogo
stdout_logfile=/dev/fd/1
Expand Down

0 comments on commit 75e6487

Please sign in to comment.