메인 브런치로 이동

This commit is contained in:
정훈 변
2024-09-09 12:25:26 +09:00
parent 67fcdf305d
commit 32440c8d64
71 changed files with 5241 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
#!/bin/sh
PRODUCT_NAME=exemONE
MODULE_NAME=exem-container-agent
VERSION=1.1.2
echo ${PRODUCT_NAME} ${MODULE_NAME} ver ${VERSION}

View File

@@ -0,0 +1,16 @@
#!/bin/sh
docker load -i __INST__EXEM_HOME__/container/image/exem-container-agent_image_1.1.2.tar
docker run -d \
--cap-add SYS_PTRACE \
--restart=always \
-v /:/host:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /run/containerd/containerd.sock:/run/containerd/containerd.sock:ro \
--env EXEM_HOME="__INST__EXEM_HOME__" \
--env EXEM_CONTAINER_HOME="__INST__EXEM_HOME__/container" \
--env COMMON_RECEIVER_IP="__INST__RECEIVER_IP__" \
--env COMMON_RECEIVER_PORT="__INST__RECEIVER_PORT__" \
--env CONTAINER_LOG_LEVEL="info" \
--name exem-container-agent exem-container-agent:1.1.2

View File

@@ -0,0 +1,4 @@
#!/bin/sh
docker stop exem-container-agent
docker rm exem-container-agent

View File

@@ -0,0 +1,25 @@
#!/bin/sh
SYSTEMCTL=$(which systemctl 2> /dev/null)
SERVICE=$(which service 2> /dev/null)
CHKCONFIG=$(which chkconfig 2> /dev/null)
if [ -n "${SYSTEMCTL}" ]; then
systemctl stop exem-container-agent
systemctl disable exem-container-agent
systemctl daemon-reload
if [ -e "/etc/systemd/system/exem-container-agent.service" ]; then
rm -f /etc/systemd/system/exem-container-agent.service
systemctl daemon-reload
fi
if [ -e "/etc/systemd/system/default.target.wants/exem-container-agent.service" ]; then
rm -f /etc/systemd/system/default.target.wants/exem-container-agent.service
systemctl daemon-reload
fi
echo "exem-container-agent is disabled"
fi

View File

@@ -0,0 +1,35 @@
#!/bin/sh
SYSTEMCTL=$(which systemctl 2> /dev/null)
SERVICE=$(which service 2> /dev/null)
CHKCONFIG=$(which chkconfig 2> /dev/null)
# root 권한 없는 경우 불가능
if [ "$(id -u)" -ne 0 ]; then
echo "Not a root user. Not support service registration"
echo "Use binary mode or image mode"
exit 1
fi
if [ -n "${SYSTEMCTL}" ]; then
# SELinux setting
SELINUX_OPTION=$(awk -F= '/^SELINUX=/{print $2}' /etc/selinux/config)
if [ ${SELINUX_OPTION} != "disabled" ]; then
chcon -t bin_t __INST__EXEM_HOME__/container/script/binary_mode/start.sh
chcon -R -t var_run_t __INST__EXEM_HOME__/container/data
fi
if [ ! -e "/etc/systemd/system/exem-container-agent.service" ]; then
systemctl enable __INST__EXEM_HOME__/container/data/service/exem-container-agent.service
fi
systemctl daemon-reload
echo "exem-container-agent is enabled"
else
echo "this OS version that does not support service registration"
echo "Use binary mode or image mode"
exit 1
fi

View File

@@ -0,0 +1,3 @@
#!/bin/sh
sudo systemctl start exem-container-agent

View File

@@ -0,0 +1,5 @@
#!/bin/sh
sudo __INST__EXEM_HOME__/container/script/binary_mode/stop.sh
sudo systemctl stop exem-container-agent