socket-proxy: Support exit-on-idle
authorEric Anderson <ejona86@gmail.com>
Sat, 2 May 2020 22:54:24 +0000 (15:54 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 6 May 2020 11:58:57 +0000 (13:58 +0200)
commit9e12d5bf6368de78243a8de11d7739d2c89c1378
treed371e92aca8d305549a1070d2c5c86a98a558c73
parentc28904dae0bc314622150f3ff58ae7b8217167bf
socket-proxy: Support exit-on-idle

This adds the --exit-idle-time argument that causes
systemd-socket-proxyd to exit when there has been an idle period. An
open connection prevents the idle period from starting, even if there is
no activity on that connection.

When combined with another service that uses StopWhenUnneeded=, the
proxy exiting can trigger a resource-intensive process to exit. So
although the proxy may consume minimal resources, significant resources
can be saved indirectly.

Fixes #2106
man/systemd-socket-proxyd.xml
src/socket-proxy/socket-proxyd.c