From a78ea040cb931a96190bcf6fc55643b41ccc311d Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Sat, 4 Jul 2015 00:54:46 +0200 Subject: [PATCH] add systemd support Mostly based on recommendations from: https://wiki.debian.org/Teams/pkg-systemd/Packaging --- debian/changelog | 2 ++ debian/collectd.service | 17 +++++++++++++++++ debian/control | 2 +- debian/rules | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 debian/collectd.service diff --git a/debian/changelog b/debian/changelog index 7d5f3a6..c5cfc2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,8 @@ collectd (5.5.0-1) UNRELEASED; urgency=medium plugin). - Add Build-depend on libudev-dev (used by disk plugin to enable udev-based device renaming on Linux) (Closes: #588153, #632936). + * debian/control, debian/rules, debian/collectd.service: + - Add systemd service file (Closes: #762586) -- Marc Fournier Tue, 30 Jun 2015 07:08:39 +0200 diff --git a/debian/collectd.service b/debian/collectd.service new file mode 100644 index 0000000..806d804 --- /dev/null +++ b/debian/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 +Documentation=man:collectd(1) +Documentation=man:collectd.conf(5) +Documentation=https://collectd.org + +[Service] +Type=notify +NotifyAccess=main +ExecStart=/usr/sbin/collectd +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target diff --git a/debian/control b/debian/control index fc50307..ddee973 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: collectd Section: utils Priority: optional Maintainer: Sebastian Harl -Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.10), po-debconf, dpatch, +Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.10), po-debconf, dpatch, dh-systemd (>= 1.5), bison, flex, autotools-dev, libltdl-dev, pkg-config, iptables-dev (>= 1.4.3.2-2) [linux-any], javahelper, diff --git a/debian/rules b/debian/rules index f9313e3..3346909 100755 --- a/debian/rules +++ b/debian/rules @@ -272,7 +272,9 @@ binary-arch: build install-arch && rm -f lib/Collectd/Graph/File.pm lib/Collectd/Graph/Filter.pm \ && rm -f lib/Collectd/Graph/MetaData.pm ) dh_installdebconf -a + dh_systemd_enable -pcollectd-core --name=collectd collectd.service dh_installinit -pcollectd-core --name=collectd -- defaults 95 + dh_systemd_start dh_link -a dh_strip -a --dbg-package=collectd-dbg dh_compress -a -Xexamples/ -- 2.30.2