aboutsummaryrefslogtreecommitdiff
path: root/net/nginx/files
diff options
context:
space:
mode:
authorGlen Huang <i@glenhuang.com>2022-10-22 22:17:08 +0800
committerGlen Huang <i@glenhuang.com>2022-10-24 10:07:06 +0800
commit7f04710579ef9466bc429403624fed71f112d6c9 (patch)
treef7f73297d0e38e6a56a500912027208844fb6618 /net/nginx/files
parent035cc09e7f2b3619adce079ee266ad354f32e53b (diff)
amce: use procd to restart services
Directly calling `/etc/init.d/<service> reload` in a hotplug script can inadvertently start a stopped service. Signed-off-by: Glen Huang <i@glenhuang.com>
Diffstat (limited to 'net/nginx/files')
-rw-r--r--net/nginx/files/acme.hotplug3
-rw-r--r--net/nginx/files/nginx.init5
2 files changed, 5 insertions, 3 deletions
diff --git a/net/nginx/files/acme.hotplug b/net/nginx/files/acme.hotplug
deleted file mode 100644
index 74f1448d7..000000000
--- a/net/nginx/files/acme.hotplug
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$ACTION" = renewed ]; then
- /etc/init.d/nginx reload
-fi
diff --git a/net/nginx/files/nginx.init b/net/nginx/files/nginx.init
index 300a8c657..632a3f10a 100644
--- a/net/nginx/files/nginx.init
+++ b/net/nginx/files/nginx.init
@@ -66,6 +66,11 @@ reload_service() {
}
+service_triggers() {
+ procd_add_raw_trigger acme.renew 5000 /etc/init.d/nginx reload
+}
+
+
extra_command "relog" "Reopen log files (without reloading)"
relog() {
[ -d /var/log/nginx ] || mkdir -p /var/log/nginx