fix(scripts): détection unité runner — exclure forgejo-runner-update.service du restart #12

Merged
nonobis merged 1 commit from fix/runner-unit-detection into main 2026-08-18 09:35:27 +02:00
Owner

Bug

Le grep -m1 'runner' dans runner-cleanup.sh (section 6) et setup-dc-cache.sh attrapait forgejo-runner-update.service au lieu de forgejo-runner.service (tri ASCII : - (45) < . (46)).

Conséquence : après une purge --force-full, le restart visait le service d'AUTO-UPDATE (one-shot) et non le runner → le processus forgejo-runner gardait son cache mémoire corrompu (échecs Cannot find module dist/index.js persistants malgré purge).

Fix

Détection ciblant exactement les unités runner, en excluant *-update/*-cleanup :

RUNNER_UNIT=$(systemctl list-unit-files --type=service 2>/dev/null | awk '{print $1}' | grep -E '^(forgejo-runner|act-runner|runner|forgejo-actions-runner|runner-[a-z0-9-]+)\.service$' | head -1)

Couvre : forgejo-runner.service, act-runner.service, runner.service, forgejo-actions-runner.service, runner-<ct>.service. Testé en local (update bien exclu).

Validation

Observé en run réel (2026-08-17) : systemd : forgejo-runner-update.service redémarré (mauvais service) sur runner-murin puis runner-hugin — le runner principal n'était pas redémarré. Le workflow de réparation a dû forcer le restart de forgejo-runner.service explicitement.

## Bug Le `grep -m1 'runner'` dans `runner-cleanup.sh` (section 6) et `setup-dc-cache.sh` attrapait **forgejo-runner-update.service** au lieu de **forgejo-runner.service** (tri ASCII : `-` (45) < `.` (46)). Conséquence : après une purge `--force-full`, le restart visait le service d'AUTO-UPDATE (one-shot) et non le runner → le processus forgejo-runner gardait son **cache mémoire corrompu** (échecs `Cannot find module dist/index.js` persistants malgré purge). ## Fix Détection ciblant exactement les unités runner, en excluant `*-update`/`*-cleanup` : ```bash RUNNER_UNIT=$(systemctl list-unit-files --type=service 2>/dev/null | awk '{print $1}' | grep -E '^(forgejo-runner|act-runner|runner|forgejo-actions-runner|runner-[a-z0-9-]+)\.service$' | head -1) ``` Couvre : `forgejo-runner.service`, `act-runner.service`, `runner.service`, `forgejo-actions-runner.service`, `runner-<ct>.service`. Testé en local (update bien exclu). ## Validation Observé en run réel (2026-08-17) : `systemd : forgejo-runner-update.service redémarré` (mauvais service) sur runner-murin puis runner-hugin — le runner principal n'était pas redémarré. Le workflow de réparation a dû forcer le restart de `forgejo-runner.service` explicitement.
Le grep -m1 'runner' attrapait forgejo-runner-update.service (tri ASCII :
'-' < '.') → le restart visait le service d'AUTO-UPDATE au lieu du runner.
Le processus forgejo-runner gardait son cache mémoire corrompu après purge.
Cible exacte : ^(forgejo-runner|act-runner|runner|forgejo-actions-runner|runner-<ct>)\.service$
nonobis deleted branch fix/runner-unit-detection 2026-08-18 09:35:27 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nonobis/templates!12
No description provided.