Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*Feature Request* support with spigot restart command #144

Open
soulgriever opened this issue Jul 24, 2013 · 17 comments
Open

*Feature Request* support with spigot restart command #144

soulgriever opened this issue Jul 24, 2013 · 17 comments

Comments

@soulgriever
Copy link

Spigot/mcpc+ has an option to run an automated script to restart the server on the event of a crash or if the "restart" command is given, I would like to know if there is any way to make it compatible with minecraft-init I have tried several things with no sucess

@Leopere
Copy link

Leopere commented Aug 19, 2013

@soulgriever could you document here what "several things" means? I would consider writing a .sh script that includes the service minecraft stop service minecraft start etc. or some more advanced version of this.

@soulgriever
Copy link
Author

I tried writing a sh script that passed the command for it to start the server (ex. /etc/init.d/minecraft start), wrote an sh script that passed the command for it to restart the server (ex. /etc/init.d/minecraft restart) I honestly dont rember what else I did its been a bit

@Leopere
Copy link

Leopere commented Aug 20, 2013

OK fair enough have you tried service minecraft restart I've not tried this at all myself I'm also curious as to what works and may not.

@queketth
Copy link

Does this script work with spigot servers ?

@Leopere
Copy link

Leopere commented Oct 28, 2013

It will if you add it to the config just replace bukkit.jar with spigot.jar

@alfonsojon
Copy link

I believe the OP is looking for native Spigot integration so that when Spigot detects it has crashed, it can use this script to automatically restart it. I will be working on this.

@Leopere
Copy link

Leopere commented Feb 25, 2014

That would be lovely I would be very happy with this concept. Would you also be able to make an if-down-up kind of thing? That would be super phenomenal.

@alfonsojon
Copy link

It would be. I'm working on it here: https://github.com/alfonsojon/minecraft-init

@soulgriever
Copy link
Author

Let me know when its done. Might be adding minecraft-init back to my server. Simple but yet the best ive used yet. Also might want to state mcpc+ as well if its supported (spigot is built into mcpc+)

@soulgriever
Copy link
Author

if/when this functionality is incorporated how would it be executed? if the server crashes spigot detects it has crashed and attempts to run a script would I just make a shell script with "/etc/init.d/minecraft restart" but the problem is the execution spigot starts the new server before exiting the old one, so for this to work you would have to have some sort of sleep command

@Leopere
Copy link

Leopere commented Feb 28, 2014

Its already incorporated you can view it on @alfonsojon's github repo he linked. You don't have to wait for it to be accepted.

@soulgriever
Copy link
Author

@Chamunks It is not incorperated all he did was add an update function for spigot, this has nothing to do with the restart support he was talking about, and as he said above he "would be working on it" never said it was done

@Leopere
Copy link

Leopere commented Feb 28, 2014

@soulgriever If no one else does it I'll have someone do it by tomorrow because I'm tired of not having this feature myself.

@soulgriever
Copy link
Author

to make it work simply set your start.sh to the following

#!/bin/bash
screen -X -S minecraft quit
screen -S Temp -d -m /etc/init.d/minecraft restart

that took way to long to figure out

@Leopere
Copy link

Leopere commented Feb 28, 2014

@soulgriever Not sure if this is exactly what you're looking for but with this PR #160 you can run a cronjob every X amount of time that will autoboot your server if its dead. So it may not be start.sh support but you might even be able to add a start.sh that supports this in some way. Just grab the init off of my repo. It also includes the spigot.jar support etc.

@Leopere
Copy link

Leopere commented Mar 1, 2014

Theres some bugs with my pull request don't use it just yet.

@alfonsojon
Copy link

@soulgriever @Chamunks My fork is now much more compatible with Bukkit and Spigot. I'm currently looking for Spigot documentation on this, as it doesn't seem especially clear as to how this would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants