I am running a little minecraft server.
I want Lubuntu to execute the following script when the server boots up. NOT on login, and NOT on restart (unless it's starting up of course).
The script is currently located in:
/home/mc/server/craftbukkit.sh
I can manually launch the script by just going into the dir and typing ./craftbukkit.sh
. But I want to fire off the script when the machine boots.
Best Answer
I run a minecraft server from a debian terminal, and this is probably the wrong way to do it, but it works. First,
sudo apt-get install screen
, then save the following script as/etc/init.d/minecraft
:Now, run the following commands as root:
update-rc.d -f minecraft defaults
This will make the minecraft server run in the background when the system boots. To view the console, run
screen -x minecraft
in a terminal. To quit the console, press Ctrl+A and then D.