2017-10-12 12:47:51 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Mattermost
|
|
|
|
After=network.target
|
|
|
|
After=mysql.service
|
|
|
|
Requires=mysql.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
ExecStart=__FINALPATH__/bin/platform
|
|
|
|
# HACK: Wait for Mattermost port to be open before declaring the service to be launched successfully.
|
|
|
|
# This avoids to report the service as launched even when it crashes a few milliseconds after start.
|
|
|
|
#
|
|
|
|
# TODO: improve mattermost to send a STARTED notification, and
|
|
|
|
# switch the service to 'Type=notify' instead.
|
2018-01-29 13:40:03 +01:00
|
|
|
ExecStartPost=/usr/bin/timeout 10 /bin/sh -c 'while ! nc -z localhost __PORT__; do sleep 0.2; done'
|
2017-10-12 12:47:51 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
|
|
|
WorkingDirectory=__FINALPATH__
|
|
|
|
User=__APP__
|
|
|
|
Group=www-data
|
|
|
|
LimitNOFILE=49152
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|