1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Server Help Is it safe to stop a server with the kill command?

Discussion in 'Multiplayer' started by Firan, Jan 31, 2017.

  1. Firan

    Firan Void-Bound Voyager

    I have a personal server to play with friends on Ubuntu 16.04, and I'm wondering if using the "kill $pid" command is safe to use to shutdown the server. I know control + c works fine, but I'm trying to automate the process. When I stop the server with the kill command, there's nothing about a shutdown in the logs, as opposed to the control + c way of doing it.

    Just wondering if there's a risk of my world going corrupt and losing data if I use kill instead of control + c.

    Thanks!
     
  2. lazarus78

    lazarus78 The End of Time

    Its possible it could corrupt things, though I don't think it is likely. Just do regular backups and you should be fine.

    You could just automate the key-press too, unless you have it running the process in the background.
     
  3. Firan

    Firan Void-Bound Voyager

    Ooh I didn't know that was possible!
    How would I go about automating the key press?
     
  4. Sprvrn

    Sprvrn Industrial Terraformer

    If you want to automate the process, a rcon request "stop" is probably the cleanest way to stop a server.
    I'm using this rcon client: https://gist.github.com/Dunto/e310c00e84b98e0e90dd
    You will have to configure the client (check the readme) and starbound_server.config to accept rcon requests. Then a simple "python rcon_client.py stop" will gracefully shut your server down.
     
    Firan likes this.
  5. lazarus78

    lazarus78 The End of Time

    I don't know if Ubuntu has it, but I use "xdotool" with some Raspberries for automated page refresh for a specific project I did.

    The above method would probably be better. Im no linux guru so I don't know exactly how a lot of it works.
     
  6. Firan

    Firan Void-Bound Voyager

    Thanks so much, that worked beautifully! I'll probably try to use RCON with other servers now ^-^
     
    Sprvrn likes this.
  7. Firan

    Firan Void-Bound Voyager

    I tried Sprvrn's solution and it worked really well, so I'll stick to that, but thanks a lot for the help!
     
    lazarus78 likes this.

Share This Page