Skip to content

Instantly share code, notes, and snippets.

@lordastley
Created October 25, 2014 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lordastley/d2f3a328a8722b6373b4 to your computer and use it in GitHub Desktop.
Save lordastley/d2f3a328a8722b6373b4 to your computer and use it in GitHub Desktop.
# Since this is Upstart 0.6.5,
# setuid, setgid, console directives do not work.
# I'm using daemonize to compensate.
# see http://software.clapper.org/daemonize/daemonize.html
# daemonize forks once, so 'expect fork' is needed
description "An Upstart 0.6.5 script for running a headless minecraft server"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
chdir /srv/minecraft
respawn
# optional respawn limit
#respawn limit 20 5
expect fork
exec daemonize -c /srv/minecraft -u [user-goes-here] /usr/bin/java -server -d64 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelGCThreads=4 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:SurvivorRatio=16 -Xnoclassgc -XX:UseSSE=3 -Xmx1024M -Xms1024M -jar minecraft_server.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment