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.
This commit is contained in:
Joris Vink 2024-12-08 12:47:32 +01:00
parent 5df4d075cf
commit d3afe09d4e

View File

@ -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);