Skip to content

Instantly share code, notes, and snippets.

@jclosure
Created December 16, 2015 20:10
Show Gist options
  • Save jclosure/19d9f2339f7f1785169a to your computer and use it in GitHub Desktop.
Save jclosure/19d9f2339f7f1785169a to your computer and use it in GitHub Desktop.
Start Vertx as a daemon on Linux
# If you are going to deploy say on a debian linux box with upstart you can use my script from the juju charm:
cat /etc/init/app_name.conf
description "app_name Vert.x server"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [!2345]
expect fork
respawn
script
cd /app_dir
exec /usr/local/bin/vertx runmod app_name -conf app_name.conf -instances 4 >> /var/log/vertx.log 2>&1 &
end script
# This will work on ubuntu, debian and others all you need is java7 installed and the zip of vert.x with a symlink to bin/vertx living in your /usr/local/bin/vertx (or change the path above in the exec stanza).
# Upstart will run your app as root, which is probably not what you want to run as a user do:
# exec sudo -u app_user /usr/local/bin/vertx runmod app_name -conf app_name.conf -instances 4 >> /var/log/vertx.log 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment