Create a service to auto start fivem server

Hello,

I create a fivem server and i want create a service to auto my server when my debian start. I created a service called fivem,
Here is the content:

[Unit]
Description=fivem
After=network.target

[Service]
WorkingDirectory=/home/fivem/

User=fivem
Group=fivem

Restart=always

ExecStart=/usr/bin/screen -DmS fivem ./run.sh +exec ./server-data/server.cfg
ExecStop=kill fivem

[Install]
WantedBy=multi-user.target

Buuut the server does not start I do not understand I try to see with: screen -ls and netstat -ntpul

Futhers informations:
root@debian:~# systemctl start fivem.service
root@debian:~# netstat -ntpul
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 795/sshd
tcp6 0 0 :::22 :::* LISTEN 795/sshd
root@vmi278249:~# systemctl status fivem.service
● fivem.service - fivem
Loaded: loaded (/etc/systemd/system/fivem.service; enabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Thu 2019-07-04 23:35:19 CEST; 11s ago
Process: 10589 ExecStart=/usr/bin/screen -DmS fivem ./run.sh +exec ./server-data/server.cfg (code=exited, status=0/SUCCESS)
Main PID: 10589 (code=exited, status=0/SUCCESS)

Jul 04 23:35:19 debian systemd[1]: fivem.service: Service hold-off time over, scheduling restart.
Jul 04 23:35:19 debian systemd[1]: Stopped fivem.
Jul 04 23:35:19 debian systemd[1]: fivem.service: Start request repeated too quickly.
Jul 04 23:35:19 debian systemd[1]: Failed to start fivem.
Jul 04 23:35:19 debian systemd[1]: fivem.service: Unit entered failed state.
Jul 04 23:35:19 debian systemd[1]: fivem.service: Failed with result ‘start-limit-hit’.

Can you help me, please?
Thank you in advance

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the FiveM community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.