update
This commit is contained in:
67
datax-web/ADD/ccmd
Executable file
67
datax-web/ADD/ccmd
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
##################################################
|
||||
# Mount dir #
|
||||
# - /opt/datax-web-2.1.2/modules/datax-admin/logs#
|
||||
# - /opt/datax-web-2.1.2/modules/datax-admin/bin/console.out#
|
||||
# - /opt/datax-web-2.1.2/modules/datax-datax-executor/logs#
|
||||
# - /opt/datax-web-2.1.2/modules/datax-datax-executor/bin/console.out#
|
||||
# ENV #
|
||||
# - JAVA_OPTS #
|
||||
# - TIMEOUT #
|
||||
# - MAX_PROCS #
|
||||
##################################################
|
||||
|
||||
set -euo pipefail
|
||||
export LANG=en_US.UTF-8
|
||||
trap Quit EXIT
|
||||
|
||||
GOT_SIGTERM=
|
||||
TIMEOUT="${TIMEOUT:-10m}"
|
||||
MAX_PROCS=${MAX_PROCS:-1}
|
||||
|
||||
function Print {
|
||||
local file=/dev/null
|
||||
[ '-f' = "$1" ] && file=$2 && shift && shift
|
||||
date +"[%F %T] $*" | tee -a $file
|
||||
}
|
||||
|
||||
function Quit {
|
||||
while :; do
|
||||
pkill -f java && Print killing java ... || break
|
||||
sleep 1
|
||||
done
|
||||
# exec 1022<&-
|
||||
Print Container stopped.
|
||||
test -n "$GOT_SIGTERM"
|
||||
}
|
||||
|
||||
|
||||
|
||||
function ModifyConf {
|
||||
local kv=
|
||||
Print Modify bootstrap.properties ...
|
||||
while read kv; do
|
||||
[ -z "$kv" ] && return 0
|
||||
Print Modify property: ${kv%%=*} ...
|
||||
sed -i "/^#${kv%%=*} *=/c$kv" /opt/datax-web-2.1.2/modules/datax-admin/conf/bootstrap.properties
|
||||
done <<< "$(env | grep '^_CONF_' | sed 's/_CONF_//')"
|
||||
}
|
||||
|
||||
function StartProc {
|
||||
Print Start datax-web
|
||||
cd /opt/datax-web-2.1.2
|
||||
/usr/bin/bash bin/start-all.sh
|
||||
tail -f /dev/null
|
||||
}
|
||||
|
||||
|
||||
function Main {
|
||||
ModifyConf
|
||||
trap "GOT_SIGTERM=1; Print Got SIGTERM ...; exit" SIGTERM
|
||||
StartProc
|
||||
}
|
||||
|
||||
# Start here
|
||||
Main
|
||||
|
Reference in New Issue
Block a user