[program:claim]
command = sh ./claim.sh
directory = /www/project/server/
autorestart = true
startsecs = 3
stdout_logfile = /www/project/server//supervisord/log/claim.out.log
stderr_logfile = /www/project/server//supervisord/log/claim.err.log
stdout_logfile_maxbytes = 2MB
stderr_logfile_maxbytes = 2MB
user = root
priority = 999
numprocs = 1
process_name = %(program_name)s_%(process_num)02d
claim.sh 文件
./hotgo webserver -m=claim -a1=claim &
echo "hotgo start all server.."
tail -f /dev/null
出现错误 “2024/07/20 17:33:45 span too large to send: Span({TraceIdLow:4569768519428680492 ” 、 “EOF ” "连接重置,断开" 等。这个服务没有重启, 如何能够使出现错误,服务重启
修改后的
claim.sh 文件
#!/bin/bash
# 启动 hotgo 服务
./hotgo web3 -m=claim -a1=claim &
hotgo_pid=$!
# 等待一段时间,确保 hotgo 进程已经启动
sleep 5
# 检查 hotgo 进程是否在运行
if ps -p $hotgo_pid > /dev/null; then
echo "hotgo started successfully with PID $hotgo_pid"
else
echo "Failed to start hotgo. Exiting..."
exit 1
fi
# 监控 hotgo 进程,如果它退出,则脚本也退出
wait $hotgo_pid