Files
metricspi/package/victoriametrics/victoria-metrics.service
Dustin C. Hatch 66e8246c3b Add systemd units for Victoria Metrics
I think it makes the most sense to install the systemd unit files for
services along with their binaries.  This is how most software provided
by Linux distribution package manager works.  Providing the systemd unit
with the package eliminates the need for variability, since the paths to
the executable and other files are well defined.
2022-06-28 17:02:03 -05:00

52 lines
1.2 KiB
Desktop File

[Unit]
Description=Victoria Metrics
Documentation=https://docs.victoriametrics.com
After=network.target
[Service]
Type=exec
Environment=httpListenAddr=[::1]:8428
Environment=storageDataPath=/var/lib/victoria-metrics/data
Environment=loggerDisableTimestamps=true
EnvironmentFile=-/etc/sysconfig/victoria-metrics
ExecStart=/usr/bin/victoria-metrics -enableTCP6 -envflag.enable
Restart=on-failure
User=victoriametrics
Group=victoriametrics
ReadWritePaths=/var/lib/victoria-metrics
LimitNOFILE=1048576
CapabilityBoundingSet=
DeviceAllow=
DevicePolicy=closed
DynamicUser=yes
IPAddressAllow=localhost
IPAddressDeny=any
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateUsers=yes
PrivateTmp=yes
ProcSubset=pid
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
UMask=0027
[Install]
WantedBy=multi-user.target