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
Pierre de La Morinerie e8c51d4715 scripts: use systemd rather than supervisor
Systemd is now the standard way of doing services in
Yunohost. It also avoids to install an extra dependency.

Fix #43
2017-10-16 09:05:21 +05:30

24 lines
709 B
Desktop File

[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.
ExecStartPost=/usr/bin/timeout 10 /bin/sh -c 'while ! nc -z localhost 8065; do sleep 0.2; done'
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__
User=__APP__
Group=www-data
LimitNOFILE=49152
[Install]
WantedBy=multi-user.target