summaryrefslogtreecommitdiffstats
path: root/meta-webserver
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@siemens.com>2016-02-04 16:03:13 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2016-02-15 10:21:34 +0100
commitf67d121f9f2bde198887da01e3673a18d0249a5c (patch)
tree0d507d5277ff0862d5e9c10aeb82104eece4166d /meta-webserver
parentd74d33e1e403782a4840a62ecda5ad148e933dcd (diff)
downloadmeta-openembedded-f67d121f9f2bde198887da01e3673a18d0249a5c.tar.gz
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>
Diffstat (limited to 'meta-webserver')
-rw-r--r--meta-webserver/recipes-httpd/nginx/nginx_1.9.9.bb13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/nginx_1.9.9.bb b/meta-webserver/recipes-httpd/nginx/nginx_1.9.9.bb
index 06d61c769..08f53a7d9 100644
--- a/meta-webserver/recipes-httpd/nginx/nginx_1.9.9.bb
+++ b/meta-webserver/recipes-httpd/nginx/nginx_1.9.9.bb
@@ -27,6 +27,9 @@ inherit update-rc.d useradd
27CFLAGS_append = " -fPIE -pie" 27CFLAGS_append = " -fPIE -pie"
28CXXFLAGS_append = " -fPIE -pie" 28CXXFLAGS_append = " -fPIE -pie"
29 29
30NGINX_WWWDIR ?= "${localstatedir}/www/localhost"
31NGINX_USER ?= "www"
32
30EXTRA_OECONF = "" 33EXTRA_OECONF = ""
31 34
32do_configure () { 35do_configure () {
@@ -71,9 +74,9 @@ do_install () {
71 fi 74 fi
72 install -d ${D}${sysconfdir}/${BPN} 75 install -d ${D}${sysconfdir}/${BPN}
73 ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run 76 ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
74 install -d ${D}${localstatedir}/www/localhost 77 install -d ${D}${NGINX_WWWDIR}
75 mv ${D}/usr/html ${D}${localstatedir}/www/localhost/ 78 mv ${D}/usr/html ${D}${NGINX_WWWDIR}/
76 chown www:www-data -R ${D}${localstatedir} 79 chown ${NGINX_USER}:www-data -R ${D}${NGINX_WWWDIR}
77 80
78 install -d ${D}${sysconfdir}/init.d 81 install -d ${D}${sysconfdir}/init.d
79 install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx 82 install -m 0755 ${WORKDIR}/nginx.init ${D}${sysconfdir}/init.d/nginx
@@ -130,6 +133,6 @@ INITSCRIPT_PARAMS = "defaults 92 20"
130USERADD_PACKAGES = "${PN}" 133USERADD_PACKAGES = "${PN}"
131USERADD_PARAM_${PN} = " \ 134USERADD_PARAM_${PN} = " \
132 --system --no-create-home \ 135 --system --no-create-home \
133 --home ${localstatedir}/www/localhost \ 136 --home ${NGINX_WWWDIR} \
134 --groups www-data \ 137 --groups www-data \
135 --user-group www" 138 --user-group ${NGINX_USER}"