mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-02 01:50:18 +00:00
nginx: make nginx user and home directory configurable
This allows selecting a different user then "www" in a bbappend. It also allows to change the default value of "/var/www/localhost" to something else. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
committed by
Martin Jansa
parent
d74d33e1e4
commit
f67d121f9f
@@ -27,6 +27,9 @@ inherit update-rc.d useradd
|
|||||||
CFLAGS_append = " -fPIE -pie"
|
CFLAGS_append = " -fPIE -pie"
|
||||||
CXXFLAGS_append = " -fPIE -pie"
|
CXXFLAGS_append = " -fPIE -pie"
|
||||||
|
|
||||||
|
NGINX_WWWDIR ?= "${localstatedir}/www/localhost"
|
||||||
|
NGINX_USER ?= "www"
|
||||||
|
|
||||||
EXTRA_OECONF = ""
|
EXTRA_OECONF = ""
|
||||||
|
|
||||||
do_configure () {
|
do_configure () {
|
||||||
@@ -71,9 +74,9 @@ do_install () {
|
|||||||
fi
|
fi
|
||||||
install -d ${D}${sysconfdir}/${BPN}
|
install -d ${D}${sysconfdir}/${BPN}
|
||||||
ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
|
ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
|
||||||
install -d ${D}${localstatedir}/www/localhost
|
install -d ${D}${NGINX_WWWDIR}
|
||||||
mv ${D}/usr/html ${D}${localstatedir}/www/localhost/
|
mv ${D}/usr/html ${D}${NGINX_WWWDIR}/
|
||||||
chown www:www-data -R ${D}${localstatedir}
|
chown ${NGINX_USER}:www-data -R ${D}${NGINX_WWWDIR}
|
||||||
|
|
||||||
install -d ${D}${sysconfdir}/init.d
|
install -d ${D}${sysconfdir}/init.d
|
||||||
install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
|
install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
|
||||||
@@ -130,6 +133,6 @@ INITSCRIPT_PARAMS = "defaults 92 20"
|
|||||||
USERADD_PACKAGES = "${PN}"
|
USERADD_PACKAGES = "${PN}"
|
||||||
USERADD_PARAM_${PN} = " \
|
USERADD_PARAM_${PN} = " \
|
||||||
--system --no-create-home \
|
--system --no-create-home \
|
||||||
--home ${localstatedir}/www/localhost \
|
--home ${NGINX_WWWDIR} \
|
||||||
--groups www-data \
|
--groups www-data \
|
||||||
--user-group www"
|
--user-group ${NGINX_USER}"
|
||||||
|
|||||||
Reference in New Issue
Block a user