* [PATCH] thttpd: thttpd to systemd
2018-04-04 9:27 [PATCH] remove the layer directories Huang Qiyu
@ 2018-04-04 9:27 ` Huang Qiyu
2018-04-04 17:54 ` [PATCH] remove the layer directories Denys Dmytriyenko
1 sibling, 0 replies; 3+ messages in thread
From: Huang Qiyu @ 2018-04-04 9:27 UTC (permalink / raw)
To: meta-arago
Since the old thttpd still uses sysvinit, is not consistent with the mainstream background OSS.
Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
---
.../thttpd/thttpd-2.28/thttpd.conf | 14 +++++++
.../thttpd/thttpd-2.28/thttpd.service | 12 ++++++
.../recipes-extended/thttpd/thttpd_2.28.bb | 45 ++++++++++++++++++----
3 files changed, 63 insertions(+), 8 deletions(-)
create mode 100644 meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.conf
create mode 100644 meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.service
diff --git a/meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.conf b/meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.conf
new file mode 100644
index 0000000..380b024
--- /dev/null
+++ b/meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.conf
@@ -0,0 +1,14 @@
+dir=/var/www/thttpd
+chroot
+user=thttpd # default = nobody
+logfile=/var/log/thttpd.log
+pidfile=/var/run/thttpd.pid
+# This section _documents_ defaults in effect
+# port=80
+# nosymlink # default = !chroot
+# novhost
+# nocgipat
+# nothrottles
+# host=0.0.0.0
+# charset=iso-8859-1
+
diff --git a/meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.service b/meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.service
new file mode 100644
index 0000000..2f20663
--- /dev/null
+++ b/meta-arago-extras/recipes-extended/thttpd/thttpd-2.28/thttpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Tiny/Turbo/Throttling Web Server
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/thttpd.pid
+EnvironmentFile=-/etc/sysconfig/thttpd
+ExecStart=/usr/sbin/thttpd -C /etc/thttpd.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-arago-extras/recipes-extended/thttpd/thttpd_2.28.bb b/meta-arago-extras/recipes-extended/thttpd/thttpd_2.28.bb
index 0477509..0644677 100644
--- a/meta-arago-extras/recipes-extended/thttpd/thttpd_2.28.bb
+++ b/meta-arago-extras/recipes-extended/thttpd/thttpd_2.28.bb
@@ -12,7 +12,10 @@ SRC_URI = "http://www.acme.com/software/thttpd/thttpd-${PV}.tar.gz \
file://acinclude.m4 \
file://init \
file://htpasswd_shared.diff \
- file://htpasswd_getline.diff"
+ file://htpasswd_getline.diff \
+ file://thttpd.service \
+ file://thttpd.conf \
+ "
S = "${WORKDIR}/thttpd-${PV}"
@@ -21,11 +24,26 @@ PARALLEL_MAKE = ""
INITSCRIPT_NAME = "thttpd"
INITSCRIPT_PARAMS = "defaults"
-inherit autotools-brokensep update-rc.d
+inherit autotools-brokensep useradd systemd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r www"
+USERADD_PARAM_${PN} = "--system --home /var/www/thttpd --no-create-home \
+ --user-group thttpd"
+
+
+SYSTEMD_SERVICE_${PN} = "thttpd.service"
+
+EXTRA_OEMAKE += "'WEBDIR=${localstatedir}/www/thttpd'"
+FILES_${PN}-dbg_append = " ${localstatedir}/www/thttpd/cgi-bin/.debug"
+FILES_${PN}_append = " ${localstatedir} \
+ ${systemd_unitdir}/system/ \
+ "
+
+# The distro choice determines what init scripts are installed
+EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
+EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
-EXTRA_OEMAKE += "'WEBDIR=${servicedir}/www'"
-FILES_${PN}-dbg_append = " ${servicedir}/www/cgi-bin/.debug"
-FILES_${PN}_append = " ${servicedir}"
do_configure () {
install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
@@ -33,9 +51,20 @@ do_configure () {
}
do_install_append () {
- install -d "${D}${sysconfdir}/init.d"
- cat ${WORKDIR}/init | sed -e 's,@@SRVDIR,${servicedir}/www,g' > ${WORKDIR}/thttpd
- install -c -m 755 ${WORKDIR}/thttpd ${D}${sysconfdir}/init.d/thttpd
+ install -d ${D}/var/www/thttpd
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/thttpd.conf ${D}${sysconfdir}/
+ # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ install -d "${D}${sysconfdir}/init.d"
+ cat ${WORKDIR}/init | sed -e 's,@@SRVDIR,${servicedir}/www,g' > ${WORKDIR}/thttpd
+ install -c -m 755 ${WORKDIR}/thttpd ${D}${sysconfdir}/init.d/thttpd
+ fi
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/thttpd.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/index.html ${D}/var/www/thttpd/
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] remove the layer directories
2018-04-04 9:27 [PATCH] remove the layer directories Huang Qiyu
2018-04-04 9:27 ` [PATCH] thttpd: thttpd to systemd Huang Qiyu
@ 2018-04-04 17:54 ` Denys Dmytriyenko
1 sibling, 0 replies; 3+ messages in thread
From: Denys Dmytriyenko @ 2018-04-04 17:54 UTC (permalink / raw)
To: Huang Qiyu; +Cc: meta-arago
On Wed, Apr 04, 2018 at 05:27:26PM +0800, Huang Qiyu wrote:
> Meta-arago writes all the dependent layer directories to the bblayer, which caused to
> add these dependent layers to build environment even though only need one of them.
> This is obviously unreasonable.
Huh? No, this change is not correct. NAK.
> Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
> ---
> meta-arago-distro/conf/layer.conf | 13 -------------
> meta-arago-extras/conf/layer.conf | 10 ----------
> 2 files changed, 23 deletions(-)
>
> diff --git a/meta-arago-distro/conf/layer.conf b/meta-arago-distro/conf/layer.conf
> index c175bd8..260efed 100644
> --- a/meta-arago-distro/conf/layer.conf
> +++ b/meta-arago-distro/conf/layer.conf
> @@ -8,19 +8,6 @@ BBFILE_COLLECTIONS += "meta-arago-distro"
> BBFILE_PATTERN_meta-arago-distro := "^${LAYERDIR}/"
> BBFILE_PRIORITY_meta-arago-distro = "10"
>
> -LAYERDEPENDS_meta-arago-distro = " \
> - core \
> - meta-ti \
> - openembedded-layer \
> - networking-layer \
> - meta-python \
> - linaro-toolchain \
> - meta-optee \
> - qt5-layer \
> - browser-layer \
> - meta-arago-extras \
> -"
> -
> BB_DANGLINGAPPENDS_WARNONLY = "true"
>
> SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
> diff --git a/meta-arago-extras/conf/layer.conf b/meta-arago-extras/conf/layer.conf
> index 83ac107..605d083 100644
> --- a/meta-arago-extras/conf/layer.conf
> +++ b/meta-arago-extras/conf/layer.conf
> @@ -13,16 +13,6 @@ ARAGOBASE := '${@os.path.normpath("${LAYERDIR}/../")}'
>
> LICENSE_PATH += "${LAYERDIR}/licenses"
>
> -LAYERDEPENDS_meta-arago-extras = " \
> - core \
> - meta-ti \
> - openembedded-layer \
> - networking-layer \
> - meta-python \
> - linaro-toolchain \
> - qt5-layer \
> -"
> -
> SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
> matrix-gui-multimedia-demos->amsdk-av-files \
> matrix-gui-oprofile-demos->oprofile \
> --
> 2.7.4
>
>
>
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
^ permalink raw reply [flat|nested] 3+ messages in thread