diff options
author | Alejandro Hernandez <alejandro.hernandez@linux.intel.com> | 2015-05-15 01:46:08 -0500 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-05-22 20:13:32 +0200 |
commit | c8ae4dc8ce180bfdf706d98c1501105c97899f5b (patch) | |
tree | 52eb8733ddbe6dac62d912eee61a317fc2dd8ad4 /meta-webserver/recipes-httpd | |
parent | 54def94d4e7aa8900fec58e6aaef8f8c3b0b563e (diff) | |
download | meta-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/recipes-httpd')
-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\ |