Autostart service not running on Ubuntu

Summary

Autostart service not running on Ubuntu

Steps to reproduce

Expected behavior

I cannot access the Mattermost server when it is run as a service!

Observed behavior

“invalid curl: (7) Failed to connect to localhost port 8065: Connection refused”

sudo systemctl status mattermost.service

  • mattermost.service - Mattermost
    Loaded: loaded (/lib/systemd/system/mattermost.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) since Sat 2017-01-21 12:01:27 UTC; 4s ago
    Process: 2280 ExecStart=/opt/mattermost/bin/platform (code=exited, status=0/SUCCESS)
    Main PID: 2280 (code=exited, status=0/SUCCESS)

If you can start it with sudo -u mattermost /.platform but not when as a service, then maybe something is wrong with /lib/systemd/system/mattermost.service.

When you created mattermost.service file, did you replace these two lines:

After=postgresql.service
Requires=postgresql.service

with

After=mysql.service
Requires=mysql.service