host agent 최신화 및 manager agent 추가
This commit is contained in:
@@ -1,26 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
# EXPORT
|
||||
export EXEM_HOME={{ EXEM_HOME }}
|
||||
export EXEM_CONTAINER_HOME={{ EXEM_HOME }}/container
|
||||
export COMMON_RECEIVER_IP={{ RECEIVER_ADDR }}
|
||||
export COMMON_RECEIVER_PORT={{ RECEIVER_CONTAINER_PORT | default('9009') }}
|
||||
export CONTAINER_LOG_LEVEL=info
|
||||
if [ "$1" = "-b" ]; then
|
||||
{{ EXEM_HOME }}/manager/script/binary_start.sh
|
||||
|
||||
else
|
||||
if [ "$OS_NAME" = "SunOS" ]; then
|
||||
ID=`/usr/xpg4/bin/id -u`
|
||||
else
|
||||
ID=`id -u`
|
||||
fi
|
||||
|
||||
# START
|
||||
PIDFILE=${EXEM_CONTAINER_HOME}/data/container_agent_pid
|
||||
if [ "$ID" -eq 0 ]; then
|
||||
{{ EXEM_HOME }}/manager/script/service_start.sh
|
||||
if [ "$?" != 0 ]; then
|
||||
{{ EXEM_HOME }}/manager/script/binary_start.sh
|
||||
fi
|
||||
else
|
||||
echo "No root privileges. Starting without registering service."
|
||||
|
||||
if [ -f "${PIDFILE}" ]; then
|
||||
PID=$(echo -n | cat ${PIDFILE})
|
||||
IS_RUNNING=$(ps -fp "${PID}" | grep -c exem-container-agent)
|
||||
|
||||
if [ "${IS_RUNNING}" -ne 0 ]; then
|
||||
echo "exem-container-agent is already running (${PID})"
|
||||
exit
|
||||
{{ EXEM_HOME }}/manager/script/binary_start.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
chmod 755 ${EXEM_CONTAINER_HOME}/bin/exem-container-agent
|
||||
|
||||
${EXEM_CONTAINER_HOME}/bin/exem-container-agent run
|
||||
if [ "$?" = 0 ]; then
|
||||
echo "xmSuccess(0): exem-manager-agent is started"
|
||||
else
|
||||
echo "xmError(1): Failed to start exem-manager-agent"
|
||||
fi
|
||||
Reference in New Issue
Block a user