Skip to content

Instantly share code, notes, and snippets.

@kylef
Created February 9, 2011 21:36
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 kylef/819348 to your computer and use it in GitHub Desktop.
Save kylef/819348 to your computer and use it in GitHub Desktop.
init.d script for craftbukkit (minecraft server)
#!/bin/sh
# /etc/init.d/craftbukkit
USERGROUP="sam:sam"
CBPATH="/home/sam/.craftbukkit"
PIDFILE=$CBPATH/pidfile
case "$1" in
start)
cd $CBPATH
start-stop-daemon --start --make-pidfile --pidfile $PIDFILE --background --chuid $USERGROUP --verbose --name craftbukkit --exec /usr/bin/java -- -Xms1024M -Xmx1024M -jar craftbukkit.jar nogui
cd /etc/init.d
;;
stop)
start-stop-daemon --stop --pidfile $PIDFILE --verbose --name craftbukkit
rm $PIDFILE
;;
*)
echo "Usage: /etc/init.d/craftbukkit {start|stop}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment