Created
May 6, 2021 04:14
-
-
Save udomsak/218bc926075a771192dabd7cda31bf15 to your computer and use it in GitHub Desktop.
loki systemd unit file for ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Loki service | |
After=network.target | |
[Service] | |
Type=simple | |
User=loki | |
ExecStart=/usr/local/bin/loki --config.file /etc/grafana/loki/loki-local-config.yaml | |
[Install] | |
WantedBy=multi-user.target |
Currently, this is my version of the systemd unit file:
[Unit]
Description = loki server service
After = network-online.target
After = syslog.target
[Service]
Type = simple
User = loki
Group = loki
ExecStart = /opt/loki/loki-linux-amd64 -config.file=/opt/loki/loki-local-config.yaml -log.level=info -server.log-source-ips-enabled=true
ExecReload = /bin/kill -HUP $MAINPID
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec = 120
Restart = on-failure
RestartSec = 2
# This creates a specific slice which all services will operate from
# The accounting options give us the ability to see resource usage through
# the `systemd-cgtop` command.
Slice = loki.slice
# Set Accounting
CPUAccounting = True
BlockIOAccounting = True
MemoryAccounting = True
TasksAccounting = True
# Set Sandboxing
PrivateTmp = True
PrivateDevices = False
PrivateNetwork = False
[Install]
WantedBy = multi-user.target
Thanks for sharing this. I had one question: what is the purpose of enabling systemd resource accounting if you are not setting any quota's, restrictions or caps on CPU/IO/memory usage?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pre-pare and configure Loki on Grafana server.