nginx: generate certificate on reload
The nginx service would generate a self-certificate upon restart (if
there's not already an existing certificate), but not upon reload.
Enable this for reload as well : the phosphor certificate management app
requires services that want to generate self-signed certificates to do
it upon reload (if reload is supported).
Change-Id: If709589ff3d727c6dd149029570991aea66d4b15
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/recipes-httpd/nginx/files/nginx.service b/recipes-httpd/nginx/files/nginx.service
index 3f9dd3d..a502026 100644
--- a/recipes-httpd/nginx/files/nginx.service
+++ b/recipes-httpd/nginx/files/nginx.service
@@ -9,7 +9,7 @@
ExecStartPre=-/usr/bin/env mkdir /var/volatile/nginx/
ExecStartPre=/usr/bin/env nginx -t -p /var/volatile/nginx
ExecStart=/usr/bin/env nginx -p /var/volatile/nginx
-ExecReload=/usr/bin/env kill -s HUP $MAINPID
+ExecReload=/usr/bin/env gen-cert.sh ; /usr/bin/env kill -s HUP $MAINPID
ExecStop=/usr/bin/env kill -s QUIT $MAINPID
PrivateTmp=true
# First time on system takes longer for initial setup so