# Agile Data Vault Modeler 

description "Start the modeler web application"
author "Jon Nedelmann"

env APP_NAME=vault_modeler

start on (net-device-up and local-filesystems and runlevel [2345])
stop on runlevel [016]
respawn
respawn limit 5 60

pre-start script
  test -x /usr/bin/node || {stop;exit 0;}
end script

script
  export PORT= <port where web application will listen>
  export advm_admin=<user id of data vault modeler administrator>
  export DB_HOST=localhost
  export DB_PORT=5984
  export DB_NAME=vault
  export DB_USER=couch_vault
  export DB_PWD=<password of couch_vault>
  export LOG_LEVEL=error
  export LOG_DIRECTORY=/var/log/
  export NODE_ENV=production
  HOME=/var/vault/agile-bi.de.data-vault.modeler
  export HOME
  cd $HOME
  su vault
  /usr/bin/node agileVault.js
end script