Skip to main content
Topic: Porting systemd socket services to s6 services (Read 906 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Porting systemd socket services to s6 services

Hi Team,

I am porting a systemd socket service to s6. The socket unit listens on an inet socket domain and trigger the systemd service on receiving traffic on the socket. The systemd service further redirect the data to another inet socket using systemd-proxy tool.
Do we have any such facility in s6? I have gone through s6-tcpserver but do we have any other ways to perform the same operation in s6 services? Please help.

Re: Porting systemd socket services to s6 services

Reply #1
Waking up when receiving traffic through the socket? Good question. That's something I would expect the daemon to do and not s6 itself. I'm not familiar with how exactly the socket files/services work in systemd so I don't know if it does anything particularly special with them.

Re: Porting systemd socket services to s6 services

Reply #2
The s6 documentation has this to say on socket activation...

Quote
First, it's important to realize that you don't need socket activation. It's a marketing word used by systemd advocates that mixes a couple useful architecture concepts and several horrible ideas, for a very minor speed benefit. Read this mail and this post for details.
https://skarnet.org/software/s6/socket-activation.html

Re: Porting systemd socket services to s6 services

Reply #3
But how to port forward? I need to listen on a specific inet socket and on receiving traffic, I need to transfer the data to another inet socket which inturn may send data to the initial listening inet socket.
Using s6-tcpserver4 I am able to listen and trigger any program upon receiving the traffic on the specified socket. But not sure, how to bidirectionally transfer the data using s6 tools.

Re: Porting systemd socket services to s6 services

Reply #4
But how to port forward? I need to listen on a specific inet socket and on receiving traffic, I need to transfer the data to another inet socket which inturn may send data to the initial listening inet socket.
Using s6-tcserpver4 I am able to listen and trigger any program upon receiving the traffic on the specified socket. But not sure, how to bidirectionally transfer the data using s6 tools.

You might want to ask the skarnet mailing list and/or the #s6 IRC that question. I don't know the answer. Feel free to let me know if s6 in Artix is missing something you need to accomplish this though. We should have s6-networking, but perhaps there's some other puzzle piece missing.

 

Re: Porting systemd socket services to s6 services

Reply #5
In the link posted earlier, there is a section and further links ...

Quote
So, how do I open all my sockets first, store them, and dispatch them to daemons later ?