summaryrefslogtreecommitdiffstats
path: root/meta-webserver
diff options
context:
space:
mode:
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\