savagegus
7/14/2015 - 6:36 PM

baasbox.conf

[program:baasbox]
command=/opt/baasbox/start
user=baasbox
autostart=true
autorestart=true
stderr_logfile=/var/log/baasbox/baasbox.err.log
stdout_logfile=/var/log/baasbox/baasbox.out.log
#!/bin/bash

scriptdir="/opt/baasbox"
classpath="$scriptdir/lib/*"

# check if the RUNNING_PID file exists. In this case it will be deleted if there is no process with the same PID stored in it
# RUNNING_PID file is created by BaasBox when it starts. If it quits unexpectedly (kill -9, server crash) the file is not deleted and BaasBox will not restarts

if [ -f RUNNING_PID ];
then
        ps -p $(cat RUNNING_PID) > /dev/null; test $? -eq 1 && rm RUNNING_PID
fi

exec java ${1+"$@"} -Dconfig.file=baasbox.config -cp "$classpath"  play.core.server.NettyServer $scriptdir
include classpath("application.conf")
application.code="1234567890"
orient.baasbox.path="/opt/baasbox/db/baasbox"
orient.baasbox.backup.path="/opt/baasbox/db/backup"
push.baasbox.certificates.folder="/opt/baasbox/certificates"