From ee40473a1862a4b78e7344f74b3e76a839fc8318 Mon Sep 17 00:00:00 2001 From: Eugene Ware Date: Sun, 7 Jul 2013 20:17:19 +1000 Subject: [PATCH 1/3] Remove socket file before listening for reload --- plugins/nginx-vhosts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index fedcc9d0f..f47dfa590 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -7,6 +7,7 @@ apt-get install -y nginx dnsutils cat< /etc/init/nginx-reloader.conf script + rm -rf /home/git/reload-nginx echo | sudo -u git nc -l -U /home/git/reload-nginx && /etc/init.d/nginx reload end script respawn From 1f4dab1fd8cead6b103ddfe10998cd94dd916fcd Mon Sep 17 00:00:00 2001 From: Eugene Ware Date: Sun, 7 Jul 2013 20:27:23 +1000 Subject: [PATCH 2/3] make reloader service start on reload --- plugins/nginx-vhosts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index f47dfa590..b99320665 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -6,6 +6,11 @@ apt-get update apt-get install -y nginx dnsutils cat< /etc/init/nginx-reloader.conf +description "Dokku nginx reloader service" + +start on runlevel [2345] +stop on runlevel [!2345] + script rm -rf /home/git/reload-nginx echo | sudo -u git nc -l -U /home/git/reload-nginx && /etc/init.d/nginx reload From 6c6196fd5adbf2c1e356367380acce4dcca9a1d5 Mon Sep 17 00:00:00 2001 From: Eugene Ware Date: Mon, 8 Jul 2013 15:07:41 +1000 Subject: [PATCH 3/3] check file exists before removing --- plugins/nginx-vhosts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index b99320665..f03b0b80c 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -12,7 +12,7 @@ start on runlevel [2345] stop on runlevel [!2345] script - rm -rf /home/git/reload-nginx + [[ -f /home/git/reload-nginx ]] && rm -rf /home/git/reload-nginx echo | sudo -u git nc -l -U /home/git/reload-nginx && /etc/init.d/nginx reload end script respawn