listmonk
listmonk copied to clipboard
Systemd service fails to start
Version: v2.4.0 OS: Ubuntu 22.04
Description of the bug
The systemd service created with the [email protected] file fails to start.
Steps to reproduce
- Make sure that the listmonk binary is at
/usr/bin/listmonk
and that the config file is at/etc/listmonk/mailer.toml
- Download the [email protected] file in /etc/systemd/system
cd /etc/systemd/system
wget https://raw.githubusercontent.com/knadh/listmonk/c10c03178ba6da1e2f8cb61f624b4e691c85af27/listmonk%40.service
- Load the [email protected] file
systemctl daemon-reload
- Try to start the listmonk service
systemctl start listmonk@mailer
Expected result
Listmonk should start. It should start sending emails and the dashboard should become available.
This is the result you get when using Listmonk v2.3.0.
Actual result
The dashboard and listmonk itself don't start. You get the following error:
Job for [email protected] failed because a fatal signal was delivered causing the control process to dump core. See "systemctl status [email protected]" and "journalctl -xeu [email protected]" for details.
Proposed fix
#1309
Can you post the complete logs under journalctl -xeu [email protected]
?
Could this be related to this? https://github.com/NixOS/nixpkgs/issues/197443
As requested, here is the output from journalctl -xeu [email protected]
after trying to start listmonk with @resources disallowed: journal.txt
In order to investigate this further, I have added SystemCallLog=@resources
to both the systemd service files. This allowed me to get logs of any system calls attempted by listmonk that are part of the @resources group.
When running listmonk with @resources allowed, I noticed the following lines in the resulting log file:
May 9 16:41:54 lm kernel: [ 255.860803] audit: type=1326 audit(1683664914.251:36): auid=4294967295 uid=63407 gid=63407 ses=4294967295 subj=unconfined pid=1097 comm="listmonk" exe="/usr/bin/listmonk" sig=0 arch=c000003e syscall=160 compat=0 ip=0x40394e code=0x7ffc0000
May 9 16:41:54 lm kernel: [ 256.036426] audit: type=1326 audit(1683664914.427:37): auid=4294967295 uid=63407 gid=63407 ses=4294967295 subj=unconfined pid=1103 comm="listmonk" exe="/usr/bin/listmonk" sig=0 arch=c000003e syscall=160 compat=0 ip=0x40394e code=0x7ffc0000
With @resources disallowed, I see similar lines, but more of them.
It looks like the culprit is system call 160 (setrlimit). This is the same system call as in the other case found by @rhnvrm. I believe that upgrading to Go 1.19 was the reason that this system call gets used by v2.4.0.
Version: v2.4.0 OS: Ubuntu 22.04
Description of the bug
The systemd service created with the [email protected] file fails to start.
Indeed, to run Listmonk as systemd service was not so easy, it failed many times until I removed a few lines from .service (see below). OK, my Ubuntu is not the latest one, but still, it should be supported. Here the software versions:
Ubuntu 18.04.2 LTS
systemd 237
listmonk v2.4.0 (c668523 2023-03-20T13:50:31Z) (just the binary, without Docker)
I managed to run Listmonk by removing a few things from the .service file My service file attached (renamed to listmonk.service.txt - otherwise github does not allow it): listmonk.service.txt ...it might be useful when you decide to support older Ubuntu versions I removed these lines (and may be something else) and added a few minor things:
SystemCallFilter=
DeviceAllow=
By the way, when troubleshooting systemd issues - always specify the systemd version! Many systems have old systemd - it just does not know about the latest features/parameters in .service file!
This is still broken, why was it closed?
Providing the proper reference for the fix, https://github.com/knadh/listmonk/pull/1309
Hi @gdevenyi. There's an open PR (unresolved) pertaining to this: https://github.com/knadh/listmonk/pull/1614
I've been unable to delve into the nuances of this issue, unfortunately. Would be happy to merge a PR that addresses the unresolved issues.