Add systemd service information.

This commit is contained in:
Mark Nellemann 2021-01-22 09:14:03 +01:00
parent 68f37c6fd7
commit 272b2aa375
3 changed files with 18 additions and 4 deletions

10
doc/hmci.service Normal file
View file

@ -0,0 +1,10 @@
[Unit]
Description=HMC Insights Service
[Service]
TimeoutStartSec=0
Restart=always
ExecStart=/opt/hmci/bin/hmci
[Install]
WantedBy=default.target

4
doc/service.txt Normal file
View file

@ -0,0 +1,4 @@
To setup as a systemd service, copy the hmci.service
file into /etc/systemd/system/ and enable the service:
systemctl enable hmci.service

View file

@ -105,11 +105,11 @@ class InfluxClient {
synchronized void writeBatchPoints() throws Exception {
log.debug("writeBatchPoints()");
try {
influxDB.write(batchPoints);
influxDB.writeWithRetry(batchPoints);
} catch(Exception e) {
log.error("writeBatchPoints() error - " + e.getMessage(), e);
if(++errorCounter > 3) {
log.info("writeBatchPoints() trying to logout / login");
log.error("writeBatchPoints() error - " + e.getMessage());
if(++errorCounter > 5) {
log.info("writeBatchPoints() forcing logout / login");
errorCounter = 0;
logoff();
login();