fix(systemd): track canonical user units

This commit is contained in:
fy59 2026-09-25 05:42:29 +02:00
parent 8551db9e35
commit b475faba2a
15 changed files with 112 additions and 23 deletions

View file

@ -0,0 +1,16 @@
[Unit]
Description=Arch Sentinel - collecte légère
[Service]
Type=oneshot
ExecStart=%h/.local/bin/arch-sentinel sample
Nice=10
IOSchedulingClass=idle
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=%h/.local/share/arch-sentinel
RestrictAddressFamilies=AF_UNIX
LockPersonality=yes
MemoryDenyWriteExecute=yes

View file

@ -0,0 +1,11 @@
[Unit]
Description=Arch Sentinel - relevé périodique
[Timer]
OnBootSec=2min
OnUnitActiveSec=5min
AccuracySec=30s
Persistent=true
[Install]
WantedBy=timers.target

View file

@ -0,0 +1 @@
/home/fy59/.config/systemd/user/trainlog-btd.service

View file

@ -0,0 +1 @@
/home/fy59/.config/systemd/user/trainlog-syncd.service

View file

@ -0,0 +1 @@
../trainlog-web.service

View file

@ -1,11 +0,0 @@
[Unit]
Description=GNOME keyring daemon
PartOf=graphical-session.target
After=graphical-session.target
[Service]
ExecStart=/usr/bin/gnome-keyring-daemon --components=pkcs11,secrets,ssh --start
Restart=on-failure
[Install]
WantedBy=graphical-session.target

View file

@ -1 +0,0 @@
/home/fy59/.config/systemd/user/keyring.service

View file

@ -1,11 +0,0 @@
[Unit]
Description=Wayland color temperature (wlsunset)
PartOf=graphical-session.target
After=graphical-session.target
[Service]
ExecStart=/usr/bin/gnome-keyring-daemon --components=pkcs11,secrets,ssh --start
Restart=on-failure
[Install]
WantedBy=graphical-session.target

View file

@ -0,0 +1,16 @@
[Unit]
Description=Session FreeCAD Lardon avec autopush
Documentation=file://%h/Documents/Lardon/README.md
ConditionPathExists=%h/Documents/Lardon/FreeCAD/Lardon_Master.FCStd
ConditionFileIsExecutable=%h/Documents/Lardon/tools/freecad-autopush
ConditionFileIsExecutable=%h/Documents/Lardon/tools/lardon-freecad-session
[Service]
Type=exec
WorkingDirectory=%h/Documents/Lardon
ExecStart=%h/Documents/Lardon/tools/lardon-freecad-session
KillMode=control-group
TimeoutStopSec=15s
Restart=no

View file

@ -0,0 +1 @@
../arch-sentinel-sample.timer

View file

@ -0,0 +1,13 @@
[Unit]
Description=Trainlog Bluetooth RFCOMM agent
ConditionPathExists=/home/fy59/.config/trainlog/sync-generation-config-v1.json
[Service]
Type=simple
ExecCondition=/usr/bin/grep -Eq '"bluetooth_enabled"[[:space:]]*:[[:space:]]*true' "/home/fy59/.config/trainlog/sync-generation-config-v1.json"
ExecStart=/usr/bin/python3 "/home/fy59/Documents/trainlog/tools/trainlog_bt_agent.py" --config "/home/fy59/.config/trainlog/sync-generation-config-v1.json"
Restart=on-failure
RestartSec=2
[Install]
WantedBy=default.target

View file

@ -0,0 +1,13 @@
[Unit]
Description=Trainlog automatic synchronization agent
[Service]
Type=simple
Environment=TRAINLOG_SYNC_BT_ADAPTER=/home/fy59/Documents/trainlog/tools/trainlog_generation_bt_adapter.py
Environment=TRAINLOG_SYNC_MTP_ADAPTER=/home/fy59/Documents/trainlog/build/tui/trainlog-generation-mtp-adapter
ExecStart=/usr/bin/python3 "/home/fy59/Documents/trainlog/tools/trainlog_syncd.py" --sync-once "/home/fy59/Documents/trainlog/build/tui/trainlog-sync-once" --bt-adapter "/home/fy59/Documents/trainlog/tools/trainlog_generation_bt_adapter.py" --mtp-adapter "/home/fy59/Documents/trainlog/build/tui/trainlog-generation-mtp-adapter" --interval 3
Restart=on-failure
RestartSec=2
[Install]
WantedBy=default.target

View file

@ -0,0 +1,2 @@
[Service]
Environment=TRAINLOG_SYNC_GENERATION_CONFIG=/home/fy59/.config/trainlog/sync-generation-config-v1.json

View file

@ -0,0 +1,35 @@
[Unit]
Description=Trainlog Web local user service
Documentation=https://github.com/labfytools/trainlog
After=default.target
# WHY: A persistent bind failure (notably an occupied 127.0.0.1:8080) must not
# become an aggressive restart loop in the user's session.
StartLimitIntervalSec=60
StartLimitBurst=3
[Service]
Type=simple
# CONTRACT: The user-managed executable is the canonical manual and service
# entry point; the repository/build location must not leak into this unit.
ExecStart=%h/.local/bin/trainlog -w
# INVARIANT: Trainlog stays in the foreground, owns its ordered SIGTERM
# shutdown, and always keeps the frozen loopback address and port contract.
KillSignal=SIGTERM
TimeoutStopSec=20
Restart=on-failure
RestartSec=10
# These protections do not isolate the home directory: Trainlog must retain
# access to its SQLite data and configuration below ~/.local/share and ~/.config.
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
RestrictSUIDSGID=true
LockPersonality=true
SystemCallArchitectures=native
[Install]
WantedBy=default.target

View file

@ -0,0 +1,2 @@
[Service]
Environment=TRAINLOG_SYNC_GENERATION_CONFIG=/home/fy59/.config/trainlog/sync-generation-config-v1.json