supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* s6 vs shell wrappers for client connections
@ 2023-01-10 22:23 artur.brzozowski
  2023-01-11  9:53 ` Laurent Bercot
  2023-01-11 20:15 ` Steve Litt
  0 siblings, 2 replies; 5+ messages in thread
From: artur.brzozowski @ 2023-01-10 22:23 UTC (permalink / raw)
  To: supervision

Hi.

I'm wondering if and how s6 can help with the following
user-oriented problem:

You have a program that can be started normally or as a service
that accepts connections through a socket. For client
connections, an additional binary is supplied.

The simplest way to make sure that the program launches
regardless of whether there's a server running or not is a
wrapper script that executes the right binary based on socket's
availability.

Example of this is the 'foot' terminal emulator - it has 'foot
[--server]' and footclient binaries.  How, if at all, could s6
help remove this executable ambiguity, the need for checking and
wrapping? The goal is to always run the program correctly: if
server is available, connect to it with client binary, if not -
use the standard one.

In a not-so-old issue thread [1] I read:
>
> User: st3r4g
> For example, with s6-rc you would have a foot server service
> running foot -s -p 3 and have notification-fd set to 3 in the
> service directory. Then you can have e.g. footclient irssi
> depend on the foot server service, and they will all be started
> in the correct order, as soon as possible.
>
> User: dnkl
> The --print-pid option was designed with s6 in mind ;)

To continue with the example: I set up 'foot' as described above.
The result is that s6-svscan/supervise starts the 'foot' server,
places an 'S' socket in the service directory and sits there.  I
can connect to the server by pointing to socket in service
directory
$ footclient -s "$s6-foot-servdir/S"

This however, still requires me to check for the socket and
if-else the binary and options each time I want to start the
program, doesn't it? Does s6 offer a remedy?

Any pointers, even to the correct man page for this, would be
appreciated.

Best wishes,
Artur

[0] https://codeberg.org/dnkl/foot
[1] https://codeberg.org/dnkl/foot/issues/604#issuecomment-267617


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-12  0:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 22:23 s6 vs shell wrappers for client connections artur.brzozowski
2023-01-11  9:53 ` Laurent Bercot
2023-01-11 16:08   ` artur.brzozowski
2023-01-11 20:15 ` Steve Litt
2023-01-12  0:51   ` Laurent Bercot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).