ES + units: corrigir warnings do systemd-analyze e localizar .mo

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 <noreply@anthropic.com>
This commit is contained in:
Douglas Teles
2026-06-24 10:18:44 -03:00
parent fcc56ec635
commit abba87d061
6 changed files with 28 additions and 8 deletions
@@ -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 - -
@@ -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
@@ -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.
:
}
@@ -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"
@@ -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
@@ -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