aboutsummaryrefslogtreecommitdiff
path: root/package/collectd
diff options
context:
space:
mode:
authorGravatar Maxime Hadjinlian <maxime.hadjinlian@gmail.com>2016-02-21 14:09:15 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-02-21 14:28:43 +0100
commit7f18274a92e4db5c4cac1c248a40cbd3be91db7d (patch)
tree7f31857079097db9c38b4745da1dcb9db67a54ac /package/collectd
parent2511024c8135b57891f7eb540c5523749d26d647 (diff)
downloadbuildroot-7f18274a92e4db5c4cac1c248a40cbd3be91db7d.tar.gz
buildroot-7f18274a92e4db5c4cac1c248a40cbd3be91db7d.tar.bz2
collectd: Add service file
The service file was taken from Debian. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/collectd')
-rw-r--r--package/collectd/collectd.mk8
-rw-r--r--package/collectd/collectd.service17
2 files changed, 25 insertions, 0 deletions
diff --git a/package/collectd/collectd.mk b/package/collectd/collectd.mk
index eb66f2563e..78e24b8a0f 100644
--- a/package/collectd/collectd.mk
+++ b/package/collectd/collectd.mk
@@ -185,4 +185,12 @@ define COLLECTD_INSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/share/collectd/postgresql_default.conf
endef
+define COLLECTD_INSTALL_INIT_SYSTEMD
+ $(INSTALL) -D -m 644 package/collectd/collectd.service \
+ $(TARGET_DIR)/usr/lib/systemd/system/collectd.service
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+ ln -fs ../../../../usr/lib/systemd/system/collectd.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/collectd.service
+endef
+
$(eval $(autotools-package))
diff --git a/package/collectd/collectd.service b/package/collectd/collectd.service
new file mode 100644
index 0000000000..e203806f59
--- /dev/null
+++ b/package/collectd/collectd.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Statistics collection and monitoring daemon
+After=local-fs.target network.target
+Requires=local-fs.target network.target
+ConditionPathExists=/etc/collectd.conf
+
+[Service]
+Type=notify
+NotifyAccess=main
+EnvironmentFile=-/etc/default/collectd
+ExecStartPre=/usr/sbin/collectd -t
+ExecStart=/usr/sbin/collectd
+Restart=always
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target