1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-25 20:25:55 +00:00

docker: Use supervisord to launch chasquid and dovecot

Today, we launch dovecot in the background and chasquid in the
foreground using sudo.

This means that dovecot failures won't propagate, and signals to the
container (e.g. to stop it) also don't get propagated to dovecot
(because it's in the background) or chasquid (because they don't go
beyond the sudo process).

Thanks to [Guiorgy@github](https://github.com/Guiorgy) for identifying
the problem, proposing alternatives, help debugging, and discussing this
in https://github.com/albertito/chasquid/pull/70.
This commit is contained in:
Alberto Bertogli
2025-08-04 11:11:50 +01:00
parent d0afe102de
commit cf18565b80
3 changed files with 70 additions and 7 deletions

View File

@@ -102,9 +102,7 @@ done >> /etc/dovecot/auto-ssl.conf
sed -i '/^hostname:/d' /etc/chasquid/chasquid.conf
echo "hostname: '$ONE_DOMAIN'" >> /etc/chasquid/chasquid.conf
# Start the services: dovecot in background, chasquid in foreground.
start-stop-daemon --start --quiet --pidfile /run/dovecot.pid \
--exec /usr/sbin/dovecot -- -c /etc/dovecot/dovecot.conf
# shellcheck disable=SC2086
sudo -u chasquid -g chasquid /usr/bin/chasquid $CHASQUID_FLAGS
# Start the services (dovecot and chasquid, configured in supervisord.conf).
# We exec, so supervisord becomes our init, and it forwards any signals we
# receive from outside the container.
exec supervisord --nodaemon -c /etc/supervisor/supervisord.conf