fix(systemd): track canonical user units
This commit is contained in:
parent
8551db9e35
commit
b475faba2a
15 changed files with 112 additions and 23 deletions
16
systemd/.config/systemd/user/arch-sentinel-sample.service
Normal file
16
systemd/.config/systemd/user/arch-sentinel-sample.service
Normal 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
|
||||
11
systemd/.config/systemd/user/arch-sentinel-sample.timer
Normal file
11
systemd/.config/systemd/user/arch-sentinel-sample.timer
Normal 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
|
||||
|
|
@ -0,0 +1 @@
|
|||
/home/fy59/.config/systemd/user/trainlog-btd.service
|
||||
|
|
@ -0,0 +1 @@
|
|||
/home/fy59/.config/systemd/user/trainlog-syncd.service
|
||||
|
|
@ -0,0 +1 @@
|
|||
../trainlog-web.service
|
||||
|
|
@ -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
|
||||
|
|
@ -1 +0,0 @@
|
|||
/home/fy59/.config/systemd/user/keyring.service
|
||||
|
|
@ -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
|
||||
16
systemd/.config/systemd/user/lardon-freecad.service
Normal file
16
systemd/.config/systemd/user/lardon-freecad.service
Normal 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
|
||||
|
|
@ -0,0 +1 @@
|
|||
../arch-sentinel-sample.timer
|
||||
13
systemd/.config/systemd/user/trainlog-btd.service
Normal file
13
systemd/.config/systemd/user/trainlog-btd.service
Normal 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
|
||||
13
systemd/.config/systemd/user/trainlog-syncd.service
Normal file
13
systemd/.config/systemd/user/trainlog-syncd.service
Normal 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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
Environment=TRAINLOG_SYNC_GENERATION_CONFIG=/home/fy59/.config/trainlog/sync-generation-config-v1.json
|
||||
35
systemd/.config/systemd/user/trainlog-web.service
Normal file
35
systemd/.config/systemd/user/trainlog-web.service
Normal 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
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
Environment=TRAINLOG_SYNC_GENERATION_CONFIG=/home/fy59/.config/trainlog/sync-generation-config-v1.json
|
||||
Loading…
Reference in a new issue