Files to replace on update
#9
(12-19-2015, 12:06 PM)Zee1234 Wrote:
(12-19-2015, 11:12 AM)Rekuen Wrote:
(12-19-2015, 06:04 AM)bearbin Wrote: How are you stopping the server? Are you piping in a message or sending a kill signal?

If you're sending a message then you can just send in "say message".

Right now I'm just killing the signal to stop the server, i search for the cuberite detached screen pid and send a kill signal. I supposed there is a better way to stop the server, is a wip so I'm open to suggestions.

Should be able to use
Code:
screen {your stuff} -x exec stop`printf(\\n)`

Unless your screen doesn't support that syntax/I'm outdated (shouldn't be since I checked this a few weeks ago and screen's a fairly stable program), or I'm remembering wrong.

Thanks, it wasn't exactly like that but I got it working, the only thing left is to know what files to preserve, or not to override from the tar in every update.

So far this is what I got:

Debian based service/daemon:

service cuberite start -> check for updates and starts the server
service cuberite stop -> stops the server instantly, without warning the users.
service cuberite restart -> stops the server instantly, updates the server, and launch it again.

service cuberite update -> Sends a warning message to the users online through chat, that the server is going down for maintenance in 5 minutes. Every minute sends another message. Once the 5 minutes has passed it stops the server, check for updates, and relaunchs the server.


Restart and update, is the same thing, but one is for development/testng servers so to speak, and the other for production servers with players in it.

The other part are the cronjobs, as said before, one checks every X minutes that the server is online, if not, checks for updates, and starts the server again.

The other cronjob is the one that executes the update command of the service at the time of your preference, every day, at 06:00 AM for example.

Combining the two, cron and service one could forget about being constantly monitoring the server.


TODO: make an install script, that checks dependencies like screen, installs them, copy the service to init.d and update update-rc.d and asks you some questions to set up the cronjobs.

If people is interested I can adapt it to fedora or other distributions, and I'm open to suggestions, once I have it polished i will publish it on github.

Thanks again and sorry for my English.
Reply
Thanks given by:


Messages In This Thread
Files to replace on update - by Rekuen - 12-19-2015, 02:35 AM
RE: Files to replace on update - by bearbin - 12-19-2015, 02:56 AM
RE: Files to replace on update - by Rekuen - 12-19-2015, 03:02 AM
RE: Files to replace on update - by Rekuen - 12-19-2015, 05:29 AM
RE: Files to replace on update - by bearbin - 12-19-2015, 06:04 AM
RE: Files to replace on update - by Rekuen - 12-19-2015, 11:12 AM
RE: Files to replace on update - by Zee1234 - 12-19-2015, 12:06 PM
RE: Files to replace on update - by Rekuen - 12-19-2015, 11:07 PM
RE: Files to replace on update - by xoft - 12-19-2015, 09:00 PM
RE: Files to replace on update - by bearbin - 12-19-2015, 11:38 PM
RE: Files to replace on update - by Rekuen - 12-20-2015, 12:02 AM
RE: Files to replace on update - by LogicParrot - 12-21-2015, 07:22 AM



Users browsing this thread: 3 Guest(s)