commit d3afe09d4e03382fe865d7d3750e2c8709cadc5d
parent 5df4d075cf6317e1b84d1612cf79d7d1857be263
Author: Joris Vink <joris@sanctorum.se>
Date: Sun, 8 Dec 2024 12:47:32 +0100
Give keymgr up to 60 seconds to start under ACME=1.
The keymgr is responsible for generating private keys for the
account and domains which can take a while. However the
worker supervisor still only gave keymgr 5 seconds to
start which usually leads to strange errors when
trying to start keymgr with ACME=1 if no
account-key was present.
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/worker.c b/src/worker.c
@@ -182,8 +182,8 @@ kore_worker_init(void)
int
kore_worker_spawn(u_int16_t idx, u_int16_t id, u_int16_t cpu)
{
- int cnt;
struct kore_worker *kw;
+ int cnt, maxcnt;
#if defined(__linux__)
int status;
#endif
@@ -204,8 +204,13 @@ kore_worker_spawn(u_int16_t idx, u_int16_t id, u_int16_t cpu)
!kore_connection_nonblock(kw->pipe[1], 0))
fatal("could not set pipe fds to nonblocking: %s", errno_s);
+ maxcnt = 50;
+
switch (id) {
case KORE_WORKER_KEYMGR:
+#if defined(KORE_USE_ACME)
+ maxcnt = 600;
+#endif
kw->ps = &keymgr_privsep;
break;
#if defined(KORE_USE_ACME)
@@ -227,7 +232,7 @@ kore_worker_spawn(u_int16_t idx, u_int16_t id, u_int16_t cpu)
kore_worker_entry(kw);
exit(1);
} else {
- for (cnt = 0; cnt < 50; cnt++) {
+ for (cnt = 0; cnt < maxcnt; cnt++) {
if (kw->ready == 1)
break;
usleep(100000);