From abba87d0616f4b3184cc9dac52a7f8d6de9e6dc8 Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Wed, 24 Jun 2026 10:18:44 -0300 Subject: [PATCH] ES + units: corrigir warnings do systemd-analyze e localizar .mo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit systemd-analyze verify reclamava em 3 frentes: 1. StartLimitIntervalSec / StartLimitBurst em [Service] são silenciosamente ignorados, eles têm que ficar em [Unit]. emustation.service e essway.service tinham os dois na seção errada, então a proteção contra restart-flood (Restart=always) nunca era aplicada. avahi-daemon.service tinha um StartLimitInterval (alias antigo, sem 'Sec') também na seção errada. Movidos para [Unit] em todos os três e renomeados para o key canônico. 2. sixaxis@.service é um template — instâncias são spawnadas sob demanda por udev (99-sixaxis.rules põe SYSTEMD_WANTS=sixaxis@%E {DEVNAME}). enable_service criava um symlink do template puro em multi-user.target.wants/, dangling porque template sem instância não roda. Removido o enable_service. 3. emulationstation procurava traduções em /usr/share/locale mas o ArchR embarca os .mo em /usr/config/locale via userconfig rsync, então o ES nunca encontrava emulationstation2.mo. Patch no fork ES (commits 8125fdf, 715ea4b no archr-linux/emulationstation-next): - main.cpp: prefere /usr/config/locale quando ele existe; - Platform.cpp: getArchString() lê HW_DEVICE do env (já exportado pelo profile.d/999-export) em vez de /usr/share/batocera/ batocera.arch que nunca embarcamos; - Scripting.cpp: aceita /run/emulationstation/scripts além do legado /var/run/emulationstation/scripts. archr-fhs-bridges.conf cria /run/emulationstation/scripts vazio em todo boot para usuário poder dropar hooks (game-start, game-end, system-selected, ...) sem mkdir manual após cada reset do tmpfs. Co-Authored-By: Claude Opus 4.7 --- .../packages/archr/tmpfiles.d/z_02_archr-fhs-bridges.conf | 7 +++++++ .../packages/network/avahi/system.d/avahi-daemon.service | 6 ++++-- projects/ArchR/packages/network/sixaxis/package.mk | 8 +++++++- projects/ArchR/packages/ui/emulationstation/package.mk | 2 +- .../ui/emulationstation/system.d/emustation.service | 8 ++++++-- .../packages/ui/emulationstation/system.d/essway.service | 5 +++-- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/projects/ArchR/packages/archr/tmpfiles.d/z_02_archr-fhs-bridges.conf b/projects/ArchR/packages/archr/tmpfiles.d/z_02_archr-fhs-bridges.conf index ab8e0cdfa2..470fddcb45 100644 --- a/projects/ArchR/packages/archr/tmpfiles.d/z_02_archr-fhs-bridges.conf +++ b/projects/ArchR/packages/archr/tmpfiles.d/z_02_archr-fhs-bridges.conf @@ -45,3 +45,10 @@ d /storage/.cache/samba 0700 root root - - d /storage/.local 0755 root root - - d /storage/.local/share 0755 root root - - f /storage/.cache/fstrim.run 0644 root root - - + +# /run/emulationstation/scripts is where users drop game-start / +# game-end / system-selected hooks. ES walks the path on every event; +# creating it empty at boot saves the manual mkdir after each reboot +# (the tmpfs is wiped on shutdown). +d /run/emulationstation 0755 root root - - +d /run/emulationstation/scripts 0755 root root - - diff --git a/projects/ArchR/packages/network/avahi/system.d/avahi-daemon.service b/projects/ArchR/packages/network/avahi/system.d/avahi-daemon.service index 2851f1f929..e8efb56d75 100644 --- a/projects/ArchR/packages/network/avahi/system.d/avahi-daemon.service +++ b/projects/ArchR/packages/network/avahi/system.d/avahi-daemon.service @@ -4,6 +4,10 @@ After=network.target avahi-defaults.service RequiresMountsFor=/storage Requires=avahi-defaults.service ConditionPathExists=/var/lib/archr/services/avahi.conf +# StartLimit* lives in [Unit]; old StartLimitInterval (no 'Sec') is an +# alias kept for compat but the canonical key is StartLimitIntervalSec. +StartLimitIntervalSec=60 +StartLimitBurst=10 [Service] Restart=on-failure @@ -12,8 +16,6 @@ ExecStart=/usr/sbin/avahi-daemon -s $AVAHI_DEBUG ExecReload=/usr/sbin/avahi-daemon -r TimeoutStopSec=1s RestartSec=2 -StartLimitInterval=60 -StartLimitBurst=10 [Install] WantedBy=multi-user.target diff --git a/projects/ArchR/packages/network/sixaxis/package.mk b/projects/ArchR/packages/network/sixaxis/package.mk index 804ed0118e..9c208ef5f2 100644 --- a/projects/ArchR/packages/network/sixaxis/package.mk +++ b/projects/ArchR/packages/network/sixaxis/package.mk @@ -19,6 +19,12 @@ makeinstall_target() { } post_install() { -enable_service sixaxis@.service + # sixaxis@.service is a TEMPLATE — instances are spawned on demand + # by udev (99-sixaxis.rules sets SYSTEMD_WANTS=sixaxis@%E{DEVNAME}). + # Linking the bare template into multi-user.target.wants/ creates a + # dangling reference that systemd-analyze flags as "different name" + # because the .wants entry has no instance. Just install the unit + # file; udev does the rest. + : } diff --git a/projects/ArchR/packages/ui/emulationstation/package.mk b/projects/ArchR/packages/ui/emulationstation/package.mk index 0657d1032a..338cb36273 100644 --- a/projects/ArchR/packages/ui/emulationstation/package.mk +++ b/projects/ArchR/packages/ui/emulationstation/package.mk @@ -2,7 +2,7 @@ # Copyright (C) 2026 ArchR (https://github.com/archr-linux/Arch-R) PKG_NAME="emulationstation" -PKG_VERSION="563e1057f944ddf0eb7b295831d2d09f0a8cdb6f" +PKG_VERSION="715ea4b6f659c6041370930964f459fe50f65a58" PKG_GIT_CLONE_BRANCH="master" PKG_LICENSE="GPL" PKG_SITE="https://github.com/archr-linux/emulationstation-next" diff --git a/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service b/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service index 2a10e6f443..baa977733e 100644 --- a/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service +++ b/projects/ArchR/packages/ui/emulationstation/system.d/emustation.service @@ -3,6 +3,12 @@ Description=EmulationStation emulator frontend ConditionPathExists=/var/lock/start.games After=archr-automount.service RequiresMountsFor=/storage +# StartLimitIntervalSec/StartLimitBurst must live in [Unit], not +# [Service]; systemd silently ignored them there (systemd-analyze +# verify warns), so a misbehaving ES could restart-flood without ever +# tripping the burst limit. +StartLimitIntervalSec=60 +StartLimitBurst=5 [Service] Environment=XDG_RUNTIME_DIR=/var/run/0-runtime-dir @@ -15,8 +21,6 @@ KillMode=process TimeoutStopSec=3 Restart=always RestartSec=2 -StartLimitIntervalSec=60 -StartLimitBurst=5 [Install] WantedBy=archr.target diff --git a/projects/ArchR/packages/ui/emulationstation/system.d/essway.service b/projects/ArchR/packages/ui/emulationstation/system.d/essway.service index f3450b6ecb..481ddf361a 100644 --- a/projects/ArchR/packages/ui/emulationstation/system.d/essway.service +++ b/projects/ArchR/packages/ui/emulationstation/system.d/essway.service @@ -5,6 +5,9 @@ Description=EmulationStation-with-Sway Requires=sway.service After=sway.service RequiresMountsFor=/storage +# StartLimit* lives in [Unit] (see emustation.service for context). +StartLimitIntervalSec=60 +StartLimitBurst=5 [Service] Type=simple @@ -14,8 +17,6 @@ ExecStart=/usr/bin/start_es.sh WorkingDirectory=/storage Restart=always RestartSec=2 -StartLimitIntervalSec=60 -StartLimitBurst=5 [Install] WantedBy=archr.target \ No newline at end of file