All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] lighttpd: Add systemd support.
@ 2013-07-05 14:03 Noor, Ahsan
  2013-07-08 19:22 ` Saul Wold
  0 siblings, 1 reply; 3+ messages in thread
From: Noor, Ahsan @ 2013-07-05 14:03 UTC (permalink / raw)
  To: openembedded-core

From: Noor <noor_ahsan@mentor.com>

* Enable lighttpd with systemd support.
* Replace the hardcoded paths with sbindir, sysconfdir and base_bindir

Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
---
 .../lighttpd/files/lighttpd.service                |   12 ++++++++++
 meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb  |   24 ++++++++++++++++----
 2 files changed, 32 insertions(+), 4 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..3c03938 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,34 @@ 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 -d ${D}${sysconfdir} ${D}/www/logs ${D}/www/pages/dav ${D}/www/var
     install -m 0755 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
     install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
+    if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+        install -d ${D}${sysconfdir}/init.d
+        install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
+    else
+        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
+    fi
+
 }
 
-FILES_${PN} += "${sysconfdir} /www"
+FILES_${PN} += "${sysconfdir} /www ${systemd_unitdir}"
 
 CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
 
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] lighttpd: Add systemd support.
  2013-07-05 14:03 [PATCH v2] lighttpd: Add systemd support Noor, Ahsan
@ 2013-07-08 19:22 ` Saul Wold
  2013-07-09  8:39   ` Ahsan, Noor
  0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2013-07-08 19:22 UTC (permalink / raw)
  To: Noor, Ahsan; +Cc: openembedded-core

On 07/05/2013 07:03 AM, Noor, Ahsan wrote:
> From: Noor <noor_ahsan@mentor.com>
>
> * Enable lighttpd with systemd support.
> * Replace the hardcoded paths with sbindir, sysconfdir and base_bindir
>
> Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
> ---
>   .../lighttpd/files/lighttpd.service                |   12 ++++++++++
>   meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb  |   24 ++++++++++++++++----
>   2 files changed, 32 insertions(+), 4 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..3c03938 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,34 @@ 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 -d ${D}${sysconfdir} ${D}/www/logs ${D}/www/pages/dav ${D}/www/var
>       install -m 0755 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
>       install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
> +    if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
I am not sure this is the best way as it may be possible to have both 
sysvinit and systemd in DISTRO_FEATURES.  I think it would be better to 
test for each individually and install based on that.

Sau!

> +        install -d ${D}${sysconfdir}/init.d
> +        install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
> +    else
> +        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
> +    fi
> +
>   }
>
> -FILES_${PN} += "${sysconfdir} /www"
> +FILES_${PN} += "${sysconfdir} /www ${systemd_unitdir}"
>
>   CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] lighttpd: Add systemd support.
  2013-07-08 19:22 ` Saul Wold
@ 2013-07-09  8:39   ` Ahsan, Noor
  0 siblings, 0 replies; 3+ messages in thread
From: Ahsan, Noor @ 2013-07-09  8:39 UTC (permalink / raw)
  To: Saul Wold; +Cc: openembedded-core

I have fixed it and sent another patch.

Noor

-----Original Message-----
From: Saul Wold [mailto:sgw@linux.intel.com] 
Sent: Tuesday, July 09, 2013 12:22 AM
To: Ahsan, Noor
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2] lighttpd: Add systemd support.

On 07/05/2013 07:03 AM, Noor, Ahsan wrote:
> From: Noor <noor_ahsan@mentor.com>
>
> * Enable lighttpd with systemd support.
> * Replace the hardcoded paths with sbindir, sysconfdir and base_bindir
>
> Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
> ---
>   .../lighttpd/files/lighttpd.service                |   12 ++++++++++
>   meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb  |   24 ++++++++++++++++----
>   2 files changed, 32 insertions(+), 4 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..3c03938 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,34 @@ 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 -d ${D}${sysconfdir} ${D}/www/logs ${D}/www/pages/dav 
> + ${D}/www/var
>       install -m 0755 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
>       install -m 0644 ${WORKDIR}/index.html.lighttpd 
> ${D}/www/pages/index.html
> +    if 
> + ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; 
> + then
I am not sure this is the best way as it may be possible to have both sysvinit and systemd in DISTRO_FEATURES.  I think it would be better to test for each individually and install based on that.

Sau!

> +        install -d ${D}${sysconfdir}/init.d
> +        install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
> +    else
> +        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
> +    fi
> +
>   }
>
> -FILES_${PN} += "${sysconfdir} /www"
> +FILES_${PN} += "${sysconfdir} /www ${systemd_unitdir}"
>
>   CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-09  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05 14:03 [PATCH v2] lighttpd: Add systemd support Noor, Ahsan
2013-07-08 19:22 ` Saul Wold
2013-07-09  8:39   ` Ahsan, Noor

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.