Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Shakeel, Muhammad" <muhammad_shakeel@mentor.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/4] lighttpd: Add systemd support
Date: Thu,  1 Aug 2013 16:43:20 +0500	[thread overview]
Message-ID: <1375357402-10147-2-git-send-email-muhammad_shakeel@mentor.com> (raw)
In-Reply-To: <1375357402-10147-1-git-send-email-muhammad_shakeel@mentor.com>

From: Muhammad Shakeel <muhammad_shakeel@mentor.com>

- Remove dependency on meta-systemd

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
---
 .../lighttpd/files/lighttpd.service                |   12 ++++++++++++
 meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb  |   14 ++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/lighttpd/files/lighttpd.service b/meta/recipes-extended/lighttpd/files/lighttpd.service
new file mode 100644
index 0000000..a5333b6
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/files/lighttpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Lightning Fast Webserver With Light System Requirements
+After=network.target
+
+[Service]
+ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd.conf
+ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd.conf
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb b/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb
index df6ce97..f473632 100644
--- a/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb
+++ b/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb
@@ -22,6 +22,7 @@ SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.t
         file://index.html.lighttpd \
         file://lighttpd.conf \
         file://lighttpd \
+        file://lighttpd.service \
         "
 
 SRC_URI[md5sum] = "8e2d4ae8e918d4de1aeb9842584d170b"
@@ -39,19 +40,28 @@ EXTRA_OECONF = " \
              --disable-static \
 "
 
-inherit autotools pkgconfig update-rc.d gettext
+inherit autotools pkgconfig update-rc.d gettext systemd
 
 INITSCRIPT_NAME = "lighttpd"
 INITSCRIPT_PARAMS = "defaults 70"
 
+SYSTEMD_SERVICE_${PN} = "lighttpd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d ${D}/www/logs ${D}/www/pages/dav ${D}/www/var
     install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
     install -m 0755 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
     install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system
+    sed -i 's,/usr/sbin,${sbindir},g' ${D}${systemd_unitdir}/system/lighttpd.service
+    sed -i 's,/etc,${sysconfdir},g' ${D}${systemd_unitdir}/system/lighttpd.service
+    sed -i 's,/bin,${base_bindir},g' ${D}${systemd_unitdir}/system/lighttpd.service
 }
 
-FILES_${PN} += "${sysconfdir} /www"
+FILES_${PN} += "${sysconfdir} /www ${systemd_unitdir}"
 
 CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
 
-- 
1.7.9.5



  reply	other threads:[~2013-08-01 11:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 11:43 [PATCH 1/4] openssh: Add systemd support Shakeel, Muhammad
2013-08-01 11:43 ` Shakeel, Muhammad [this message]
2013-08-01 11:43 ` [PATCH 3/4] rpcbind: " Shakeel, Muhammad
2013-08-01 12:34   ` Enrico Scholz
2013-08-01 11:43 ` [PATCH 4/4] nfs-utils: " Shakeel, Muhammad
2013-08-01 12:27   ` Enrico Scholz

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=1375357402-10147-2-git-send-email-muhammad_shakeel@mentor.com \
    --to=muhammad_shakeel@mentor.com \
    --cc=openembedded-core@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