gstriada.blogg.se

Repetier server init.d script
Repetier server init.d script












repetier server init.d script
  1. REPETIER SERVER INIT.D SCRIPT INSTALL
  2. REPETIER SERVER INIT.D SCRIPT OFFLINE

Then we can use screen to connect to the the Minecraft console screen -r minecraft-server, now we can type a command for the server to stop either stop or restart, these can also be used in-game in the same way (remember to prepend the / when in-game, the console always does this for you). Now we can test this works, in case the service has already been started, we can create a new process using systemctl restart minecraft even if there wasn't a process for this service, it will create a new one.

  • ExecStop the command to run to kill the service.
  • ExecStart the comand to run to start the service.
  • The Minecraft init script will create this on startup.
  • PIDFile the path to a PID file for the main process, this should only contain the PID and will be removed when the process is shutdown, but will never be written to by systemd.
  • RemainAfterExit whether the service should be considered as active even after it processes has exited.
  • RestartSec is how long it should wait before starting the service again after shutdown.
  • TimeoutSec is the timeout for a failed start before it tries to start again.
  • Restart has several options, I choose always so no matter how the process dies, it will 'always' be restarted.
  • repetier server init.d script

  • SourcePath is the absolute path to the init script.
  • Most of this is auto created for you, but there may be a few options you'll want to change and add, so I'll go through a few of the options. PIDFile=/home/MyUser/minecraft/minecraft-server.pid I configured mine like this: # Automatically generated by systemd-sysv-generatorĭocumentation=man:systemd-sysv-generator(8) Here you'll be able to edit the parameters. Then you'll probably want to edit the unit file that gets created for you, you can do this with systemctl edit -full rvice, this will open a text editor (nano in my case, I didn't get to choose). To start, you'll need to run this systemctl enable rvice.

    REPETIER SERVER INIT.D SCRIPT INSTALL

    The following will assume one has completed the install steps for Ahtenus' init script for Minecraft/Bukkit servers (this also works perfectly fine for my Spigot server). This is probably not the best resource to use since it doesn't tell you if the particular option should be placed under, or, but nevertheless, it tells you about the key options needed.įollow along for users with a similar issue With a quick read around I was able to find some nice information on systemd unit files.

    repetier server init.d script

    Thanks to comment, I now have a solution! /etc/inittab doesn't exist on Ubuntu 16.04, but /etc/systemd does which means the solution is a bit different than what it would have been initially. This allows me to start, stop, restart the Minecraft server along with various other commands to control the Minecraft server. Looking at my zzz.log file I can see the problem lays around the exec /etc/init.d/minecraft start command, this line is never successfully executed when Minecraft executes the restart.sh script.

    repetier server init.d script

    When in-game if I type /restart the Minecraft server shuts down like its supposed to, but never re-launches again. restart.sh the server starts up perfectly fine.

    REPETIER SERVER INIT.D SCRIPT OFFLINE

    Now, if the Minecraft server is offline and I execute. Since I do not know how the script is invoked, I assumed this could be a child process of the Minecraft server and thus if the Minecraft server process dies, the script will too, having it this way should ensure the command is run. Sleep(5) as it suggests will make the script pause for 5 seconds, this is just to ensure Minecraft has had enough time to shutdown.Įxec will make the following command /etc/init.d/minecraft start run in a different process. Set -x is also another part to help me figure what's going on, this will output each line that is executed into zzz.log because the above lines redirect the output to there. The first two lines will redirect standardout and standarderror (as Linux fluent users will already know) into the zzz.log file, this is just so I can capture the output to help me figure what's going on. I'm attempting to make a restart script for my Minecraft server so my friends can use the /restart command in-game because they don't have SSH access to my server to restart Minecraft.Ĭurrently my restart.sh script contains exec > zzz.log














    Repetier server init.d script