Let's say you have a JRuby app running on an EC2 server and you want to connect to it remotely with VisualVM.

You might end up with an init script that looks like the following. This is just here for posterity's sake :) Hope some internet traveller finds this helpful sometime.

exec su - deployer -c 'cd /home/deployer/apps/xxx/current; export PORT=5000; export XXX_ENV=production;  exec bundle exec ruby -J-Djava.rmi.server.hostname=ec2-54-244-248-243.us-west-2.compute.amazonaws.com -J-Dcom.sun.management.jmxremote -J-Dcom.sun.management.jmxremote.port=12998 -J-Dcom.sun.management.jmxremote.authenticate=false -J-Dcom.sun.management.jmxremote.ssl=false -J-Djava.security.policy=/usr/lib/jvm/java-7-oracle/bin/jstatd.all.policy -J-Dcom.sun.management.jmxremote.local.only=false -J-Xms1024m -J-Xmx2048m lib/server.rb >> /home/deployer/apps/xxx/shared/log/websockets-1.log 2>&1'

Josh Adams is a developer and architect with over eleven years of professional experience building production-quality software and managing projects. Josh is isotope|eleven's lead architect, and is responsible for overseeing architectural decisions and translating customer requirements into working software. Josh graduated from the University of Alabama at Birmingham (UAB) with Bachelor of Science degrees in both Mathematics and Philosophy. He runs the ElixirSips screencast series, teaching hundreds of developers Elixir. He also occasionally provides Technical Review for Apress Publishing, specifically regarding Arduino microprocessors. When he's not working, Josh enjoys spending time with his family.