diff --git a/Dockerfile b/Dockerfile index b6308e6..da8f0d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 diff --git a/sogod.sh b/sogod.sh new file mode 100644 index 0000000..e239895 --- /dev/null +++ b/sogod.sh @@ -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 \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf index e96f1b7..b33f447 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -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