change user
This commit is contained in:
@@ -68,9 +68,9 @@ extended.
|
|||||||
## Installation (systemd)
|
## Installation (systemd)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Create directory + user
|
# 1. Create directory + user (the "prometheus" system user is typically
|
||||||
|
# already present if Prometheus itself is installed on this host)
|
||||||
sudo mkdir -p /opt/vw-eu-data-act-exporter
|
sudo mkdir -p /opt/vw-eu-data-act-exporter
|
||||||
sudo useradd --system --no-create-home --shell /usr/sbin/nologin vw-exporter
|
|
||||||
|
|
||||||
# 2. Copy files
|
# 2. Copy files
|
||||||
sudo cp vw-eu-data-act-exporter.py config.py requirements.txt /opt/vw-eu-data-act-exporter/
|
sudo cp vw-eu-data-act-exporter.py config.py requirements.txt /opt/vw-eu-data-act-exporter/
|
||||||
@@ -83,7 +83,7 @@ sudo /opt/vw-eu-data-act-exporter/venv/bin/pip install -r /opt/vw-eu-data-act-ex
|
|||||||
sudo nano /opt/vw-eu-data-act-exporter/config.py
|
sudo nano /opt/vw-eu-data-act-exporter/config.py
|
||||||
|
|
||||||
# 5. Permissions (config.py contains the VW account password in plain text)
|
# 5. Permissions (config.py contains the VW account password in plain text)
|
||||||
sudo chown -R vw-exporter:vw-exporter /opt/vw-eu-data-act-exporter
|
sudo chown -R prometheus:prometheus /opt/vw-eu-data-act-exporter
|
||||||
sudo chmod 600 /opt/vw-eu-data-act-exporter/config.py
|
sudo chmod 600 /opt/vw-eu-data-act-exporter/config.py
|
||||||
|
|
||||||
# 6. Install systemd unit
|
# 6. Install systemd unit
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ Wants=network-online.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=vw-exporter
|
User=prometheus
|
||||||
Group=vw-exporter
|
Group=prometheus
|
||||||
WorkingDirectory=/opt/vw-eu-data-act-exporter
|
WorkingDirectory=/opt/vw-eu-data-act-exporter
|
||||||
ExecStart=/opt/vw-eu-data-act-exporter/venv/bin/python3 /opt/vw-eu-data-act-exporter/vw-eu-data-act-exporter.py
|
ExecStart=/opt/vw-eu-data-act-exporter/venv/bin/python3 /opt/vw-eu-data-act-exporter/vw-eu-data-act-exporter.py
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|||||||
Reference in New Issue
Block a user