64 lines
2.1 KiB
Desktop File
64 lines
2.1 KiB
Desktop File
# Example unit for a manual (non-NixOS) install of slinuxm. Copy it to
|
|
# /etc/systemd/system/ and adapt the binary path, config path and user to your
|
|
# host; docs/install.md walks through it. On NixOS the module generates its own
|
|
# equivalent unit, so this file is not used there.
|
|
|
|
[Unit]
|
|
Description=skyg-linux-tracker: read-only systemd, journal and Docker monitor (REST, MCP, OTel)
|
|
After=network.target docker.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/usr/local/bin/slinuxm serve --config /etc/skyg-linux-tracker.toml
|
|
# SIGHUP re-reads the TLS certificate and the [peers] section without a restart.
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
TimeoutStopSec=30
|
|
|
|
# Dedicated user, created beforehand: useradd --system --no-create-home \
|
|
# --shell /usr/sbin/nologin skyg
|
|
# A static user (not DynamicUser) so `sudo -u skyg slinuxm token ...` can open
|
|
# the same token database the service uses.
|
|
User=skyg
|
|
Group=skyg
|
|
# Read the journal. The tracker never writes to it.
|
|
SupplementaryGroups=systemd-journal
|
|
# WARNING: membership of the docker group is root-equivalent on the host (the
|
|
# Docker API can start privileged containers). Prefer pointing
|
|
# sources.docker_socket at a read-only socket proxy (see docs/operations.md) and leave this
|
|
# commented out. Uncomment only if you accept that risk (see ARCHITECTURE.md, Decisions).
|
|
#SupplementaryGroups=docker
|
|
|
|
# /var/lib/skyg-linux-tracker, owned by the service user, mode 0700.
|
|
StateDirectory=skyg-linux-tracker
|
|
StateDirectoryMode=0700
|
|
|
|
# Hardening
|
|
NoNewPrivileges=yes
|
|
ProtectSystem=strict
|
|
ProtectHome=yes
|
|
PrivateTmp=yes
|
|
PrivateDevices=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectControlGroups=yes
|
|
ProtectClock=yes
|
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
|
RestrictNamespaces=yes
|
|
RestrictRealtime=yes
|
|
LockPersonality=yes
|
|
MemoryDenyWriteExecute=yes
|
|
SystemCallArchitectures=native
|
|
SystemCallFilter=@system-service
|
|
SystemCallFilter=~@privileged @resources
|
|
ProtectProc=invisible
|
|
ProcSubset=pid
|
|
RestrictSUIDSGID=yes
|
|
UMask=0077
|
|
CapabilityBoundingSet=
|
|
AmbientCapabilities=
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|