31 lines
785 B
Django/Jinja
31 lines
785 B
Django/Jinja
|
|
[Unit]
|
||
|
|
Description=AMD GPU Sysfs Metrics Exporter
|
||
|
|
After=network-online.target
|
||
|
|
Wants=network-online.target
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Type=simple
|
||
|
|
User={{ amd_exporter_user }}
|
||
|
|
Group={{ amd_exporter_user }}
|
||
|
|
WorkingDirectory={{ amd_exporter_install_dir }}
|
||
|
|
Environment="AMD_EXPORTER_PORT={{ amd_exporter_port }}"
|
||
|
|
Environment="AMD_EXPORTER_BIND=0.0.0.0"
|
||
|
|
Environment="PATH={{ amd_exporter_venv_bin }}:/usr/bin:/bin"
|
||
|
|
ExecStart={{ amd_exporter_venv_bin }}/python3 {{ amd_exporter_script_path }}
|
||
|
|
Restart=always
|
||
|
|
RestartSec=10
|
||
|
|
TimeoutStopSec=10
|
||
|
|
StandardOutput=journal
|
||
|
|
StandardError=journal
|
||
|
|
SyslogIdentifier=amdgpu_exporter
|
||
|
|
|
||
|
|
# Security hardening
|
||
|
|
ProtectSystem=strict
|
||
|
|
ProtectHome=true
|
||
|
|
ReadWritePaths={{ amd_exporter_install_dir }} /var/log
|
||
|
|
NoNewPrivileges=true
|
||
|
|
PrivateTmp=true
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=multi-user.target
|