diff --git a/CHANGELOG.md b/CHANGELOG.md index 97e589c..63b90b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.8] - 2026-06-03 + +### 修复 +- 修复 EC2 部署最后一步 nginx reload 失败(`invalid PID number`):改用 `systemctl reload-or-restart nginx`(经 systemd MAINPID 发 HUP,不依赖空的 /run/nginx.pid),并 `enable nginx` 确保重启后自启 + ## [1.0.7] - 2026-06-03 ### 修复 diff --git a/scripts/ci/deploy.sh b/scripts/ci/deploy.sh index 5f8b928..fb6037c 100755 --- a/scripts/ci/deploy.sh +++ b/scripts/ci/deploy.sh @@ -126,9 +126,13 @@ mkdir -p /opt/jiu/marketing rsync -a --delete /tmp/jiu-marketing-new/ /opt/jiu/marketing/ rm -rf /tmp/jiu-marketing-new -# Update nginx config and reload +# Update nginx config and reload. +# reload-or-restart: reload if nginx is running, start it if it's not — avoids +# `nginx -s reload` failing with "invalid PID number" when nginx isn't running +# (e.g. after an EC2 reboot where nginx didn't auto-start). sudo cp /tmp/nginx-jiu.conf /etc/nginx/conf.d/jiu.conf -sudo nginx -t && sudo nginx -s reload +sudo systemctl enable nginx >/dev/null 2>&1 || true # auto-start on future reboots +sudo nginx -t && sudo systemctl reload-or-restart nginx echo "Deploy complete!" ENDSSH