Skip to content

Commit

Permalink
Add systemd unit example
Browse files Browse the repository at this point in the history
Signed-off-by: Utku Ozdemir <uoz@protonmail.com>
  • Loading branch information
utkuozdemir committed Jun 21, 2021
1 parent 3e90e94 commit 685fe7b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- ".gitignore"
- "samples/**"
- "grafana/**"
- "systemd/**"
pull_request:
branches:
- master
Expand All @@ -17,6 +18,7 @@ on:
- ".gitignore"
- "samples/**"
- "grafana/**"
- "systemd/**"
jobs:
build:
runs-on: ubuntu-20.04
Expand Down
30 changes: 30 additions & 0 deletions systemd/nvidia_gpu_exporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[Unit]
Description=Nvidia GPU Exporter
After=network-online.target

[Service]
Type=simple

User=nvidia_gpu_exporter
Group=nvidia_gpu_exporter

ExecStart=/usr/local/bin/nvidia_gpu_exporter

SyslogIdentifier=nvidia_gpu_exporter

Restart=always
RestartSec=1

NoNewPrivileges=yes

ProtectHome=yes
ProtectSystem=strict
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectProc=yes

[Install]
WantedBy=multi-user.target

0 comments on commit 685fe7b

Please sign in to comment.