From e696461f7d5cb0987865f0985a3b09af1aea8fe3 Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Wed, 24 Jun 2026 11:14:38 -0300 Subject: [PATCH] 001-functions + archr-automount: corrigir refs herdadas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 001-functions:wait_lock(): o trap rm -f "\$lockfile" referenciava uma variável inexistente. O lock real está em \${J_CONF_LOCK}. Como \$lockfile expandia para string vazia, rm -f "" virava no-op e deixava /tmp/.system.cfg.lock órfão se o script morresse por SIGINT/ SIGTERM antes do rm -f explícito no final. archr-automount.service: Before=autostart.service apontava para o nome herdado do JELOS, que ArchR não embarca (a unit real é archr-autostart.service). Sem o prefixo o ordering virava silently ignored, perdendo a garantia de que /storage/games-* fosse montado antes dos scripts de autostart consumirem os paths. Também ajustada a Description que dizia "user autostart script" (copy-paste do archr-autostart.service). Co-Authored-By: Claude Opus 4.7 --- projects/ArchR/packages/archr/profile.d/001-functions | 5 ++++- .../ArchR/packages/archr/system.d/archr-automount.service | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/projects/ArchR/packages/archr/profile.d/001-functions b/projects/ArchR/packages/archr/profile.d/001-functions index b34003bf99..ae75bfa84e 100644 --- a/projects/ArchR/packages/archr/profile.d/001-functions +++ b/projects/ArchR/packages/archr/profile.d/001-functions @@ -82,7 +82,10 @@ function wait_lock() { do if (set -o noclobber; echo "$$" > "${J_CONF_LOCK}") 2>/dev/null then - trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT + # Trap original referenciava $lockfile (variável inexistente) + # — o rm -f "" do INT/TERM virava no-op e deixava lock órfão se + # o script morresse antes do rm explícito no final. + trap 'rm -f "${J_CONF_LOCK}"; exit $?' INT TERM EXIT break else sleep 1 diff --git a/projects/ArchR/packages/archr/system.d/archr-automount.service b/projects/ArchR/packages/archr/system.d/archr-automount.service index 9e1df19286..875f7f7703 100644 --- a/projects/ArchR/packages/archr/system.d/archr-automount.service +++ b/projects/ArchR/packages/archr/system.d/archr-automount.service @@ -1,6 +1,10 @@ [Unit] -Description=ArchR user autostart script -Before=autostart.service +Description=ArchR storage automount service +# autostart.service é nome herdado do JELOS; em ArchR a unit real +# chama-se archr-autostart.service. Sem o prefixo o Before= era +# silenciosamente ignorado e o automount não tinha garantia de rodar +# antes do autostart. +Before=archr-autostart.service After=systemd-tmpfiles-setup.service RequiresMountsFor=/storage