Skip to content

Instantly share code, notes, and snippets.

@sargun
Created June 2, 2013 11:07
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sargun/5693318 to your computer and use it in GitHub Desktop.
Save sargun/5693318 to your computer and use it in GitHub Desktop.
New Upstart Script style
description "service"
start on filesystem
stop on runlevel S
respawn
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
limit nofile 1048576 1048576
setgid <%= owner %>
setuid <%= owner %>
script
exec /usr/bin/java \
$(sed -e '/^[ ]*\/\//d' -e 's|[ ]*//.*| |' -e 's|^| |' /etc/service.jvm.conf | tr -d "\n") \
-jar /opt/service/service.jar \
server /etc/service.yml \
>> /var/log/service/sysout.log 2>&1
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment