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: Guillermo <gdiazhartusch@gmail.com>,
	"supervision@list.skarnet.org" <supervision@list.skarnet.org>
Subject: Re: s6-supervise: use of nosetsid
Date: Thu, 03 Dec 2020 21:34:18 +0000	[thread overview]
Message-ID: <em599c31f9-f497-4f3d-83f9-363cd9fa220e@elzian> (raw)
In-Reply-To: <CADQ2Nw_G=D+r++WgGeDRtSNDBL-iLchEVi=G5QrpPnOmZJdNHQ@mail.gmail.com>

>I remember occasionally using 'nosetsid' files for the convenience of
>being able to redirect the output of 'run' and 'finish' to /dev/tty
>(the controlling terminal of the shell I used to run s6-svscan) so
>that I could see certain messages during tests in which s6-svscan had
>its stdout & stderr redirected to a logger (typically, for emulating
>an s6-linux-init-like s6-svscan-as-process-1 scenario). I think it was
>for doing something like
>
>foreground {
>   redirfd -w 1 /dev/tty
>   echo "Some message I want displayed on my terminal"
>}

  Interesting. Would you be able to do the same thing with saving
/dev/tty as an extra file descriptor instead?

s6-svscan 3>&1 &

...

foreground {
   fdmove 1 3
   echo "Some message I want displayed on my terminal"
}

  Granted, this leaks a fd into all your services, but if it's for
terminal testing it shouldn't matter much. Otherwise, for maximum
hacking value, you could use the -X option to s6-svscan, which would
not leak the tty fd into all the services, but only transmit it as
s6-svscan-log's stderr - so in order to print something to the
terminal you'd have to send it to the catch-all logger, and configure
that logger with a filter that sends those messages to stderr. :)

  So, can you juggle fds to avoid nosetsid, or can't you do the same
thing without it?

--
  Laurent


  reply	other threads:[~2020-12-03 21:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 16:46 Laurent Bercot
2020-12-03 17:09 ` Casper Ti. Vector
     [not found] ` <X8kbtfETM/jWuG1O@caspervector>
2020-12-03 17:21   ` Laurent Bercot
2020-12-04  6:45     ` Casper Ti. Vector
2020-12-03 19:53 ` Steve Litt
2020-12-03 19:56 ` Guillermo
2020-12-03 21:34   ` Laurent Bercot [this message]
2020-12-04  1:46     ` Guillermo
2020-12-04  6:29       ` Laurent Bercot
2020-12-03 21:25 ` eric vidal

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=em599c31f9-f497-4f3d-83f9-363cd9fa220e@elzian \
    --to=ska-supervision@skarnet.org \
    --cc=gdiazhartusch@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).