Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Chong Lu <Chong.Lu@windriver.com>
To: <openembedded-devel@lists.openembedded.org>
Subject: Re: [meta-oe][PATCH] collectd: add systemd unit file
Date: Thu, 18 Sep 2014 09:25:52 +0800	[thread overview]
Message-ID: <541A34A0.80008@windriver.com> (raw)
In-Reply-To: <1411003439-20287-1-git-send-email-Chong.Lu@windriver.com>

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"



      reply	other threads:[~2014-09-18  1:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  1:23 [meta-oe][PATCH] collectd: add systemd unit file Chong Lu
2014-09-18  1:25 ` Chong Lu [this message]

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=541A34A0.80008@windriver.com \
    --to=chong.lu@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /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