Git maybe hard but upstart at least is easy

I needed to have my minecraft server auto start when the server was powered on so after a couple of hours and lots or trial and error I found this helpful site and 5 minutes later my minecraft server was auto starting below is the final code used in my upstart script.

 bash | 
 
 copy code |
?

1
description "Start minecraft server upstart job"
2
start on (local-filesystems and net-device-up and runlevel [2345])
3
stop on runlevel [016]
4
chdir /home/$USERNAME/minecraft
5
script
6
su<!--DVFMTSC--> $USERNAME -c "screen -d -m -S minecraft_server java -Xmx1024M -Xms1024M -jar craftbukkit.jar"
7
end script

Leave a Reply

Your email address will not be published. Required fields are marked *