tiagocoutinho / modbus-proxy

Connect multiple clients to modbus devices
Other
71 stars 13 forks source link

Systemd service #19

Closed ChristophCaina closed 1 year ago

ChristophCaina commented 1 year ago

It would make sense to give a short description on how to setup the modbus proxy as a service (systemd)... I don't know, if this should go to the "readme" directly, since it might be different depending on the host system... therefore, it might be something for a wiki instead? Therefore I haven't added this to the readme and made a pr... if you want, I can add it :)

  1. I have moved the config file to /usr/lib/mproxy-conf.yaml
  2. go to /etc/systemd/system/
  3. use nano to create a service file nano mproxy.service
  4. the file should contain the following information:
    
    [Unit]
    Description=Modbus-Proxy
    After=network.target

[Service] Type=simple Restart=always ExecStart = modbus-proxy -c ./usr/lib/mproxy-conf.yaml

[Install] WantedBy=multi-user.target


5. `run systemctl daemon-reload`
6. `systemctl enable mproxy.service`
7. `systemctl start mproxy.service`

With the command systemctl status mproxy.service can you check, if the software / service was started successfully and if it is running.
tiagocoutinho commented 1 year ago

Thank you for the proposal. I think this could be a good chapter for the readme. If you could make a PR it would be awesome

ChristophCaina commented 1 year ago

done #21

tiagocoutinho commented 1 year ago

Thank you!