From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30969 invoked from network); 3 Dec 2020 21:34:20 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 3 Dec 2020 21:34:20 -0000 Received: (qmail 25141 invoked by uid 89); 3 Dec 2020 21:34:45 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 25134 invoked from network); 3 Dec 2020 21:34:45 -0000 From: "Laurent Bercot" To: Guillermo , "supervision@list.skarnet.org" Subject: Re: s6-supervise: use of nosetsid Date: Thu, 03 Dec 2020 21:34:18 +0000 Message-Id: In-Reply-To: References: Reply-To: "Laurent Bercot" User-Agent: eM_Client/8.0.3385.0 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedujedrudeiiedgudehudcutefuodetggdotffvucfrrhhofhhilhgvmecupfgfoffgtffkveetuefngfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkjghfrhgfgggtgfesthhqredttderjeenucfhrhhomhepfdfnrghurhgvnhhtuceuvghrtghothdfuceoshhkrgdqshhuphgvrhhvihhsihhonhesshhkrghrnhgvthdrohhrgheqnecuggftrfgrthhtvghrnhepvdfgveffueelgedvkedtffetgedvieeifeektefgueehffehleehjefhveeuieejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuth >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