supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* How can I make the stdin of a longrun process available to other processes by writing to a file?
@ 2020-11-20 23:28 Joshua Ismael Haase Hernández
  2020-11-20 23:45 ` Laurent Bercot
  0 siblings, 1 reply; 2+ messages in thread
From: Joshua Ismael Haase Hernández @ 2020-11-20 23:28 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

I hope this message finds you well.

I want to make the stdin of a `skabus-dyntee` process available to others
to communicate.
`skabus-dyntee-client` instances can listen to a service if i make it
available, but I have no way to send messages to them by writing a file.

I've tried:

-  Using a named pipe and have `skabus-dyntee` read from it (and it dies as
soon as the writer program ends).
-  Configuring up s6-fdholder for my user to use (but it seems I don't
understand how to give it the stdin to read).

What would you recommend?

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

* Re: How can I make the stdin of a longrun process available to other processes by writing to a file?
  2020-11-20 23:28 How can I make the stdin of a longrun process available to other processes by writing to a file? Joshua Ismael Haase Hernández
@ 2020-11-20 23:45 ` Laurent Bercot
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Bercot @ 2020-11-20 23:45 UTC (permalink / raw)
  To: Joshua Ismael Haase Hernández, supervision

>-  Using a named pipe and have `skabus-dyntee` read from it (and it dies as
>soon as the writer program ends).

  Yes, that's normal. If you want to avoid this, you need to keep the
named pipe open, and that can be done via having another process opening
the named pipe for writing, and not dying. That process can even be the
reader itself, see below.


>-  Configuring up s6-fdholder for my user to use (but it seems I don't
>understand how to give it the stdin to read).

  You don't need a fdholder just for this: you already have a living
process that can maintain the named pipe - skabus-dyntee itself.
Try the following:

exec <named-pipe
exec 42>named-pipe
exec skabus-dyntee args...

(or in execline:
  redirfd -r 0 named-pipe
  redirfd -w 42 named-pipe
  skabus-dyntee args...
)

--
  Laurent


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

end of thread, other threads:[~2020-11-20 23:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 23:28 How can I make the stdin of a longrun process available to other processes by writing to a file? Joshua Ismael Haase Hernández
2020-11-20 23:45 ` 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).