summaryrefslogtreecommitdiffstats
path: root/meta-webserver
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2015-05-15 01:46:08 -0500
committerMartin Jansa <Martin.Jansa@gmail.com>2015-05-22 20:13:32 +0200
commitc8ae4dc8ce180bfdf706d98c1501105c97899f5b (patch)
tree52eb8733ddbe6dac62d912eee61a317fc2dd8ad4 /meta-webserver
parent54def94d4e7aa8900fec58e6aaef8f8c3b0b563e (diff)
downloadmeta-openembedded-c8ae4dc8ce180bfdf706d98c1501105c97899f5b.tar.gz
nginx: Add suport for systemd
Adds support for systemd, creates a service for nginx and installs it if required Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-webserver')
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/nginx.service12
-rw-r--r--meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb13
2 files changed, 24 insertions, 1 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx.service b/meta-webserver/recipes-httpd/nginx/files/nginx.service
new file mode 100644
index 000000000..705450e47
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=Nginx Server
3After=network.target
4[Service]
5Type=forking
6PIDFile=@SYSCONFDIR@/nginx/run/nginx.pid
7ExecStartPre=mkdir -p @LOCALSTATEDIR@/log/nginx
8ExecStart=@SYSCONFDIR@/init.d/nginx start
9ExecStop=@SYSCONFDIR@/init.d/nginx stop
10[Install]
11WantedBy=multi-user.target
12
diff --git a/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb b/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb
index e78ed34dd..0dfdb5b86 100644
--- a/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb
+++ b/meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb
@@ -17,6 +17,7 @@ SRC_URI = " \
17 file://nginx.conf \ 17 file://nginx.conf \
18 file://nginx.init \ 18 file://nginx.init \
19 file://nginx-volatile.conf \ 19 file://nginx-volatile.conf \
20 file://nginx.service \
20" 21"
21SRC_URI[md5sum] = "5dfaba1cbeae9087f3949860a02caa9f" 22SRC_URI[md5sum] = "5dfaba1cbeae9087f3949860a02caa9f"
22SRC_URI[sha256sum] = "7c989a58e5408c9593da0bebcd0e4ffc3d892d1316ba5042ddb0be5b0b4102b9" 23SRC_URI[sha256sum] = "7c989a58e5408c9593da0bebcd0e4ffc3d892d1316ba5042ddb0be5b0b4102b9"
@@ -81,6 +82,14 @@ do_install () {
81 install -d ${D}${sysconfdir}/default/volatiles 82 install -d ${D}${sysconfdir}/default/volatiles
82 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx 83 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
83 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx 84 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
85
86 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
87 install -d ${D}${systemd_unitdir}/system
88 install -m 0644 ${WORKDIR}/nginx.service ${D}${systemd_unitdir}/system/
89 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
90 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
91 ${D}${systemd_unitdir}/system/nginx.service
92 fi
84} 93}
85 94
86pkg_postinst_${PN} () { 95pkg_postinst_${PN} () {
@@ -93,7 +102,9 @@ pkg_postinst_${PN} () {
93 fi 102 fi
94} 103}
95 104
96FILES_${PN} += "${localstatedir}/" 105FILES_${PN} += "${localstatedir}/ \
106 ${systemd_unitdir}/system/nginx.service \
107 "
97 108
98CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \ 109CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \
99 ${sysconfdir}/nginx/fastcgi.conf\ 110 ${sysconfdir}/nginx/fastcgi.conf\