Skip to content

Commit bc3f120

Browse files
Update README.md (tiagocoutinho#21)
added service configuration
1 parent fd3fe68 commit bc3f120

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,29 @@ Finally run a the example client but now address the proxy instead of the server
116116
$ python examples/simple_tcp_client.py -a 0:9000
117117
holding registers: [1, 2, 3, 4]
118118
```
119+
## Running as a Service
120+
1. move the config file to a location you can remember, for example: to `/usr/lib/mproxy-conf.yaml`
121+
2. go to `/etc/systemd/system/`
122+
3. use nano or any other text editor of your choice to create a service file `mproxy.service`
123+
4. the file should contain the following information:
124+
```
125+
[Unit]
126+
Description=Modbus-Proxy
127+
After=network.target
128+
129+
[Service]
130+
Type=simple
131+
Restart=always
132+
ExecStart = modbus-proxy -c ./usr/lib/mproxy-conf.yaml
133+
134+
[Install]
135+
WantedBy=multi-user.target
136+
```
137+
5. `run systemctl daemon-reload`
138+
6. `systemctl enable mproxy.service`
139+
7. `systemctl start mproxy.service`
140+
141+
The file names given here are examples, you can choose other names, if you wish.
119142

120143
## Docker
121144

0 commit comments

Comments
 (0)