mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Clemens Gruber <clemens.gruber@pqgruber.com>
To: ptxdist@pengutronix.de
Cc: Clemens Gruber <clemens.gruber@pqgruber.com>
Subject: [ptxdist] [PATCH 7/7] rrdtool: add systemd unit for rrdcached
Date: Fri, 21 Apr 2017 22:42:06 +0200	[thread overview]
Message-ID: <20170421204206.31312-7-clemens.gruber@pqgruber.com> (raw)
In-Reply-To: <20170421204206.31312-1-clemens.gruber@pqgruber.com>

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
 projectroot/lib/systemd/system/rrdcached.service |  5 +++++
 projectroot/lib/systemd/system/rrdcached.socket  |  8 ++++++++
 rules/rrdtool.in                                 | 12 ++++++++++++
 rules/rrdtool.make                               |  8 ++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 projectroot/lib/systemd/system/rrdcached.service
 create mode 100644 projectroot/lib/systemd/system/rrdcached.socket

diff --git a/projectroot/lib/systemd/system/rrdcached.service b/projectroot/lib/systemd/system/rrdcached.service
new file mode 100644
index 000000000..bb30a502e
--- /dev/null
+++ b/projectroot/lib/systemd/system/rrdcached.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=Data caching daemon for rrdtool
+
+[Service]
+ExecStart=/usr/bin/rrdcached -g
diff --git a/projectroot/lib/systemd/system/rrdcached.socket b/projectroot/lib/systemd/system/rrdcached.socket
new file mode 100644
index 000000000..d3f6b277f
--- /dev/null
+++ b/projectroot/lib/systemd/system/rrdcached.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=rrdcached socket
+
+[Socket]
+ListenStream=/tmp/rrdcached.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/rules/rrdtool.in b/rules/rrdtool.in
index fa7e1de1c..fb91a8b84 100644
--- a/rules/rrdtool.in
+++ b/rules/rrdtool.in
@@ -34,6 +34,18 @@ config RRDTOOL_RRDCACHED
 	  accumulates them and, if enough have been received or a defined
 	  time has passed, writes the updates to the RRD file.
 
+if RRDTOOL_RRDCACHED
+
+config RRDTOOL_RRDCACHED_SYSTEMD_UNIT
+	bool
+	default y
+	depends on SYSTEMD
+	prompt "install rrdcached systemd unit"
+	help
+	  Install and enable a systemd socket-activated service
+
+endif
+
 config RRDTOOL_RRDCGI
 	bool
 	depends on RRDTOOL_RRD_GRAPH
diff --git a/rules/rrdtool.make b/rules/rrdtool.make
index 2c7453811..d43dcac61 100644
--- a/rules/rrdtool.make
+++ b/rules/rrdtool.make
@@ -82,6 +82,14 @@ $(STATEDIR)/rrdtool.targetinstall:
 
 ifdef PTXCONF_RRDTOOL_RRDCACHED
 	@$(call install_copy, rrdtool, 0, 0, 0755, -, /usr/bin/rrdcached)
+ifdef PTXCONF_RRDTOOL_RRDCACHED_SYSTEMD_UNIT
+	@$(call install_alternative, rrdtool, 0, 0, 0644, \
+		/lib/systemd/system/rrdcached.service)
+	@$(call install_alternative, rrdtool, 0, 0, 0644, \
+		/lib/systemd/system/rrdcached.socket)
+	@$(call install_link, rrdtool, ../rrdcached.socket, \
+		/lib/systemd/system/sockets.target.wants/rrdcached.socket)
+endif
 endif
 ifdef PTXCONF_RRDTOOL_RRDCGI
 	@$(call install_copy, rrdtool, 0, 0, 0755, -, /usr/bin/rrdcgi)
-- 
2.12.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2017-04-21 20:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 20:42 [ptxdist] [PATCH 1/7] collectd: add memory, ping and rrdcached plugin Clemens Gruber
2017-04-21 20:42 ` [ptxdist] [PATCH 2/7] collectd: improve systemd service file Clemens Gruber
2017-04-28 12:47   ` Michael Olbrich
2017-04-21 20:42 ` [ptxdist] [PATCH 3/7] collectd: version bump 5.7.0 -> 5.7.1 Clemens Gruber
2017-04-21 20:42 ` [ptxdist] [PATCH 4/7] ethtool: version bump 4.8 -> 4.10 Clemens Gruber
2017-04-21 20:42 ` [ptxdist] [PATCH 5/7] liboping: version bump 1.6.2 -> 1.9.0 Clemens Gruber
2017-04-21 20:42 ` [ptxdist] [PATCH 6/7] net-snmp: add patch for CVE-2015-5621 Clemens Gruber
2017-04-21 20:42 ` Clemens Gruber [this message]
2017-04-28 12:39   ` [ptxdist] [PATCH 7/7] rrdtool: add systemd unit for rrdcached Michael Olbrich
2017-04-28 12:46     ` Clemens Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170421204206.31312-7-clemens.gruber@pqgruber.com \
    --to=clemens.gruber@pqgruber.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox