#!/usr/bin/env bash # # Configures the environment and launches our unicorn server. # # This assumes that it's launched as the helixwebservices user account. If it # isn't you'll probably run into problems. path=<%= install_dir %>/embedded/bin:$PATH config=<%= install_dir %>/embedded/service/helix_web_services/config/unicorn.rb HWS_PORT=9000 HWS_STDOUT_PATH=/var/log/perforce/helix_web_services/out HWS_STDERR_PATH=/var/log/perforce/helix_web_services/err RUNAS='sudo -u helixwebservices' if [ "$USER" -eq 'helixwebservices' ]; then RUNAS='' fi cd <%= install_dir %>/embedded/service/helix_web_services $RUNAS env -i \ PATH=$path \ HWS_STDOUT_PATH=$HWS_STDOUT_PATH \ HWS_STDERR_PATH=$HWS_STDERR_PATH \ HWS_PORT=$HWS_PORT \ RACK_ENV=production \ unicorn -c $config