From 26b35c669d9cea5ffa6710e29870822cc3961858 Mon Sep 17 00:00:00 2001 From: Georgi Boyvalenkov Date: Fri, 12 Aug 2022 17:04:11 +0300 Subject: [PATCH 1/2] Add systemd service configuration file - service and sample configuration file added - not sure if name should be metrics or system-metrics Signed-off-by: Georgi Boyvalenkov --- resources/config.json | 3 +++ resources/system-metrics.service | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 resources/config.json create mode 100644 resources/system-metrics.service diff --git a/resources/config.json b/resources/config.json new file mode 100644 index 0000000..75fd40a --- /dev/null +++ b/resources/config.json @@ -0,0 +1,3 @@ +{ + "logFile": "/var/log/system-metrics/system-metrics.log" +} diff --git a/resources/system-metrics.service b/resources/system-metrics.service new file mode 100644 index 0000000..d635af9 --- /dev/null +++ b/resources/system-metrics.service @@ -0,0 +1,14 @@ +[Unit] +Description=Eclipse Kanto - System Metrics +Documentation=https://eclipse.org/kanto/docs/ +After=network.target mosquitto.service +Requires=network.target +Requires=mosquitto.service + +[Service] +Type=simple +ExecStart=/usr/bin/metrics -configFile /etc/system-metrics/config.json +Restart=always + +[Install] +WantedBy=multi-user.target From 90dd92506503accc1807cf9a0e43d4500e5c8d96 Mon Sep 17 00:00:00 2001 From: Georgi Boyvalenkov Date: Mon, 15 Aug 2022 12:38:10 +0300 Subject: [PATCH 2/2] Add systemd service configuration file - executable name clarified Signed-off-by: Georgi Boyvalenkov --- resources/system-metrics.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/system-metrics.service b/resources/system-metrics.service index d635af9..1fa8584 100644 --- a/resources/system-metrics.service +++ b/resources/system-metrics.service @@ -7,7 +7,7 @@ Requires=mosquitto.service [Service] Type=simple -ExecStart=/usr/bin/metrics -configFile /etc/system-metrics/config.json +ExecStart=/usr/bin/system-metrics -configFile /etc/system-metrics/config.json Restart=always [Install]