1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00
mattermost_ynh/conf/systemd.service

25 lines
713 B
SYSTEMD
Raw Normal View History

[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'
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__
User=__APP__
Group=www-data
LimitNOFILE=49152
[Install]
WantedBy=multi-user.target