1
smartermail.service starts and promptly crashes on Ubuntu 20.04.6 LTS
Problem reported by ALEKSEY ANISIMOV - 10/11/2024 at 11:11 PM
Resolved
Hi all,

trying to evaluate - haven't touched SmarterMail for many years, glad to see that the product and community seems to be going strong! 

Installation went OK on this 

Ubuntu VERSION="20.04.6 LTS (Focal Fossa)"
Linux 5.4.0 #1 SMP Wed Jul 12 12:00:44 MSK 2023 x86_64 x86_64 x86_64 GNU/Linux

now the 9998 port is not accessible and upon checking surely enough the service is in failed state

● smartermail.service                                      loaded failed failed    SmarterMail (100.0.9049.27988)

tried starting it - it runs for a little bit, but then crashes.

checked for common locations for logs etc - can't find much, please halp ! 

root@server:~# systemctl status smartermail.service
● smartermail.service - SmarterMail (100.0.9049.27988)
     Loaded: loaded (/etc/systemd/system/smartermail.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2024-10-12 05:59:53 UTC; 3s ago
   Main PID: 661 (MailService)
      Tasks: 14 (limit: 19660)
     Memory: 147.5M
     CGroup: /system.slice/smartermail.service
             └─661 /opt/smartermail/MailService

Oct 12 05:59:53 server-10* systemd[1]: Started SmarterMail (100.0.9049.27988).
Oct 12 05:59:53 server-10* MailService[661]: Starting...
Oct 12 05:59:54 server-10* MailService[661]: [WebServer] Listening on port 80 and 443

root@server:~# systemctl status smartermail.service
● smartermail.service - SmarterMail (100.0.9049.27988)
     Loaded: loaded (/etc/systemd/system/smartermail.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Sat 2024-10-12 05:59:59 UTC; 2s ago
    Process: 661 ExecStart=/opt/smartermail/MailService (code=killed, signal=ABRT)
   Main PID: 661 (code=killed, signal=ABRT)

Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boo>
Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
Oct 12 05:59:59 server-10* MailService[661]:    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
Oct 12 05:59:59 server-10* MailService[661]:    at SmarterMail.Program.Main(String[] args)
Oct 12 05:59:59 server-10* systemd[1]: smartermail.service: Main process exited, code=killed, status=6/ABRT
Oct 12 05:59:59 server-10* systemd[1]: smartermail.service: Failed with result 'signal'.

5 Replies

Reply to Thread
1
Alain Wegmann Replied
I believe on Linux Smartermail will run on ports 80 and 443 (http and https) not 9998. Do you have another service that uses those ports? What does 
sudo lsof -i 
show after the crash?
0
ALEKSEY ANISIMOV Replied
thanks Alain ! ah OK, I thought management interface was the same

default Apache shows up on http and here is lsof output below

gotta be able to somehow troubleshoot the service start - are there any logs or debug output flags? 

# lsof -i
COMMAND    PID            USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
sshd       298            root    3u  IPv4 1682757523      0t0  TCP *:ssh (LISTEN)
sshd       298            root    4u  IPv6 1682757540      0t0  TCP *:ssh (LISTEN)
apache2    299            root    4u  IPv6 1682776824      0t0  TCP *:http (LISTEN)
apache2    304        www-data    4u  IPv6 1682776824      0t0  TCP *:http (LISTEN)
exim4      595     Debian-exim    3u  IPv4 1682791489      0t0  TCP localhost:smtp (LISTEN)
exim4      595     Debian-exim    4u  IPv6 1682776854      0t0  TCP localhost:smtp (LISTEN)
systemd-r  635 systemd-resolve   12u  IPv4 1682779738      0t0  UDP 127.0.0.53:domain
systemd-r  635 systemd-resolve   13u  IPv4 1682779741      0t0  TCP 127.0.0.53:domain (LISTEN)
sshd      7188            root    4u  IPv4 1713134814      0t0  TCP server-10*:ssh->103.46.220.251:22293 (ESTABLISHED)
1
Sébastien Riccio Replied
Marked As Resolution
The built-in webservcie of SmarterMail tries to bind http ports 80 and 443 that are already used by your apache2 process:
Oct 12 05:59:54 server-10* MailService[661]: [WebServer] Listening on port 80 and 443
Also in your lsof I see that exim is running, which is a mail service, so it also binds on the port required for SmarterMail:
exim4      595     Debian-exim    4u  IPv6 1682776854      0t0  TCP    localhost:smtp (LISTEN)
I would stop these services and then restart SmarterMail.

systemctl stop apache2
systemctl stop exim4
systemctl restart smartermail
Then check the status of smartermail
systemctl status smartermail
If everything is running fine, you should disable automatic startup of  apache2 and exim4
systemctl disable apache2
systemctl disable exim4
Hope this helps.

Sébastien Riccio System & Network Admin https://swisscenter.com
1
ALEKSEY ANISIMOV Replied
awesome advice, thank you Sebastien ! 

I've done that and that was it - at least I can see the management interface now on port 80 - looks neat and tidy, nice 

for anyone from KB/docs etc teams - perhaps worth adding a note about Linux admin being on standard port here - help dot smartertools com/SmarterMail/Current/Topics/SystemAdmin/LoggingIn - or maybe there is a whole separate section for Linux edition?

0
Jorel Haggard Replied
Employee Post
Aleksey,

I think this article is a bit more geared toward the first-time setup and admin login for Linux: https://help.smartertools.com/SmarterMail/Current/Topics/Installation/Installation-Linux

The admin login (and webmail interface as a whole) should be available on localhost through 9998 (and/or 17017) like you initially suspected. SM will only use the standard ports as well if you opted to use the built-in web server (which is Kestrel, rather than Apache). When installing SM on Linux, there's some convenient output that tells you which ports SM is listening on (for admin & user interfaces), which you'll see after you make your decision on the built-in web server. 

When already using a web server on standard ports, you're going to see SM service fail to start if you opt to use the built in web server. If you had opted NOT to use the built in web server, then I believe this would've started up no problem, and your attempt at reaching SM on 9998 (or 17017) would've succeeded. Again, when you install for the first time, it should tell you which ports are listening. 

I hope this is helpful, if you have any other questions feel free to reach out. 
Jorel Haggard System/Network Administrator SmarterTools Inc. www.smartertools.com

Reply to Thread