代码拉取完成,页面将自动刷新
#!/bin/bash
APP_NAME="datakit"
JAR_PATTERN="openGauss-datakit-*.jar"
PID_FILE="datakit.pid"
check_running() {
if [ -e $PID_FILE ]; then
PID=$(cat $PID_FILE)
if ps -p $PID > /dev/null; then
echo "Datakit is already running with PID: $PID"
exit 1
else
echo "Stale PID file. Cleaning up."
rm $PID_FILE
fi
fi
}
start() {
check_running
JAR_FILE=$(ls $JAR_PATTERN 2>/dev/null | tail -n 1)
if [ -z "$JAR_FILE" ]; then
echo "No matching JAR file found."
exit 1
fi
nohup java -Xms2048m -Xmx4096m -jar $JAR_FILE --spring.profiles.active=temp > logs/visualtool-main.out 2>&1 &
echo $! > $PID_FILE
echo "Datakit started."
}
stop() {
if [ -e $PID_FILE ]; then
PID=$(cat $PID_FILE)
kill $PID
rm $PID_FILE
echo "Datakit stopped."
else
echo "Datakit is not running."
fi
}
restart() {
stop
start
}
status() {
if [ -e $PID_FILE ]; then
PID=$(cat $PID_FILE)
if ps -p $PID > /dev/null; then
echo "Datakit is running with PID: $PID"
else
echo "Stale PID file. Datakit may not be running."
rm $PID_FILE
fi
else
echo "Datakit is not running."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。