#!/bin/bash

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

PATH=/sbin:/usr/sbin:/bin:/usr/bin
NAME=yasmagent
BASEDIR="/usr/local/yasmagent"
LOGDIR="/var/log/yasmagent"
RUNDIR="/var/run/yasmagent"
PIDFILE="${BASEDIR}/run/agent.pid"
HTTP_PORT=11003
PUSH_PORT=$((${HTTP_PORT} + 2))
_SYSTEMCTL_SKIP_REDIRECT=1

instance="--instance-getter 'echo $(hostname -f) a_prj_none a_ctype_testing a_geo_rtc a_tier_none a_itype_mdsspacemimic' --instance-getter 'echo $(hostname -f) a_prj_none a_ctype_testing a_geo_rtc a_tier_none a_itype_mdsstorage' --instance-getter 'echo $(hostname -f) a_prj_none a_ctype_testing a_geo_rtc a_tier_none a_itype_ape'"
PORTO="false"

USER="monitor"
GROUP="monitor"

PYTHON="${BASEDIR}/python/bin/python -B"
RUNCMD="${BASEDIR}/run.py --config=${BASEDIR}/agent.conf --log-dir=${LOGDIR} --pid-file=${PIDFILE} --yasmutil-dir=${BASEDIR}/lib --http-port=${HTTP_PORT} --push-enabled --push-http-port ${PUSH_PORT}"

# /usr/local/yasmagent/python/bin/python /usr/local/yasmagent/run.py --push-enabled --push-http-port 11005 --yasmutil-dir /usr/local/yasmagent/lib --type-conf-dir /usr/local/yasmagent/CONF --config /usr/local/yasmagent/agent.conf --subagent-mode --log-dir /var/log/subagent_logs --pid-file /var/log/yasmsubagent.pid --iss --disable-common --fg  --http-port=11003

exec /usr/local/yasmagent/python/bin/python /usr/local/yasmagent/run.py --push-enabled --push-http-port 11005 --yasmutil-dir ${BASEDIR}/lib --type-conf-dir /usr/local/yasmagent/CONF --config ${BASEDIR}/agent.conf --subagent-mode --log-dir /var/log/subagent_logs --pid-file=${PIDFILE} --iss --disable-common --fg  --http-port=11003 ${instance}

