Skip to content

Commit 363e89b

Browse files
committed
fix : container restart error
1 parent 95c6427 commit 363e89b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

start.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ set -e
55
# Start squid service
66
start_squid()
77
{
8+
# 清理可能存在的 PID 文件
9+
if [ -f /run/squid.pid ]; then
10+
echo "Cleaning up stale Squid PID file..."
11+
rm -f /run/squid.pid
12+
fi
13+
14+
# 确保 Squid 进程完全停止
15+
service squid stop 2>/dev/null || true
16+
sleep 2
17+
818
service squid start
919
if [ ! `service squid status | grep "squid is running" | wc -l` -gt 0 ]; then
1020
echo "Error: failed to start squid service" >&2;

0 commit comments

Comments
 (0)