Skip to content

Instantly share code, notes, and snippets.

@carlhoerberg
Created December 14, 2011 11:13
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlhoerberg/1476172 to your computer and use it in GitHub Desktop.
Save carlhoerberg/1476172 to your computer and use it in GitHub Desktop.
Bootstrap a torquebox server
#....
export TORQUEBOX_HOME=/opt/torquebox-current
export JBOSS_HOME=$TORQUEBOX_HOME/jboss
export JRUBY_HOME=$TORQUEBOX_HOME/jruby
export PATH=$JRUBY_HOME/bin:$PATH
export JRUBY_OPTS='--1.9 -J-Xmx64m'
export JAVA_OPTS='-Xmx256m -Xms32m'
description "This is an upstart job file for apache mod_cluster"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /opt/jboss/httpd/sbin/httpd.prefork -D FOREGROUND
# prefork uses a lot less memory than worker (50mb vs 500mb)
apt-get update
apt-get upgrade
apt-get install openjdk-6-jre-headless
apt-get install wget
useradd -m torquebox
wget http://torquebox.org/release/org/torquebox/torquebox-dist/2.0.0.beta1/torquebox-dist-2.0.0.beta1-bin.zip
unzip torquebox-dist-2.0.0.beta1-bin.zip
mv torquebox-dist-2.0.0.beta1 /opt
chown -R torquebox:torquebox torquebox-dist-2.0.0.beta1
ln -s /opt/torquebox-current/ /opt/torquebox-dist-2.0.0.beta1
wget http://downloads.jboss.org/mod_cluster//1.1.3.Final/mod_cluster-1.1.3.Final-linux2-x86-ssl.tar.gz
tar zxvf http://downloads.jboss.org/mod_cluster//1.1.3.Final/mod_cluster-1.1.3.Final-linux2-x86-ssl.tar.gz
mv opt/jboss /opt
description "This is an upstart job file for torquebox"
pre-start script
bash << "EOF"
mkdir -p /var/log/torquebox
chown -R torquebox /var/log/torquebox
EOF
end script
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec su - torquebox -c '/opt/torquebox-current/jboss/bin/standalone.sh --server-config=standalone-ha.xml >> /var/log/torquebox/torquebox.log 2>&1'
@swistaczek
Copy link

Hi, thanks for sharing. I would like ask you how can I add upstart job for torquebox.conf?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment