So I’m creating an unsupported modification of Mail-in-a-Box to run on a Raspberry Pi 3 with Ubuntu 16.04 armhf.
I’ve only had to make minor changes so far, but I’ve hit a bit of a stumbling block with the management interface and was wondering if anyone could help.
My fork is on https://github.com/lloydsmart/mailinabox.
When I try to do an install, it fails on “Installing Mail-in-a-Box system management daemon…”
Specifically, it gets all the way through management.sh, up to “restart_service mailinabox”.
Now, I know that restart_service is just a wrapper for “service $1 restart”, so this is actually calling “service mailinabox restart”. When I look at /etc/init.d/mailinabox, I see that restart just calls do_start, which in turn calls:
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background --make-pidfile --chuid $EXEC_AS_USER --startas $DAEMON -- $DAEMON_ARGS
So, seeing as $DAEMON is set to /usr/local/bin/mailinabox-daemon, this led me to examine that file, which seems to execute just fine all the way up until the final line, specifically:
app.run(port=10222)
This throws up an error that I haven’t been able to solve, and which throws off the whole install process. By running that specific python file with DEBUG=1, I can see the following error:
--------------------------------------------------------------------------------
INFO in daemon [management/daemon.py:621]:
API key: 306JZ9M5VhMcKN/563/vZZm7CONmg0Ld5sRGdjm8sCQ=
--------------------------------------------------------------------------------
* Running on http://127.0.0.1:10222/ (Press CTRL+C to quit)
Traceback (most recent call last):
File "management/daemon.py", line 624, in <module>
app.run(port=10222)
File "/usr/lib/python3/dist-packages/flask/app.py", line 772, in run
run_simple(host, port, self, **options)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 618, in run_simple
test_socket.bind((hostname, port))
OSError: [Errno 98] Address already in use
Any ideas what could be causing this? I’ve looked through documentation for Flask, but haven’t found the cause yet. It seems like something else is hogging port 10222, but I can’t think what that might be as this is a fresh box.