Checkmk in Docker with MAIL_RELAY_HOST won't start

Hi,

I’m running checkmk/check-mk-raw:latest (6 days ago).

I have a docker-compose.yml I’ve been using for years now on multiple instances - it has 2 ‘services’ - checkmk and ‘mailer’ (SMTP relay, GitHub - namshi/docker-smtp: SMTP docker container). The latest server I’m trying to set this up is giving me issues:

checkmk  | ### PREPARE POSTFIX (Hostname: checkmk, Relay host: mailer)
checkmk  | ### STARTING MAIL SERVICES
checkmk  | syslogd: timed out waiting for child
checkmk exited with code 1
checkmk  | ### STARTING MAIL SERVICES
checkmk  | syslogd: timed out waiting for child

htop on host is showing 100% CPU for syslogd.

If I edit docker-compose.yml and comment out

   environment:
      MAIL_RELAY_HOST: mailer

it starts normally (but obviously isn’t using the mailer container as a SMTP relay), but as soon as this variable is present the error returns.

If I start mailer by itself, it works (mailer container does not give any errors by itself). However, checkmk is stuck on trying to start mail service.

Any ideas are welcome.
Thanks!

New development: this only seems to happen on Linode, now Akamai…and strangely matches the timeframe since Akamai took over.
Tried the same thing on Hetzner and it worked without issues.

What I don’t understand is what can cause this? checkmk Docker image with env var set…and it ends up in a loop…

I had this as I noted in an earlier post below. I am self-hosted on Debian 11 / docker-ce and like you the container will not start with that parameter set. What I do is comment it out and I have a custom mail.cf bound in which works fine. The issue I was asking help for last week was that although the container starts, the postfix service doesn’t so I have to manually hop in to the running container and issue a “service start postfix” after which notifications work as they should.

I had assumed from the lack of response that it was something daft I’d done but I guess I’m “pleased” to hear it isn’t just me although clearly not a universal issue.

I’ve created a new VPS on Linode, and it works with the default checkmk Docker image - syslogd doesn’t hang. My favorite type of issues :slight_smile:

Hi, I have the same problem with a archlinux and docker host (version 23.0.1).

For the moment I commented the “syslogd” call in the docker-entrypoint.sh (before the postfix start service) and the container started up and I received the mail notifications without any problems.

Is a workaround, but for me is enought for now. I don’t know the collateral effects of do that :stuck_out_tongue:

I hope this help you.

1 Like

Just happened on Hetzner, so I’d like to revert my statement that it only happens on Linode/Akami.

The issue can be easily reproduced:

$ docker run --rm -it ubuntu bash
apt-get update && apt-get install -y inetutils-syslogd
# ...
$ time syslogd
syslogd: timed out waiting for child

real    0m30.001s
user    0m0.001s
sys     0m0.000s

there seems to be a problem with this variant of syslogd.

(starting syslogd with -d for debugging output seems to fix the issue)

there is also an additional error message after some time:

syslogd: /dev/xconsole: No such file or directory

but if you replace the installed syslogd with the one that busybox provides, it works.
so my fix is:

#!/bin/bash
set -e
apt-get update
apt-get remove -y inetutils-syslogd
apt-get install -y --no-install-recommends busybox-syslogd

mounted via dockers -v option to /docker-entrypoint.d/pre-entrypoint/fixsyslogd. don’t forget to set the executable bit, otherwise the hook will not be executed.