give our service a name nobody can confuse with someone else's
روی این سرور یک `gunicorn.service` هست که مالِ تیمِ دیگری است. هر کسی که عجله داشته باشد و `systemctl restart gunicorn` بزند، سرویسِ آنها را میخواباند و سرویسِ ما اصلاً ریاستارت نمیشود — یعنی دیپلوی بیصدا اعمال نمیشود. همین دیشب یک بار اتفاق افتاد. حالا همان یونیت با نامِ `zareian-mathapp` هم صدا زده میشود (symlink در /etc/systemd/system). نامِ قبلی هم کار میکند، پس چیزی نمیشکند. خط تیره و نه نقطه: systemd آخرین نقطه را جداکنندهی نوعِ یونیت میداند، پس `zareian.mathapp` را باید هر بار کامل با `.service` نوشت. deploy.sh هم اول دنبالِ همین نام میگردد. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
10
CLAUDE.md
10
CLAUDE.md
@@ -243,6 +243,16 @@ Ours is exactly one directory: **`/home/administrator/mathapp-v2`**, served by
|
|||||||
**`gunicorn-mathapp.service`** (unix socket, proxied by nginx). Note `~/mathapp` also
|
**`gunicorn-mathapp.service`** (unix socket, proxied by nginx). Note `~/mathapp` also
|
||||||
exists, is not a git repo, and is not what runs — do not touch it.
|
exists, is not a git repo, and is not what runs — do not touch it.
|
||||||
|
|
||||||
|
The same unit also answers to **`zareian-mathapp`** (a symlink alias in
|
||||||
|
`/etc/systemd/system/`, added 2026-09-18). Prefer that name in anything a human will type
|
||||||
|
or copy: `gunicorn` alone is a *different team's* service on this box, and `tadrisino` is
|
||||||
|
too generic for a machine where other people's projects may claim it later.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl restart zareian-mathapp # ours, unambiguous
|
||||||
|
sudo systemctl restart gunicorn # NOT ours — someone else's app
|
||||||
|
```
|
||||||
|
|
||||||
Rules that follow from this, and are not negotiable:
|
Rules that follow from this, and are not negotiable:
|
||||||
|
|
||||||
1. **Never run a destructive command outside `~/mathapp-v2`.** No `rm -rf`, no
|
1. **Never run a destructive command outside `~/mathapp-v2`.** No `rm -rf`, no
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ if [ -z "$SERVICE" ] && command -v systemctl >/dev/null 2>&1; then
|
|||||||
# مختلف کنارِ هم هستند و یک `gunicorn.service` وجود دارد که مالِ تیمِ
|
# مختلف کنارِ هم هستند و یک `gunicorn.service` وجود دارد که مالِ تیمِ
|
||||||
# دیگری است — حدس زدنِ آن یعنی ریاستارت کردنِ سرویسِ یک نفرِ دیگر. اگر
|
# دیگری است — حدس زدنِ آن یعنی ریاستارت کردنِ سرویسِ یک نفرِ دیگر. اگر
|
||||||
# نامِ سرویس در این فهرست نبود، TADRISINO_SERVICE را صریح بدهید.
|
# نامِ سرویس در این فهرست نبود، TADRISINO_SERVICE را صریح بدهید.
|
||||||
for candidate in tadrisino tadrisino-api gunicorn-mathapp mathapp; do
|
for candidate in zareian-mathapp gunicorn-mathapp tadrisino tadrisino-api; do
|
||||||
if systemctl cat "${candidate}.service" >/dev/null 2>&1; then
|
if systemctl cat "${candidate}.service" >/dev/null 2>&1; then
|
||||||
SERVICE="$candidate"; break
|
SERVICE="$candidate"; break
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user