Stefan1200's Forum

English => JTS3ServerMod Projects and Scripts from other people => Topic started by: UncleSam on May 29, 2018, 10:39:14 AM

Title: Systemd Start-Script
Post by: UncleSam on May 29, 2018, 10:39:14 AM
Hi there,
if you want you can use my start/stop script for Systemd:
1. Create a new file:
Code: [Select]
/lib/systemd/system/jts3servermod.service2. Fill it like this sample:
Code: [Select]
[Unit]Description=JTS3ServermodAfter=network.target[Service]
PIDFile=/path/to/JTS3ServerMod_HostingEdition/jts3servermod.pid
WorkingDirectory=/path/to/JTS3ServerMod_HostingEdition/
ExecStart=/usr/bin/java -Xms1G -Xmx2G -jar JTS3ServerMod.jar
Type=simple
Restart=always
RestartSec=15
User=botusername
Group=botgroupname

[Install]
WantedBy=multi-user.target
Description (just of some entries):3. enable it to auto start
Code: [Select]
systemctl daemon-reload
systemctl enable jts3servermod.service
4. Have fun :-)
Code: [Select]
service jts3servermod start/stop/restartImage already added
Title: Re: Systemd Start-Script
Post by: VeLutIon on June 06, 2020, 01:40:43 PM
Hi, I did it exactly as you explained it. However, I get an error. Here is the mistake. Can you help me with my problem

‚óŹ jts3servermod.service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Jun 06 13:33:47 VeLutIon systemd[1]: [/lib/systemd/system/jts3servermod.service:1] Unknown section 'Unit]Description=JTS3ServermodAfter=network.target[Service'. Ignoring.
Jun 06 13:33:47 VeLutIon systemd[1]: jts3servermod.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 06 13:33:49 VeLutIon systemd[1]: [/lib/systemd/system/jts3servermod.service:1] Unknown section 'Unit]Description=JTS3ServermodAfter=network.target[Service'. Ignoring.
Jun 06 13:33:49 VeLutIon systemd[1]: jts3servermod.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 06 13:36:37 VeLutIon systemd[1]: [/lib/systemd/system/jts3servermod.service:1] Unknown section 'Unit]Description=JTS3ServermodAfter=network.target[Service'. Ignoring.
Jun 06 13:36:37 VeLutIon systemd[1]: jts3servermod.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 06 13:36:47 VeLutIon systemd[1]: [/lib/systemd/system/jts3servermod.service:1] Unknown section 'Unit]Description=JTS3ServermodAfter=network.target[Service'. Ignoring.
Jun 06 13:36:47 VeLutIon systemd[1]: jts3servermod.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 06 13:36:53 VeLutIon systemd[1]: [/lib/systemd/system/jts3servermod.service:1] Unknown section 'Unit]Description=JTS3ServermodAfter=network.target[Service'. Ignoring.
Jun 06 13:36:53 VeLutIon systemd[1]: jts3servermod.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.