systemd 管理下で Rust デーモンを安全に動かすための unit、運用、権限、ログ設計を扱う skill。
デーモンを Linux 上で運用可能な形へ仕上げる。 この skill はアプリコード本体よりも、起動方法、権限、ログ、unit ファイル、インストールパス、hardening を扱う。
ExecStart と設定ファイルパス設計を決めるType=simplegrab と /dev/uinput へのアクセスが必要[Unit]
Description=Mouse remapper with virtual mouse and keyboard routing
After=systemd-udevd.service
[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/ex-g-pro-remapper --config /etc/ex-g-pro-remapper/config.yaml
Restart=on-failure
RestartSec=2
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/etc/ex-g-pro-remapper
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
/etc/ex-g-pro-remapper/config.yaml に置く/usr/local/bin/ex-g-pro-remapperサービス起動前に、少なくとも以下を確認すること。
grab できる/dev/uinput を開けるERRORWARNINFODEBUGProtectSystem=strict を使うなら、読込対象パスを確認するsystemctl daemon-reload
systemctl enable ex-g-pro-remapper.service
systemctl start ex-g-pro-remapper.service
systemctl status ex-g-pro-remapper.service
journalctl -u ex-g-pro-remapper.service -b
この skill を使ったときは、次を返す。