supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "Joshua Ismael Haase Hernández" <hahj87@gmail.com>,
	supervision@list.skarnet.org
Subject: Re: How can I make the stdin of a longrun process available to other processes by writing to a file?
Date: Fri, 20 Nov 2020 23:45:06 +0000	[thread overview]
Message-ID: <em07cc1b19-7854-4e91-8abe-da08d2dc5b11@elzian> (raw)
In-Reply-To: <CA+ypG2ZaXn738E39RRWpQUewiBLE+nkF29iMQLMLs7AYh5A9YQ@mail.gmail.com>

>-  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


      reply	other threads:[~2020-11-20 23:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 23:28 Joshua Ismael Haase Hernández
2020-11-20 23:45 ` Laurent Bercot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=em07cc1b19-7854-4e91-8abe-da08d2dc5b11@elzian \
    --to=ska-supervision@skarnet.org \
    --cc=hahj87@gmail.com \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).