collectd supports systemd notify. Also add requirements and increase
RestartSec. This is the Debian service file without docs and default
env file.

Signed-off-by: Clemens Gruber <clemens.gru...@pqgruber.com>
---
 projectroot/lib/systemd/system/collectd.service | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/projectroot/lib/systemd/system/collectd.service 
b/projectroot/lib/systemd/system/collectd.service
index 752245c05..5748a6438 100644
--- a/projectroot/lib/systemd/system/collectd.service
+++ b/projectroot/lib/systemd/system/collectd.service
@@ -1,9 +1,16 @@
 [Unit]
-Description=statistics collection daemon
+Description=Statistics collection and monitoring daemon
+After=local-fs.target network.target
+Requires=local-fs.target network.target
+ConditionPathExists=/etc/collectd/collectd.conf
 
 [Service]
-ExecStart=/usr/sbin/collectd -f
+Type=notify
+NotifyAccess=main
+ExecStartPre=/usr/sbin/collectd -t
+ExecStart=/usr/sbin/collectd
 Restart=always
+RestartSec=10
 
 [Install]
 WantedBy=multi-user.target
-- 
2.12.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to