3 Star 0 Fork 0

zephyr/openGauss-workbench

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run.sh 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
王亚龙 提交于 2023-12-13 18:35 . 增加启动停止脚本
#!/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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangzhanfu/open-gauss-workbench.git
git@gitee.com:yangzhanfu/open-gauss-workbench.git
yangzhanfu
open-gauss-workbench
openGauss-workbench
master

搜索帮助