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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user