From 126500c7ffefb63adee0cff40ae14abd4cbfb1af Mon Sep 17 00:00:00 2001 From: Walt Karas Date: Mon, 30 Aug 2021 12:55:39 -0500 Subject: [PATCH] Block TS startup if configured body factory directory does not exist. (#544) * Make sni.yaml errors cause an unrecoverable TS crash at startup. (cherry picked from commit df2485cf590069376b4bdd20a311515c14001eca) * Block TS startup if configured body factory directory does not exist. --- proxy/http/HttpBodyFactory.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc index df5aba9c252..88f6b9fc90f 100644 --- a/proxy/http/HttpBodyFactory.cc +++ b/proxy/http/HttpBodyFactory.cc @@ -286,7 +286,11 @@ HttpBodyFactory::reconfigure() } if (access(directory_of_template_sets, R_OK) < 0) { Warning("Unable to access() directory '%s': %d, %s", (const char *)directory_of_template_sets, errno, strerror(errno)); - Warning(" Please set 'proxy.config.body_factory.template_sets_dir' "); + if (TSSystemState::is_initializing()) { + Emergency(" Please set 'proxy.config.body_factory.template_sets_dir' "); + } else { + Warning(" Please set 'proxy.config.body_factory.template_sets_dir' "); + } } }