* [meta-oe][PATCH] collectd: add systemd unit file
@ 2014-09-18 1:23 Chong Lu
2014-09-18 1:25 ` Chong Lu
0 siblings, 1 reply; 2+ messages in thread
From: Chong Lu @ 2014-09-18 1:23 UTC (permalink / raw)
To: openembedded-devel
Add systemd unit file for collectd.
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
meta-oe/recipes-extended/collectd/collectd/collectd.service | 12 ++++++++++++
meta-oe/recipes-extended/collectd/collectd_5.4.1.bb | 13 +++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
create mode 100644 meta-oe/recipes-extended/collectd/collectd/collectd.service
diff --git a/meta-oe/recipes-extended/collectd/collectd/collectd.service b/meta-oe/recipes-extended/collectd/collectd/collectd.service
new file mode 100644
index 0000000..d835b73
--- /dev/null
+++ b/meta-oe/recipes-extended/collectd/collectd/collectd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Collectd
+After=local-fs.target network.target
+Requires=local-fs.target network.target
+
+[Service]
+ExecStart=@SBINDIR@/collectd -C /etc/collectd.conf -f
+Restart=always
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb b/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb
index dc5f88f..46752c8 100644
--- a/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb
+++ b/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb
@@ -9,11 +9,14 @@ SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
file://no-gcrypt-badpath.patch \
file://collectd-version.patch \
file://glibc-2.20-compatiblity.patch \
- file://collectd.init"
+ file://collectd.init \
+ file://collectd.service"
SRC_URI[md5sum] = "6f56c71c96573a7f4f7fb3bfab185974"
SRC_URI[sha256sum] = "75452129f271cb0aad28e57f12a49070618bbb7b6a9d64cf869e8766fa2f66e0"
-inherit autotools pythonnative update-rc.d pkgconfig
+inherit autotools pythonnative update-rc.d pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "collectd.service"
# Floatingpoint layout, architecture dependent
# 'nothing', 'endianflip' or 'intswap'
@@ -55,6 +58,12 @@ do_install_append() {
rmdir "${D}${localstatedir}/run"
rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/collectd.service
}
INITSCRIPT_NAME = "collectd"
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [meta-oe][PATCH] collectd: add systemd unit file
2014-09-18 1:23 [meta-oe][PATCH] collectd: add systemd unit file Chong Lu
@ 2014-09-18 1:25 ` Chong Lu
0 siblings, 0 replies; 2+ messages in thread
From: Chong Lu @ 2014-09-18 1:25 UTC (permalink / raw)
To: openembedded-devel
This patch based on http://patches.openembedded.org/patch/79835/
Thanks
Chong
On 09/18/2014 09:23 AM, Chong Lu wrote:
> Add systemd unit file for collectd.
>
> Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
> ---
> meta-oe/recipes-extended/collectd/collectd/collectd.service | 12 ++++++++++++
> meta-oe/recipes-extended/collectd/collectd_5.4.1.bb | 13 +++++++++++--
> 2 files changed, 23 insertions(+), 2 deletions(-)
> create mode 100644 meta-oe/recipes-extended/collectd/collectd/collectd.service
>
> diff --git a/meta-oe/recipes-extended/collectd/collectd/collectd.service b/meta-oe/recipes-extended/collectd/collectd/collectd.service
> new file mode 100644
> index 0000000..d835b73
> --- /dev/null
> +++ b/meta-oe/recipes-extended/collectd/collectd/collectd.service
> @@ -0,0 +1,12 @@
> +[Unit]
> +Description=Collectd
> +After=local-fs.target network.target
> +Requires=local-fs.target network.target
> +
> +[Service]
> +ExecStart=@SBINDIR@/collectd -C /etc/collectd.conf -f
> +Restart=always
> +RestartSec=10
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb b/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb
> index dc5f88f..46752c8 100644
> --- a/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb
> +++ b/meta-oe/recipes-extended/collectd/collectd_5.4.1.bb
> @@ -9,11 +9,14 @@ SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
> file://no-gcrypt-badpath.patch \
> file://collectd-version.patch \
> file://glibc-2.20-compatiblity.patch \
> - file://collectd.init"
> + file://collectd.init \
> + file://collectd.service"
> SRC_URI[md5sum] = "6f56c71c96573a7f4f7fb3bfab185974"
> SRC_URI[sha256sum] = "75452129f271cb0aad28e57f12a49070618bbb7b6a9d64cf869e8766fa2f66e0"
>
> -inherit autotools pythonnative update-rc.d pkgconfig
> +inherit autotools pythonnative update-rc.d pkgconfig systemd
> +
> +SYSTEMD_SERVICE_${PN} = "collectd.service"
>
> # Floatingpoint layout, architecture dependent
> # 'nothing', 'endianflip' or 'intswap'
> @@ -55,6 +58,12 @@ do_install_append() {
>
> rmdir "${D}${localstatedir}/run"
> rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
> +
> + # Install systemd unit files
> + install -d ${D}${systemd_unitdir}/system
> + install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
> + sed -i -e 's,@SBINDIR@,${sbindir},g' \
> + ${D}${systemd_unitdir}/system/collectd.service
> }
>
> INITSCRIPT_NAME = "collectd"
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-18 1:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 1:23 [meta-oe][PATCH] collectd: add systemd unit file Chong Lu
2014-09-18 1:25 ` Chong Lu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.