enhancement(networking): Add support for systemd socket activation#1045
enhancement(networking): Add support for systemd socket activation#1045
Conversation
Signed-off-by: Bruce Guenter <bruce@untroubled.org>
Vector can listen on multiple sockets, and systemd can activate a program on multiple sockets, so we need to be able to disambiguate which should be used. This requires explicitly configuring multiple sockets. Signed-off-by: Bruce Guenter <bruce@untroubled.org>
|
As this has impact on multiple sources, I was unclear what a proper semantic PR title would look like. |
|
Yeah, I wish we could provide multiple, comma-separated scopes. Technically we could support that and deviate from the spec. |
|
One thing I'd like to do address in the docs is the distinction between this and the |
|
And this might be a dumb question, but is the |
There is no reason why not, other than that I had limited my implementation to the common |
We don't actually have a |
Ha, you're right. It's somewhat relevant given that the 2 are tightly coupled, but less so now. |
lukesteensen
left a comment
There was a problem hiding this comment.
Nice! This is even cleaner than I expected.
Small nitpick: should we give "systemd" as an example for all of the sources instead of just "systemd#2"? I feel like the basic version will likely be more common.
I was actually hoping for advice on that, or if the whole |
|
I like where you ended up with that! It seems relatively simple and unambiguous, and I would assume that in most cases users will only need the |
Signed-off-by: Bruce Guenter <bruce@untroubled.org>
|
@binarylogic to what do I need to change the title on this to make it a valid semantic PR title? |
|
Hey @bruceg , you just need to pick a valid scope here: I'd probably just use |
This adds support for systemd socket activation to all the sources that use the
TcpSourceframework. That is, the syslog, tcp, and vector sources. It adds support for a new address type that indicates the socket is being passed in by systemd (or equivalent).Closes #950
I am not particularly comfortable with the
systemd#Naddress syntax, but it was the best compromise I could think up. It is possible to autodetect when socket activation is in play, but since both Vector and systemd support multiple sockets, this creates an ambiguity with the order in which the sockets are used. I welcome alternate suggestions how to make it work better.I have tested this on the command line using systemfd, but no automated tests are present other than address parsing.