Author Topic: Systemd Start-Script  (Read 208 times)

UncleSam

  • JTS3ServerMod Internal
  • *****
  • Posts: 30
    • View Profile
Systemd Start-Script
« 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):
  • Restart always: if bot was stopped for any reasons other then 'service jts3servermod stop' or 'systemctl stop jts3servermod' it starts this service again
  • RestartSec 15: if the above happens it waits 15 seconds between crash and start
  • User: linux username the bot should run under
  • Group: not needed
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
« Last Edit: May 29, 2018, 10:40:46 AM by UncleSam »