Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caddy socket activation (bind fd/N, bind fdgram/N) only works with a single systemd.socket file, limiting configurability #6792

Open
codyps opened this issue Jan 17, 2025 · 2 comments
Labels
feature ⚙️ New feature or request

Comments

@codyps
Copy link

codyps commented Jan 17, 2025

systemd.socket files apply many of the options specified therein to all the sockets defined in the systemd.socket file. For example: BindToDevice. Systemd supports using multiple socket files for a single service, but does not define an ordering of the sockets between those socket files. Instead, systemd provides the names of the socket files within environment variables (LISTEN_FDS and LISTEN_FDNAMES combine to name the fds).

To enable the full flexibility of socket activation, caddy could allow binding to fds based on these names.

This is especially useful as caddy does not have BindToDevice (SO_BINDTODEVICE) nor FreeBind (SO_FREEBIND) support, meaning socket activation is the only way to obtain those today.

@mholt mholt added the feature ⚙️ New feature or request label Jan 17, 2025
@Ko496-glitch
Copy link

@codyps can i take on this issue ?

@codyps
Copy link
Author

codyps commented Jan 20, 2025

@Ko496-glitch sure. 👍

For reference, sd_listen_fds_with_names() is the function systemd provides for C code to obtain this info, and the man page linked here also has some details on the internal behavior with respect to what the env variables contain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants