Page MenuHomePhabricator

port anon-ws-disable-stacked-tor to systemd socket activation
Closed, ResolvedPublic

Description

Rather than having loads of socat listeners idling around where lots of them don't get used, it may be better to use systemd socket activation.

systemd-socket-proxyd might help.

Otherwise stackexchange claims socat also works with systemd socket activation.

Ideally, we could avoid having one systemd unit file per port redirection. Perhaps systemd template unit files can be used.

Details

Impact
Normal

Event Timeline

Patrick created this task.Feb 5 2017, 9:01 PM

As per https://lists.freedesktop.org/archives/systemd-devel/2017-February/038261.html the package would not be that cleanly implemented. Disadvantage: lots of systemd unit files. One per port. (Also one per unix domain socket file.)

systemd feature request:
make ListenStream= port number available as ${PORT} for ExecStart
https://github.com/systemd/systemd/issues/5403

Patrick changed the task status from Open to testing-in-next-build-required.Feb 11 2018, 1:12 AM
Patrick edited projects, added Whonix 14; removed Whonix 15.

Had to be done for Whonix 14 to stop wasting RAM by too many socat instances.

https://forums.whonix.org/t/port-anon-ws-disable-stacked-tor-to-systemd-socket-activation

Patrick closed this task as Resolved.Mar 5 2018, 9:14 PM
Patrick claimed this task.

@HulaHoop in T544#16070

How are we doing on RAM use? Is it any more or less efficient than socat after you cut down the number of spawned instances?

I haven't compared

  • a) systemd-socket-proxyd in combination with socat
  • vs b) systemd-socket-proxyd in combination with systemd-socket-proxyd.

b) is is implemented since that was more straight forward, already documented and more "standard" solution.)

As long as the socket is not being used, no systemd-socket-proxyd is being spawned, since this is using systemd socket activation, which results in low RAM usage for most use cases.

I would expect systemd socket activation and systemd-socket-proxyd to be the most modern and RAM efficient.