Parent: [9af2cf] (diff)

Child: [1baf65] (diff)

Download this file

start_allura    51 lines (43 with data), 1.2 kB

#!/bin/bash
# Starts Allura platform services

# Activate Allura virtualenv
. /home/vagrant/anvil/bin/activate

# Create log dir
if [ ! -d /var/log/allura ]
then
    sudo mkdir -p /var/log/allura
    sudo chown vagrant:vagrant /var/log/allura
fi
echo "Logs are in /var/log/allura"

# Start solr
if pgrep -f solr.*start.jar >/dev/null
then
    echo "Solr is running."
else
    echo "Starting Solr..."
    cd /home/vagrant/src/apache-solr-1.4.1/example
    nohup java -Dsolr.solr.home=/home/vagrant/src/forge/solr_config -jar start.jar >/var/log/allura/solr.log 2>&1 &
fi

cd /home/vagrant/src/forge/Allura

# Start taskd
if pgrep -f "paster taskd" >/dev/null
then
    echo "Taskd is running."
else
    echo "Starting taskd..."
    nohup paster taskd development.ini >/var/log/allura/taskd.log 2>&1 &
fi

# Run setup-app
if [ ! -f /var/lib/mongodb/allura.0 ]
then
    echo "Initializing database..."
    paster setup-app development.ini >/var/log/allura/setup-app.log 2>&1
fi

# Start the web server
if pgrep -f "paster serve" >/dev/null
then
    echo "Web server is running."
else
    echo "Starting web server (port 8080 by default) ..."
    nohup paster serve --reload development.ini >/var/log/allura/allura.log 2>&1 &
fi