Need help with Debian Start Script
your options, for future reference, and people who randomly find this in google search, theres a few -very- easy options:
option 1: you have no experience in scripting, arent very into the whole linux world, and just want your server to be able to managed remotely
try MineOS: https://github.com/hexparrot/mineos
its absolute shit, but it works, is user friendly and powerful.
its basicly a web frontend that does the same thing as the (actually good) management panels that the big mc hosting companies use, and is free and opensource.
option 2: you got your linuxy penguinfeet a bit wet, got the hang of it and are ready to learn
(spoilered because mucho info)
try writing your own scripts (doesnt only apply to minecraft here, use this for any kind of server software)
first off, make a directory for your scripts, like ~/starters (~ = home directory, for example /home/manikyath) DO NOT USE ROOT FOR YOUR SERVER SOFTWARE, EVER.
second, install "screen" using the package manager for your distro ("apt-get install screen" for the debian/ubuntu folks, "pacman -Syu screen" for the arch folks, etc)
screen allows you to attach and detach terminal sessions, you'll read why you need this later.
next make your scripts in your scripts directory, according to what you need, examples follow:
what i called the "enter" script, this prints the available commands, and removes the need to type "./" before your commands. please note, "subfolder" is a replacement for an actual useful subfolder name, please replace, add or remove as needed.
#!/bin/bashcd ~/startersexport PATH=$PATH:.echo --{commands}----------------------lsecho --{subfolder commands}---------ls subfolderthe next script is what i've used for minecraft, gmod and a few other games for a while, all in the same basic format:
theres a tag where you can start a session detached, i personally choose not to, because i like to confirm my server is starting fine.
#!/bin/bashcd <insert server folder here, if minecraft server is located in /home/manikyath/servers/minecraft, thats exactly what needs to be typed here>screen -S <name of session, put something you'll recognise here, example: MC1710> <launch command, example: java -Xms256M -Xmx4G -jar minecraft1710.jar>next a utility i like to keep around:
"clearCache", a script to free up as much ram as possible, handy if your server has very little available resources.
#!/bin/bashsudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"finally i should explain how to use screen:
to make a session, you use screen -S <session name>
to detach from a session, hold left contol, then press A followed by D
to reattach to a detached session type screen -r <session name> (session name not required if only one session is running, screen is really smart at figuring out where you want to be)
to see the running sessions, type screen -ls
to exit a session, type exit. a session that was given a command at opening (like in the script we wrote) will exit automagicly when the command finishes.
---
now, you are gonna ask two things:
1: well, how do i manage my servers with this?
simple, you reattach to the server session, and are presented with full console access, and can detach when you're done.
2: how do i do this remotely?
install an SSD daemon on your server (opensssh-server for example, can be pre-installed on debian and ubuntu server)
use putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) to connect to your server.
whatever the linuxy folks say, i like putty, because it does what i need it to.
option 3: you know your way around linux (then you'd probably not be here, but you never know)
dig into the script pahimar uses on forgecraft, it does some pretty fancy voodoo, and i suggest digging into it if you want some advanced automation features.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now