diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 94a42e1cab..ad56ac72b2 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -21,6 +21,7 @@ #include "main-func.h" #include "parse-util.h" #include "resolve-private.h" +#include "rlimit-util.h" #include "set.h" #include "socket-forward.h" #include "socket-util.h" @@ -563,6 +564,10 @@ static int run(int argc, char *argv[]) { if (r <= 0) return r; + /* Each connection holds several fds (two sockets, their duplicates and a pipe per direction), so + * the default soft limit of 1024 would run out well before the default connection limit. */ + (void) rlimit_nofile_bump(-1); + r = sd_event_default(&context.event); if (r < 0) return log_error_errno(r, "Failed to allocate event loop: %m"); diff --git a/test/units/TEST-74-AUX-UTILS.socket-proxyd.sh b/test/units/TEST-74-AUX-UTILS.socket-proxyd.sh index c028747ec0..0767e27268 100755 --- a/test/units/TEST-74-AUX-UTILS.socket-proxyd.sh +++ b/test/units/TEST-74-AUX-UTILS.socket-proxyd.sh @@ -38,6 +38,8 @@ EOF cat >/run/systemd/system/test-proxyd.service <