Skip to content

Commit 743bc85

Browse files
committed
Force start mailman inside the container.
Even though the 'master.lck' is supposed to prevent race conditions, it needs to be manually removed if the container did not shutdown gracefully. Remove the manual check for the lock file and force mailman to remove it. Also, set the stop_grace_period to 30s, which would allow Core to stop gracefully and not leave the lock file over. Default value in case of Docker is 10s.
1 parent d531dbc commit 743bc85

3 files changed

Lines changed: 2 additions & 10 deletions

File tree

core/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ EXPOSE 8001 8024
2626
ENV MAILMAN_CONFIG_FILE /etc/mailman.cfg
2727

2828
ENTRYPOINT ["docker-entrypoint.sh"]
29-
CMD ["master"]
29+
CMD ["master", "--force"]

core/docker-entrypoint.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
#! /bin/bash
22
set -e
33

4-
# Check if the master lock exists for the mailman.
5-
# It means that that either some other mailman process is running or
6-
# the last time mailman did not exit clean.
7-
if [[ -e /opt/mailman/var/locks/master.lck ]]; then
8-
echo "The mailman's master lock file still exists at /opt/mailman/core/var/locks/master.lck"
9-
echo "Please remove the lock file before trying to run this container again."
10-
exit 1
11-
fi
12-
134
function wait_for_postgres () {
145
# Check if the postgres database is up and accepting connections before
156
# moving forward.

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
hostname: mailman-core
88
volumes:
99
- /opt/mailman/core:/opt/mailman/
10+
stop_grace_period: 30s
1011
links:
1112
- database:database
1213
depends_on:

0 commit comments

Comments
 (0)