diff --git a/ChangeLog.md b/ChangeLog.md index 7abf7874..e8bbe19e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,6 +19,10 @@ All relevant changes are documented in this file. - Add `runparts -b` (batch mode) support, disables escape sequences - New configure `--without-rc-local`, disables `/etc/rc.local` support - New configure `--disable-cgroup` option, disables cgroup v2 detection + - Extend `initctl` timeout connecting and waiting for Finit reply. The + previous 2 + 2 second poll timeout has proved to be too short on more + complex systems. Now a 15 + 15 second timeout is applied which should + be more resistant to temporary overload scenarios, issue #407 ### Fixes - Fix #397: system shutdown/reboot can block on console input if action diff --git a/src/client.c b/src/client.c index c3fd3aef..a8c06ac4 100644 --- a/src/client.c +++ b/src/client.c @@ -29,6 +29,8 @@ #include "client.h" #include "log.h" +#define REQUEST_TIMEOUT 15000 + static int sd = -1; int client_connect(void) @@ -85,7 +87,7 @@ int client_request(struct init_request *rq, ssize_t len) pfd.fd = sd; pfd.events = POLLOUT; - if (poll(&pfd, 1, 2000) <= 0) { + if (poll(&pfd, 1, REQUEST_TIMEOUT) <= 0) { warn("Timed out waiting for Finit, errno %d", errno); return -1; } @@ -107,7 +109,7 @@ int client_request(struct init_request *rq, ssize_t len) pfd.fd = sd; pfd.events = POLLIN | POLLERR | POLLHUP; - if ((rc = poll(&pfd, 1, 2000)) <= 0) { + if ((rc = poll(&pfd, 1, REQUEST_TIMEOUT)) <= 0) { if (rc) { if (errno == EINTR) /* shutdown/reboot */ return -1;