I'll share my SystemD service Config. When he is don't need a startscript. Works fine for me.
When you need to creating SystemD service we must create a file. In this case we're going to writting this command:
nano /usr/lib/systemd/system/jts3servermod.service
and copy all script include changes on: WorkingDirectory, ExecStart and User. It is just important where is our files and .jar file as our launcher.
After changeing script and source files we saving file content. And all is done.
Everything when we should doing to launching script is 2 important commands.
1. we need enable service by command: systemctl enable jts3servermod
2. now time to launching our service writting: systemctl start jts3servermod
And that's all.
ps. Everything about SystemD services can be found here
When you need to creating SystemD service we must create a file. In this case we're going to writting this command:
nano /usr/lib/systemd/system/jts3servermod.service
and copy all script include changes on: WorkingDirectory, ExecStart and User. It is just important where is our files and .jar file as our launcher.
Code Select
[Unit]
Description=JTS3ServerMod
After=network.target
[Service]
WorkingDirectory=/home/ts3bot
User=ts3bot
ExecStart=java -mx30M -jar /home/ts3bot/JTS3ServerMod.jar &
TimeoutSec=300
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
After changeing script and source files we saving file content. And all is done.
Everything when we should doing to launching script is 2 important commands.
1. we need enable service by command: systemctl enable jts3servermod
2. now time to launching our service writting: systemctl start jts3servermod
And that's all.
ps. Everything about SystemD services can be found here