diff options
Diffstat (limited to 'meta-webserver')
-rw-r--r-- | meta-webserver/recipes-httpd/nginx/files/nginx.service | 12 | ||||
-rw-r--r-- | meta-webserver/recipes-httpd/nginx/nginx_1.4.4.bb | 13 |
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] | ||
2 | Description=Nginx Server | ||
3 | After=network.target | ||
4 | [Service] | ||
5 | Type=forking | ||
6 | PIDFile=@SYSCONFDIR@/nginx/run/nginx.pid | ||
7 | ExecStartPre=mkdir -p @LOCALSTATEDIR@/log/nginx | ||
8 | ExecStart=@SYSCONFDIR@/init.d/nginx start | ||
9 | ExecStop=@SYSCONFDIR@/init.d/nginx stop | ||
10 | [Install] | ||
11 | WantedBy=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 | " |
21 | SRC_URI[md5sum] = "5dfaba1cbeae9087f3949860a02caa9f" | 22 | SRC_URI[md5sum] = "5dfaba1cbeae9087f3949860a02caa9f" |
22 | SRC_URI[sha256sum] = "7c989a58e5408c9593da0bebcd0e4ffc3d892d1316ba5042ddb0be5b0b4102b9" | 23 | SRC_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 | ||
86 | pkg_postinst_${PN} () { | 95 | pkg_postinst_${PN} () { |
@@ -93,7 +102,9 @@ pkg_postinst_${PN} () { | |||
93 | fi | 102 | fi |
94 | } | 103 | } |
95 | 104 | ||
96 | FILES_${PN} += "${localstatedir}/" | 105 | FILES_${PN} += "${localstatedir}/ \ |
106 | ${systemd_unitdir}/system/nginx.service \ | ||
107 | " | ||
97 | 108 | ||
98 | CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \ | 109 | CONFFILES_${PN} = "${sysconfdir}/nginx/nginx.conf \ |
99 | ${sysconfdir}/nginx/fastcgi.conf\ | 110 | ${sysconfdir}/nginx/fastcgi.conf\ |