yoctolighttpdopenembedded

Installing a custom lighttpd.conf in Yocto


I want to bake a custom Linux with a lighttpd.conf where cgi is enabled by installing my own lighttpd.conf (or alternatively modify the lighttpd.service and start lighttpd with my customized conf). But both ways lead to the same error:

file /lib/systemd/system/lighttpd.service conflicts between attempted installs of lighttpd-service-0.1-r0.aarch64 and lighttpd-1.4.59-r0.aarch64

This is my lighttpd-service_0.1.bb

SUMMARY = "Modified Lighttpd systemd service"
LICENSE = "CLOSED"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI = "file://lighttpd.service"

do_install() {
    install -d ${D}${systemd_unitdir}/system/
    install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system/lighttpd.service
}

FILES_${PN} += "${systemd_unitdir}/system/lighttpd.service"

What is the correct way to overwrite an existing file? And how can I make sure, that my overwrite is processed after the lighttpd-recipe (otherwise processing lighttpd would probably overwrite my file with the same name)?


Solution

  • Another approach is to put a file in /etc/lighttpd/conf.d/99-custom.conf in which you append or override lighttpd.conf directives without having to modify the lighttpd.conf file.

    Print your lighttpd config using: lighttpd -f /etc/lighttpd/lighttpd.conf -p