summaryrefslogtreecommitdiff
path: root/net-misc/xmrig/files/xmrig.service
blob: 5b5c4c3d2931481cf2aac9527afa2a942f54c743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[Unit]
Description=XMRig Monero Miner
After=network-online.target
AssertFileNotEmpty=/etc/xmrig/config.json

[Service]
ExecStartPre=+/usr/bin/randomx_boost.sh
ExecStartPre=+/usr/bin/enable_1gb_pages.sh
ExecStartPre=/usr/bin/xmrig --config=/etc/xmrig/config.json --dry-run
ExecStart=/usr/bin/xmrig --config=/etc/xmrig/config.json
StandardOutput=journal
StandardError=journal
DynamicUser=true
Nice=19
CPUSchedulingPolicy=idle
PrivateTmp=true
ProtectHome=true
ProtectSystem=strict
NoNewPrivileges=true
# PrivateDevices=true # https://github.com/systemd/systemd/issues/13857
CapabilityBoundingSet=
#ProtectClock=true # https://github.com/systemd/systemd/issues/20835
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=true
PrivateUsers=true
ConfigurationDirectory=xmrig

[Install]
WantedBy=multi-user.target