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: supervision@list.skarnet.org
Subject: Re: redirection tricks on processor invocation
Date: Sat, 13 Jun 2009 07:13:04 +0200	[thread overview]
Message-ID: <20090613051304.GA11204@skarnet.org> (raw)
In-Reply-To: <20090612114842.GA33977@grummit.biaix.org>

> A week later, I've been unable to translate this simple execline snippet
> to shell syntax. I can't figure out a way to workaround the fact that
> shell pipes are created before redirection. Any hints?

 Your problem is that the shell can't open anonymous fds. The only way
to get an anonymous pipe is the | construct, which does not open more fds
because it's redirected at once to 1 and 0.
 The multitee command needs one more fd to be opened, and you can't do
that with anonymous pipes. You need a named pipe for this:

 mkfifo /tmp/fifo ;
 yourapplication </tmp/fifo &
 exec 7>/tmp/fifo multitee 0-1,7

 Inelegant? Unsatisfying?
 Go forth, o my convert, and preach the virtues of execline. :)

-- 
 Laurent


      reply	other threads:[~2009-06-13  5:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 10:48 Joan Picanyol i Puig
2009-06-03  6:26 ` Laurent Bercot
2009-06-03 10:31   ` Joan Picanyol i Puig
2009-06-03 10:38     ` Joan Picanyol i Puig
2009-06-12 11:48       ` Joan Picanyol i Puig
2009-06-13  5:13         ` 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=20090613051304.GA11204@skarnet.org \
    --to=ska-supervision@skarnet.org \
    --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).