#!/bin/bash
ulimit -c unlimited
export GOTRACEBACK=crash
cwd=$(pwd)

echo "当前目录：${cwd}"

# 引入全局文件
source ${cwd}/bin/global.sh

# 临时命令，删除pprof
# rm -rf world_cpu_*
#rm -rf logs/error/*.log
#rm -rf logs/debug/*.log
#rm -rf logs/info/*.log
#rm -rf logs/warn/*.log

#启动的模块名
module=$1
#启动的模块id
id=$2
#单机模式
simple=''
#central用的参数
#central环境参数
env='dev'
#central启动模式
mode='a'
#其他模块使用
#启动的模块需要链接的central的ip
host='127.0.0.1'
#启动的模块需要链接的central的端口
port='6000'
host=$3
port=$4
env=$5

echo "module=$module"
echo "id=$id"
echo "env=$env"
echo "mode=$mode"
echo "host=$host"
echo "port=$port"

echo "env=$env"
cwd=$(pwd)
echo $cwd

nohup ${module}/${GLOBAL_SERVICE_NAME_PREFIX}${module} -i ${id} -e ${env} -h ${host} -p ${port} >> ${cwd}/logs/${module}_${id}.log 2>&1 &
exit 0
