Add socket activation support by preloading libsdsock with LD_PRELOAD #23546
Replies: 2 comments
-
You could also use https://www.freedesktop.org/software/systemd/man/latest/systemd-socket-proxyd.html |
Beta Was this translation helpful? Give feedback.
-
True, but if you use I think the main advantage of using libsdsock with Currently pasta does not support preserving the source IP address when a custom network is used. For example a quadlet setup like this does not support preserving the source address: file: ~/.config/containers/systemd/mynet.network
file: ~/.config/containers/systemd/myweb.container
Changing such a setup to use libsdsock with |
Beta Was this translation helpful? Give feedback.
-
Status: experimental
Is it possible to use socket activation even when the executable in the container image does not support socket activation?
Yes, sometimes.
If the executable in the container is dynamically linked, it might be possible to preload the library libsdsock
to add support for socket activation.
The container unit needs to set the environment variables
LD_PRELOAD
andLIBSDSOCK_MAP
Also modify the container image so that it has the systemd libraries (RPM package: systemd-libs) and the file /usr/local/lib/libsdsock.so installed.
I documented it as a step-by-step example
example: pasta + custom network + socket activation + libsdsock - source address preserved
Beta Was this translation helpful? Give feedback.
All reactions