Skip to content

Commit

Permalink
Merge pull request #68 from RichiH/bastischubert/1709745549
Browse files Browse the repository at this point in the history
Rework systemd example
  • Loading branch information
bastischubert authored Mar 6, 2024
2 parents 7d0d073 + af0467d commit bbb0902
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ format.

## Systemd service

You can create a systemd service if you want to run modbus exporter as a service in the background. Start by creating a modbus_exporter system account (on Debian)
You can create a systemd service if you want to run modbus exporter as a service in the background. Start by creating a modbus_exporter system account (example on Debian)

```shell
useradd -r modbus_exporter
```

Place the modbus_exporter binary at `/usr/local/bin/modbus_exporter`

The following systemd unit file can be saved to `/etc/systemd/system/modbus_exporter.service`:
The following example systemd unit file can be saved to `/etc/systemd/system/modbus_exporter.service`:

```systemd
[Unit]
Expand All @@ -111,11 +111,9 @@ Wants=network-online.target
[Service]
User=modbus_exporter
Group=nogroup
ExecStart=modbus_exporter --config.file='/etc/modbus_exporter.yml'
ExecStart=/usr/local/bin/modbus_exporter --config.file='/etc/modbus_exporter.yml'
Restart=on-failure
RestartSec=1
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Expand Down

0 comments on commit bbb0902

Please sign in to comment.