Artix Linux Forum

Init systems => S6 => Topic started by: Arjun on 19 March 2021, 15:39:59

Title: Porting systemd socket services to s6 services
Post by: Arjun on 19 March 2021, 15:39:59
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.
Title: Re: Porting systemd socket services to s6 services
Post by: Dudemanguy on 19 March 2021, 22:39:13
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.
Title: Re: Porting systemd socket services to s6 services
Post by: artoo on 20 March 2021, 10:31:18
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
Title: Re: Porting systemd socket services to s6 services
Post by: Arjun on 01 April 2021, 11:44:37
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.
Title: Re: Porting systemd socket services to s6 services
Post by: Dudemanguy on 02 April 2021, 15:02:50
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.
Title: Re: Porting systemd socket services to s6 services
Post by: artoo on 03 April 2021, 21:48:38
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 ?