Mailinabox service not starting on reboot

Hello forum,

An interesting issue I’ve discovered, after completing my migration this evening, my admin panel was all 502 - Bad Gateway, after a successful install on a fresh 18.04 build, and a restoration on data taken from a backup off a MIAB v0.30 updated Ubuntu 14.04 box. I’ve finished the migration now - and started looking at this issue.

All was resolved by simply running the setup script again, however, after I rebooted it happened again! Status check script indicate the daemon wasn’t running on TCP10222. On checking how this works, it seems to use the service named “mailinabox”, however when this is sent a status/stop/start/restart command it always comes back with the following:

krisladmin@mail:~$ sudo systemctl status mailinabox
Unit mailinabox.service could not be found.
krisladmin@mail:~$ sudo systemctl stop mailinabox
Failed to stop mailinabox.service: Unit mailinabox.service not loaded.
krisladmin@mail:~$ sudo systemctl start mailinabox
Failed to start mailinabox.service: Unit mailinabox.service not found.

I can run the commands fine right after setup script though, something goes wrong when the box comes up from a reboot.

I don’t think (I think) I’ve done anything to cause that, but I’m also seeing the same behaviour on another machine I have setup with 18.04 and MIAB 0.4 that is greenfield install. If anyone has any pointers on what I should be looking at next that would be great.

The workaround I will use for the time being is to either run the setup script across reboots when they occur, or somehow try and get rc.local or something running to run the command seen in the systemd file for mailinabox to get the daemon running. I’m being dragged into 2018/19 finally with systemd but certainly not used to it yet.

krisladmin@mail:~$ cat /etc/systemd/system/mailinabox.service | grep -i exec

As a side note, I was thrown a curve ball by the nsd status check. That seems to use a test for TCP connectivity on port 53. Is that by design? I’ve left TCP 53 off on my firewall as I don’t think its needed, I’ll tolerate the error but hadn’t actually noticed that in a previous revision I don’t think, this is a pretty innocuous observation though!

Thanks for reading
Kris L

P.S. thanks to JoshData and other persons for delivering MIAB v0.40, it is a thing to behold and makes my life so much easier, my thanks to you all.

I figured this out in the end, so to assist anyone else who ends up with the same issue it was simply because I had /home mounted from a separate LV (my tests were not in a cloud VM, they are on-prem VMs). The issue is that systemd would appear to not have been able to locate /home/username/mailinabox/conf/mailinabox.service that was symlinked to /etc/systemd/system/mailinabox.service. I’ve moved that service file to a location in / that is mounted across reboots of course, and reenabled the service, and this has fixed the issue. I will obviously have to verify no changes are made to the service file should any update occur in the future, but at least I know why I saw this behaviour!

Kris L

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.