Patchwork [V2,09/10] lighttpd: make /www diretory writable in read-only rootfs

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 29, 2013, 2:33 a.m.
Message ID <9e31ede9ba9cb827f0b5e510d4aab17260aa5eab.1375065009.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/54649/
State New
Headers show

Comments

Qi.Chen@windriver.com - July 29, 2013, 2:33 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

This directory needs to be writable for system to work correctly.

[YOCTO #4103]
[YOCTO #4885]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb |    3 +++
 1 file changed, 3 insertions(+)
Ross Burton - July 29, 2013, 3:56 p.m.
On 29 July 2013 03:33,  <Qi.Chen@windriver.com> wrote:
> +    echo "/www /var/volatile/www" > ${D}${sysconfdir}/default/readonly/lighttpd

/www is the default lighttpd document root, where the web sites are
stored, so putting them in a tmpfs would be very wrong indeed.

Why does lightttp need write access?  If it's putting logs in there
then they should be in /var/log, PIDs in /run and so on.

Ross
Qi.Chen@windriver.com - July 30, 2013, 5:33 a.m.
On 07/29/2013 11:56 PM, Burton, Ross wrote:
> On 29 July 2013 03:33,  <Qi.Chen@windriver.com> wrote:
>> +    echo "/www /var/volatile/www" > ${D}${sysconfdir}/default/readonly/lighttpd
> /www is the default lighttpd document root, where the web sites are
> stored, so putting them in a tmpfs would be very wrong indeed.
>
> Why does lightttp need write access?  If it's putting logs in there
Yes. Exactly the log issue.

After some thinking, I think I'll just drop this patch.
Because even if I move the log location to /var/log/xxx, it will not 
make the situation any better, as the /www directory is still not writable.
So I think, at this point, we should not do too much.
I'll assume that if the user is using a read-only rootfs and his system 
is holding a website, maybe he'll just mount some writable media to /www.

Best Regards,
Chen Qi

> then they should be in /var/log, PIDs in /run and so on.
>
> Ross
>
>

Patch

diff --git a/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb b/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb
index df6ce97..c2f757d 100644
--- a/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb
+++ b/meta/recipes-extended/lighttpd/lighttpd_1.4.32.bb
@@ -49,6 +49,9 @@  do_install_append() {
     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
+    # Create config files for read-only rootfs
+    install -d ${D}${sysconfdir}/default/readonly
+    echo "/www /var/volatile/www" > ${D}${sysconfdir}/default/readonly/lighttpd
 }
 
 FILES_${PN} += "${sysconfdir} /www"